{"id":"CVE-2023-54227","state":"PUBLISHED","title":"blk-mq: fix tags leak when shrink nr_hw_queues","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nblk-mq: fix tags leak when shrink nr_hw_queues\n\nAlthough we don't need to realloc set->tags[] when shrink nr_hw_queues,\nwe need to free them. Or these tags will be leaked.\n\nHow to reproduce:\n1. mount -t configfs configfs /mnt\n2. modprobe null_blk nr_devices=0 submit_queues=8\n3. mkdir /mnt/nullb/nullb0\n4. echo 1 > /mnt/nullb/nullb0/power\n5. echo 4 > /mnt/nullb/nullb0/submit_queues\n6. rmdir /mnt/nullb/nullb0\n\nIn step 4, will alloc 9 tags (8 submit queues and 1 poll queue), then\nin step 5, new_nr_hw_queues = 5 (4 submit queues and 1 poll queue).\nAt last in step 6, only these 5 tags are freed, the other 4 tags leaked.","publishedAt":"2025-12-30T12:11:20.207Z","updatedAt":"2026-10-15T21:41:42.461Z","severity":{"score":7.5,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"a846a8e6c9a5949582c5a6a8bbc83a7d27fd891e","status":"affected","lessThan":"26d495f0f64d8cd4fcd29206ee5c653ee0e0cbcd","versionType":"git"},{"version":"a846a8e6c9a5949582c5a6a8bbc83a7d27fd891e","status":"affected","lessThan":"c0ef7493e68b8896806a2f598fcffbaa97333405","versionType":"git"},{"version":"a846a8e6c9a5949582c5a6a8bbc83a7d27fd891e","status":"affected","lessThan":"e1dd7bc93029024af5688253b0c05181d6e01f8e","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.1.189","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.5.5","status":"unaffected","lessThanOrEqual":"6.5.*","versionType":"semver"},{"version":"6.6","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/26d495f0f64d8cd4fcd29206ee5c653ee0e0cbcd","https://git.kernel.org/stable/c/c0ef7493e68b8896806a2f598fcffbaa97333405","https://git.kernel.org/stable/c/e1dd7bc93029024af5688253b0c05181d6e01f8e"],"weaknesses":[],"ingestedAt":"2026-10-29T20:06:42.242Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2023/54xxx/CVE-2023-54227.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2023-54227","state":"PUBLISHED","datePublished":"2025-12-30T12:11:20.207Z","dateUpdated":"2026-10-15T21:41:42.461Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-12-30T12:06:44.502Z"},"containers":{"cna":{"title":"blk-mq: fix tags leak when shrink nr_hw_queues","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nblk-mq: fix tags leak when shrink nr_hw_queues\n\nAlthough we don't need to realloc set->tags[] when shrink nr_hw_queues,\nwe need to free them. Or these tags will be leaked.\n\nHow to reproduce:\n1. mount -t configfs configfs /mnt\n2. modprobe null_blk nr_devices=0 submit_queues=8\n3. mkdir /mnt/nullb/nullb0\n4. echo 1 > /mnt/nullb/nullb0/power\n5. echo 4 > /mnt/nullb/nullb0/submit_queues\n6. rmdir /mnt/nullb/nullb0\n\nIn step 4, will alloc 9 tags (8 submit queues and 1 poll queue), then\nin step 5, new_nr_hw_queues = 5 (4 submit queues and 1 poll queue).\nAt last in step 6, only these 5 tags are freed, the other 4 tags leaked."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"a846a8e6c9a5949582c5a6a8bbc83a7d27fd891e","status":"affected","lessThan":"26d495f0f64d8cd4fcd29206ee5c653ee0e0cbcd","versionType":"git"},{"version":"a846a8e6c9a5949582c5a6a8bbc83a7d27fd891e","status":"affected","lessThan":"c0ef7493e68b8896806a2f598fcffbaa97333405","versionType":"git"},{"version":"a846a8e6c9a5949582c5a6a8bbc83a7d27fd891e","status":"affected","lessThan":"e1dd7bc93029024af5688253b0c05181d6e01f8e","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.1.189","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.5.5","status":"unaffected","lessThanOrEqual":"6.5.*","versionType":"semver"},{"version":"6.6","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/26d495f0f64d8cd4fcd29206ee5c653ee0e0cbcd"},{"url":"https://git.kernel.org/stable/c/c0ef7493e68b8896806a2f598fcffbaa97333405"},{"url":"https://git.kernel.org/stable/c/e1dd7bc93029024af5688253b0c05181d6e01f8e"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","baseScore":7.5,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:N - The shrink is driven by remote-peer data on NVMe-oF hosts — `nvme_set_queue_count()` takes the I/O queue count verbatim from the target's Set Features completion and feeds it to `blk_mq_update_nr_hw_queues()` on every reconnect, with the tag set persisting across reconnects. A hostile/compromised target or on-path attacker on an unauthenticated NVMe/TCP fabric reaches the vulnerable code over the network.\nAC:L - The attacker fully controls the granted queue count in each Set Features response and can force reconnects at will by closing the transport connection, so each shrink→grow cycle is triggered deterministically with no conditions outside the attacker's control.\nPR:N - The remote peer needs no credentials on the victim host; NVMe/TCP in the affected 5.16–6.5 range has no in-band authentication or TLS, and the queue-count negotiation happens automatically during controller reconnect.\nUI:N - Reconnect and queue renegotiation are fully automatic in the nvme fabrics keep-alive/reconnect path; no administrator or user action is needed at exploitation time.\nS:U - The leaked allocations and the resulting memory pressure are confined to the kernel of the affected host; no security authority boundary such as a VM or IOMMU domain is crossed.\nC:N - The leaked `blk_mq_tags` and request pages are simply never freed — they are not read, exposed, or transmitted anywhere, so no information is disclosed to the attacker.\nI:N - No out-of-bounds write, use-after-free, or type confusion occurs; the stale pointers are only dropped, leaving no primitive to modify kernel or user data.\nA:H - Because the regrow path memcpy's only the shrunken count and frees the old array, every shrink→grow cycle permanently leaks a full per-queue request pool, making the leak unbounded and repeatable until kernel memory is exhausted and the system OOMs or hangs."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-03T10:55:05.417Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"6.1.189"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"6.5.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"6.6"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2023-54227","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2026-10-15T21:39:33.828518Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-15T21:41:42.461Z"}}]}}}