# CVE-2022-50530: blk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.14%, higher than 3% of CVEs (2026-12-01)
- Published: 2025-10-07T15:19:21.259Z
- Modified: 2026-06-17T05:23:44.040Z
- Weaknesses: CWE-476
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

blk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping()

Our syzkaller report a null pointer dereference, root cause is
following:

__blk_mq_alloc_map_and_rqs
 set->tags[hctx_idx] = blk_mq_alloc_map_and_rqs
  blk_mq_alloc_map_and_rqs
   blk_mq_alloc_rqs
    // failed due to oom
    alloc_pages_node
    // set->tags[hctx_idx] is still NULL
    blk_mq_free_rqs
     drv_tags = set->tags[hctx_idx];
     // null pointer dereference is triggered
     blk_mq_clear_rq_mapping(drv_tags, ...)

This is because commit 63064be150e4 ("blk-mq:
Add blk_mq_alloc_map_and_rqs()") merged the two steps:

1) set->tags[hctx_idx] = blk_mq_alloc_rq_map()
2) blk_mq_alloc_rqs(..., set->tags[hctx_idx])

into one step:

set->tags[hctx_idx] = blk_mq_alloc_map_and_rqs()

Since tags is not initialized yet in this case, fix the problem by
checking if tags is NULL pointer in blk_mq_clear_rq_mapping().

(As written by CVE List.)

## Affected

- Linux Linux: from 63064be150e4b1ba1e4af594ef5aa81adf21a52d before 6a440e6d04431e774dc084abe88c106e2a474c1a; from 63064be150e4b1ba1e4af594ef5aa81adf21a52d before 76dd298094f484c6250ebd076fa53287477b2328; 5.16 (not affected: before 5.16; from 6.0.6 up to 6.0.*; from 6.1 up to *)
- linux linux_kernel: from 5.16 before 6.0.6; 6.1

## References

- <https://git.kernel.org/stable/c/6a440e6d04431e774dc084abe88c106e2a474c1a> (patch)
- <https://git.kernel.org/stable/c/76dd298094f484c6250ebd076fa53287477b2328> (patch)

## Sources

- CVE List: [CVE-2022-50530](https://www.cve.org/CVERecord?id=CVE-2022-50530), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2022-50530](https://nvd.nist.gov/vuln/detail/CVE-2022-50530), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-50530 · Whole record: https://cve.day/CVE-2022-50530.json · Rebuilt by cve.day 2026-11-25T22:58:21.259Z
