{"id":"CVE-2022-50530","state":"PUBLISHED","title":"blk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nblk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping()\n\nOur syzkaller report a null pointer dereference, root cause is\nfollowing:\n\n__blk_mq_alloc_map_and_rqs\n set->tags[hctx_idx] = blk_mq_alloc_map_and_rqs\n  blk_mq_alloc_map_and_rqs\n   blk_mq_alloc_rqs\n    // failed due to oom\n    alloc_pages_node\n    // set->tags[hctx_idx] is still NULL\n    blk_mq_free_rqs\n     drv_tags = set->tags[hctx_idx];\n     // null pointer dereference is triggered\n     blk_mq_clear_rq_mapping(drv_tags, ...)\n\nThis is because commit 63064be150e4 (\"blk-mq:\nAdd blk_mq_alloc_map_and_rqs()\") merged the two steps:\n\n1) set->tags[hctx_idx] = blk_mq_alloc_rq_map()\n2) blk_mq_alloc_rqs(..., set->tags[hctx_idx])\n\ninto one step:\n\nset->tags[hctx_idx] = blk_mq_alloc_map_and_rqs()\n\nSince tags is not initialized yet in this case, fix the problem by\nchecking if tags is NULL pointer in blk_mq_clear_rq_mapping().","publishedAt":"2025-10-07T15:19:21.259Z","updatedAt":"2026-05-11T19:21:12.557Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"63064be150e4b1ba1e4af594ef5aa81adf21a52d","status":"affected","lessThan":"6a440e6d04431e774dc084abe88c106e2a474c1a","versionType":"git"},{"version":"63064be150e4b1ba1e4af594ef5aa81adf21a52d","status":"affected","lessThan":"76dd298094f484c6250ebd076fa53287477b2328","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["block/blk-mq.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.16","versionType":"semver"},{"version":"6.0.6","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["block/blk-mq.c"]}],"references":["https://git.kernel.org/stable/c/6a440e6d04431e774dc084abe88c106e2a474c1a","https://git.kernel.org/stable/c/76dd298094f484c6250ebd076fa53287477b2328"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50530.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50530","state":"PUBLISHED","datePublished":"2025-10-07T15:19:21.259Z","dateUpdated":"2026-05-11T19:21:12.557Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-10-07T15:15:38.664Z"},"containers":{"cna":{"title":"blk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nblk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping()\n\nOur syzkaller report a null pointer dereference, root cause is\nfollowing:\n\n__blk_mq_alloc_map_and_rqs\n set->tags[hctx_idx] = blk_mq_alloc_map_and_rqs\n  blk_mq_alloc_map_and_rqs\n   blk_mq_alloc_rqs\n    // failed due to oom\n    alloc_pages_node\n    // set->tags[hctx_idx] is still NULL\n    blk_mq_free_rqs\n     drv_tags = set->tags[hctx_idx];\n     // null pointer dereference is triggered\n     blk_mq_clear_rq_mapping(drv_tags, ...)\n\nThis is because commit 63064be150e4 (\"blk-mq:\nAdd blk_mq_alloc_map_and_rqs()\") merged the two steps:\n\n1) set->tags[hctx_idx] = blk_mq_alloc_rq_map()\n2) blk_mq_alloc_rqs(..., set->tags[hctx_idx])\n\ninto one step:\n\nset->tags[hctx_idx] = blk_mq_alloc_map_and_rqs()\n\nSince tags is not initialized yet in this case, fix the problem by\nchecking if tags is NULL pointer in blk_mq_clear_rq_mapping()."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"63064be150e4b1ba1e4af594ef5aa81adf21a52d","status":"affected","lessThan":"6a440e6d04431e774dc084abe88c106e2a474c1a","versionType":"git"},{"version":"63064be150e4b1ba1e4af594ef5aa81adf21a52d","status":"affected","lessThan":"76dd298094f484c6250ebd076fa53287477b2328","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["block/blk-mq.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.16","versionType":"semver"},{"version":"6.0.6","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["block/blk-mq.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/6a440e6d04431e774dc084abe88c106e2a474c1a"},{"url":"https://git.kernel.org/stable/c/76dd298094f484c6250ebd076fa53287477b2328"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T19:21:12.557Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"6.0.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"6.1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}