{"api_version":"1","generated_at":"2026-08-15T08:44:32+00:00","cve":"CVE-2026-74384","urls":{"html":"https://cve.report/CVE-2026-74384","api":"https://cve.report/api/cve/CVE-2026-74384.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-74384","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-74384"},"summary":{"title":"nvme-multipath: fix flex array size in struct nvme_ns_head","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnvme-multipath: fix flex array size in struct nvme_ns_head\n\nstruct nvme_ns_head contains a flexible array member, current_path[],\nwhich is indexed using the NUMA node ID:\nhead->current_path[numa_node_id()]\n\nThe structure is currently allocated as:\nsize = sizeof(struct nvme_ns_head) +\n       (num_possible_nodes() * sizeof(struct nvme_ns *));\nhead = kzalloc(size, GFP_KERNEL);\n\nThis allocation assumes that NUMA node IDs are sequential and densely\npacked from 0 .. num_possible_nodes() - 1. While this assumption holds\non many systems, it is not always true on some architectures such as\npowerpc.\n\nOn some powerpc systems, NUMA node IDs can be sparse. For example:\nNUMA:\n  NUMA node(s):              6\n  NUMA node0 CPU(s):         80-159\n  NUMA node8 CPU(s):         0-79\n  NUMA node252 CPU(s):\n  NUMA node253 CPU(s):\n  NUMA node254 CPU(s):\n  NUMA node255 CPU(s):\n\nThat is, the possible/online NUMA node IDs are: 0, 8, 252, 253, 254, 255\nIn this case: num_possible_nodes() = 6\n\nSo memory is allocated for only 6 entries in current_path[]. However,\nthe array is later indexed using the actual NUMA node ID. As a result,\naccesses such as:\nhead->current_path[8] or\nhead->current_path[252]\ngoes out of bounds, leading to the following KASAN splat:\n\n==================================================================\nBUG: KASAN: slab-out-of-bounds in nvme_mpath_revalidate_paths+0x22c/0x290 [nvme_core]\nWrite of size 8 at addr c00020003bda35b8 by task kworker/u641:2/1997\n\nCPU: 1 UID: 0 PID: 1997 Comm: kworker/u641:2 Not tainted 7.1.0-rc5-dirty #14 PREEMPT(lazy)\nHardware name: 8335-GTH POWER9 0x4e1202 opal:skiboot-v6.5.3-35-g1851b2a06 PowerNV\nWorkqueue: async async_run_entry_fn\nCall Trace:\n[c000200037fa7510] [c0000000021c23d4] dump_stack_lvl+0x88/0xdc (unreliable)\n[c000200037fa7540] [c0000000009fda90] print_report+0x22c/0x67c\n[c000200037fa7630] [c0000000009fd508] kasan_report+0x108/0x220\n[c000200037fa7740] [c0000000009fff48] __asan_store8+0xe8/0x120\n[c000200037fa7760] [c008000018e76474] nvme_mpath_revalidate_paths+0x22c/0x290 [nvme_core]\n[c000200037fa7800] [c008000018e6556c] nvme_update_ns_info+0x4a4/0x5e0 [nvme_core]\n[c000200037fa7a50] [c008000018e66270] nvme_alloc_ns+0x6d8/0x1a70 [nvme_core]\n[c000200037fa7c20] [c008000018e679fc] nvme_scan_ns+0x3f4/0x630 [nvme_core]\n[c000200037fa7d10] [c00000000031f22c] async_run_entry_fn+0x9c/0x3a0\n[c000200037fa7db0] [c0000000002fa544] process_one_work+0x414/0xa10\n[c000200037fa7ec0] [c0000000002fbf00] worker_thread+0x320/0x640\n[c000200037fa7f80] [c00000000030d0f8] kthread+0x278/0x290\n[c000200037fa7fe0] [c00000000000ded8] start_kernel_thread+0x14/0x18\n\nAllocated by task 1997 on cpu 1 at 35.928317s:\n\nThe buggy address belongs to the object at c00020003bda3000\n which belongs to the cache kmalloc-rnd-15-2k of size 2048\nThe buggy address is located 16 bytes to the right of\n allocated 1448-byte region [c00020003bda3000, c00020003bda35a8)\n\nThe buggy address belongs to the physical page:\n\nMemory state around the buggy address:\n c00020003bda3480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n c00020003bda3500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n>c00020003bda3580: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc\n                                        ^\n c00020003bda3600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc\n c00020003bda3680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc\n==================================================================\n\nFix this by allocating the flexible array using nr_node_ids instead\nof num_possible_nodes(). Since nr_node_ids represents the maximum\npossible NUMA node IDs, indexing current_path[] using numa_node_id()\nbecomes safe even on systems with sparse node IDs.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-08-15 06:22:40","updated_at":"2026-08-15 06:22:40"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/316b5f1168264844aa125959de1d6da2b1905795","name":"https://git.kernel.org/stable/c/316b5f1168264844aa125959de1d6da2b1905795","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/001e57554de81aa79c25c18fd53911d8a415c304","name":"https://git.kernel.org/stable/c/001e57554de81aa79c25c18fd53911d8a415c304","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/7173a741fed73de6247384056fe92e582ba12507","name":"https://git.kernel.org/stable/c/7173a741fed73de6247384056fe92e582ba12507","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/1d4131b5c9823c7d2c86389898ad1b466af7df5e","name":"https://git.kernel.org/stable/c/1d4131b5c9823c7d2c86389898ad1b466af7df5e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/7e7b167e65610dfa7564d449474f4b477f9d4c1c","name":"https://git.kernel.org/stable/c/7e7b167e65610dfa7564d449474f4b477f9d4c1c","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/bde4d6eb53f7d3cdae7e62c9ee84345fdd6e70a6","name":"https://git.kernel.org/stable/c/bde4d6eb53f7d3cdae7e62c9ee84345fdd6e70a6","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/9ffdd11bd6c961b46b3689850ff6c5d7af5c5fe5","name":"https://git.kernel.org/stable/c/9ffdd11bd6c961b46b3689850ff6c5d7af5c5fe5","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/140d6fff4ed266592492a23444043842b4af7a62","name":"https://git.kernel.org/stable/c/140d6fff4ed266592492a23444043842b4af7a62","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-74384","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-74384","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f333444708f82c4a4d3ccac004da0bfd9cfdfa42 7e7b167e65610dfa7564d449474f4b477f9d4c1c git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f333444708f82c4a4d3ccac004da0bfd9cfdfa42 316b5f1168264844aa125959de1d6da2b1905795 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f333444708f82c4a4d3ccac004da0bfd9cfdfa42 1d4131b5c9823c7d2c86389898ad1b466af7df5e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f333444708f82c4a4d3ccac004da0bfd9cfdfa42 9ffdd11bd6c961b46b3689850ff6c5d7af5c5fe5 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f333444708f82c4a4d3ccac004da0bfd9cfdfa42 bde4d6eb53f7d3cdae7e62c9ee84345fdd6e70a6 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f333444708f82c4a4d3ccac004da0bfd9cfdfa42 140d6fff4ed266592492a23444043842b4af7a62 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f333444708f82c4a4d3ccac004da0bfd9cfdfa42 7173a741fed73de6247384056fe92e582ba12507 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f333444708f82c4a4d3ccac004da0bfd9cfdfa42 001e57554de81aa79c25c18fd53911d8a415c304 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 4.20","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 4.20 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.10.261 5.10.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.212 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.178 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.145 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.97 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.40 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.1.5 7.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/nvme/host/core.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"7e7b167e65610dfa7564d449474f4b477f9d4c1c","status":"affected","version":"f333444708f82c4a4d3ccac004da0bfd9cfdfa42","versionType":"git"},{"lessThan":"316b5f1168264844aa125959de1d6da2b1905795","status":"affected","version":"f333444708f82c4a4d3ccac004da0bfd9cfdfa42","versionType":"git"},{"lessThan":"1d4131b5c9823c7d2c86389898ad1b466af7df5e","status":"affected","version":"f333444708f82c4a4d3ccac004da0bfd9cfdfa42","versionType":"git"},{"lessThan":"9ffdd11bd6c961b46b3689850ff6c5d7af5c5fe5","status":"affected","version":"f333444708f82c4a4d3ccac004da0bfd9cfdfa42","versionType":"git"},{"lessThan":"bde4d6eb53f7d3cdae7e62c9ee84345fdd6e70a6","status":"affected","version":"f333444708f82c4a4d3ccac004da0bfd9cfdfa42","versionType":"git"},{"lessThan":"140d6fff4ed266592492a23444043842b4af7a62","status":"affected","version":"f333444708f82c4a4d3ccac004da0bfd9cfdfa42","versionType":"git"},{"lessThan":"7173a741fed73de6247384056fe92e582ba12507","status":"affected","version":"f333444708f82c4a4d3ccac004da0bfd9cfdfa42","versionType":"git"},{"lessThan":"001e57554de81aa79c25c18fd53911d8a415c304","status":"affected","version":"f333444708f82c4a4d3ccac004da0bfd9cfdfa42","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/nvme/host/core.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"4.20"},{"lessThan":"4.20","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"5.10.*","status":"unaffected","version":"5.10.261","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.212","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.178","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.145","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.97","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.40","versionType":"semver"},{"lessThanOrEqual":"7.1.*","status":"unaffected","version":"7.1.5","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.2-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.10.261","versionStartIncluding":"4.20","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.212","versionStartIncluding":"4.20","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.178","versionStartIncluding":"4.20","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.145","versionStartIncluding":"4.20","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.97","versionStartIncluding":"4.20","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.40","versionStartIncluding":"4.20","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.1.5","versionStartIncluding":"4.20","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.2-rc1","versionStartIncluding":"4.20","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnvme-multipath: fix flex array size in struct nvme_ns_head\n\nstruct nvme_ns_head contains a flexible array member, current_path[],\nwhich is indexed using the NUMA node ID:\nhead->current_path[numa_node_id()]\n\nThe structure is currently allocated as:\nsize = sizeof(struct nvme_ns_head) +\n       (num_possible_nodes() * sizeof(struct nvme_ns *));\nhead = kzalloc(size, GFP_KERNEL);\n\nThis allocation assumes that NUMA node IDs are sequential and densely\npacked from 0 .. num_possible_nodes() - 1. While this assumption holds\non many systems, it is not always true on some architectures such as\npowerpc.\n\nOn some powerpc systems, NUMA node IDs can be sparse. For example:\nNUMA:\n  NUMA node(s):              6\n  NUMA node0 CPU(s):         80-159\n  NUMA node8 CPU(s):         0-79\n  NUMA node252 CPU(s):\n  NUMA node253 CPU(s):\n  NUMA node254 CPU(s):\n  NUMA node255 CPU(s):\n\nThat is, the possible/online NUMA node IDs are: 0, 8, 252, 253, 254, 255\nIn this case: num_possible_nodes() = 6\n\nSo memory is allocated for only 6 entries in current_path[]. However,\nthe array is later indexed using the actual NUMA node ID. As a result,\naccesses such as:\nhead->current_path[8] or\nhead->current_path[252]\ngoes out of bounds, leading to the following KASAN splat:\n\n==================================================================\nBUG: KASAN: slab-out-of-bounds in nvme_mpath_revalidate_paths+0x22c/0x290 [nvme_core]\nWrite of size 8 at addr c00020003bda35b8 by task kworker/u641:2/1997\n\nCPU: 1 UID: 0 PID: 1997 Comm: kworker/u641:2 Not tainted 7.1.0-rc5-dirty #14 PREEMPT(lazy)\nHardware name: 8335-GTH POWER9 0x4e1202 opal:skiboot-v6.5.3-35-g1851b2a06 PowerNV\nWorkqueue: async async_run_entry_fn\nCall Trace:\n[c000200037fa7510] [c0000000021c23d4] dump_stack_lvl+0x88/0xdc (unreliable)\n[c000200037fa7540] [c0000000009fda90] print_report+0x22c/0x67c\n[c000200037fa7630] [c0000000009fd508] kasan_report+0x108/0x220\n[c000200037fa7740] [c0000000009fff48] __asan_store8+0xe8/0x120\n[c000200037fa7760] [c008000018e76474] nvme_mpath_revalidate_paths+0x22c/0x290 [nvme_core]\n[c000200037fa7800] [c008000018e6556c] nvme_update_ns_info+0x4a4/0x5e0 [nvme_core]\n[c000200037fa7a50] [c008000018e66270] nvme_alloc_ns+0x6d8/0x1a70 [nvme_core]\n[c000200037fa7c20] [c008000018e679fc] nvme_scan_ns+0x3f4/0x630 [nvme_core]\n[c000200037fa7d10] [c00000000031f22c] async_run_entry_fn+0x9c/0x3a0\n[c000200037fa7db0] [c0000000002fa544] process_one_work+0x414/0xa10\n[c000200037fa7ec0] [c0000000002fbf00] worker_thread+0x320/0x640\n[c000200037fa7f80] [c00000000030d0f8] kthread+0x278/0x290\n[c000200037fa7fe0] [c00000000000ded8] start_kernel_thread+0x14/0x18\n\nAllocated by task 1997 on cpu 1 at 35.928317s:\n\nThe buggy address belongs to the object at c00020003bda3000\n which belongs to the cache kmalloc-rnd-15-2k of size 2048\nThe buggy address is located 16 bytes to the right of\n allocated 1448-byte region [c00020003bda3000, c00020003bda35a8)\n\nThe buggy address belongs to the physical page:\n\nMemory state around the buggy address:\n c00020003bda3480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n c00020003bda3500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n>c00020003bda3580: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc\n                                        ^\n c00020003bda3600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc\n c00020003bda3680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc\n==================================================================\n\nFix this by allocating the flexible array using nr_node_ids instead\nof num_possible_nodes(). Since nr_node_ids represents the maximum\npossible NUMA node IDs, indexing current_path[] using numa_node_id()\nbecomes safe even on systems with sparse node IDs."}],"providerMetadata":{"dateUpdated":"2026-08-15T05:59:00.445Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/7e7b167e65610dfa7564d449474f4b477f9d4c1c"},{"url":"https://git.kernel.org/stable/c/316b5f1168264844aa125959de1d6da2b1905795"},{"url":"https://git.kernel.org/stable/c/1d4131b5c9823c7d2c86389898ad1b466af7df5e"},{"url":"https://git.kernel.org/stable/c/9ffdd11bd6c961b46b3689850ff6c5d7af5c5fe5"},{"url":"https://git.kernel.org/stable/c/bde4d6eb53f7d3cdae7e62c9ee84345fdd6e70a6"},{"url":"https://git.kernel.org/stable/c/140d6fff4ed266592492a23444043842b4af7a62"},{"url":"https://git.kernel.org/stable/c/7173a741fed73de6247384056fe92e582ba12507"},{"url":"https://git.kernel.org/stable/c/001e57554de81aa79c25c18fd53911d8a415c304"}],"title":"nvme-multipath: fix flex array size in struct nvme_ns_head","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-74384","datePublished":"2026-08-15T05:59:00.445Z","dateReserved":"2026-08-15T05:44:03.890Z","dateUpdated":"2026-08-15T05:59:00.445Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-08-15 06:22:40","lastModifiedDate":"2026-08-15 06:22:40","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"74384","Ordinal":"1","Title":"nvme-multipath: fix flex array size in struct nvme_ns_head","CVE":"CVE-2026-74384","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"74384","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nnvme-multipath: fix flex array size in struct nvme_ns_head\n\nstruct nvme_ns_head contains a flexible array member, current_path[],\nwhich is indexed using the NUMA node ID:\nhead->current_path[numa_node_id()]\n\nThe structure is currently allocated as:\nsize = sizeof(struct nvme_ns_head) +\n       (num_possible_nodes() * sizeof(struct nvme_ns *));\nhead = kzalloc(size, GFP_KERNEL);\n\nThis allocation assumes that NUMA node IDs are sequential and densely\npacked from 0 .. num_possible_nodes() - 1. While this assumption holds\non many systems, it is not always true on some architectures such as\npowerpc.\n\nOn some powerpc systems, NUMA node IDs can be sparse. For example:\nNUMA:\n  NUMA node(s):              6\n  NUMA node0 CPU(s):         80-159\n  NUMA node8 CPU(s):         0-79\n  NUMA node252 CPU(s):\n  NUMA node253 CPU(s):\n  NUMA node254 CPU(s):\n  NUMA node255 CPU(s):\n\nThat is, the possible/online NUMA node IDs are: 0, 8, 252, 253, 254, 255\nIn this case: num_possible_nodes() = 6\n\nSo memory is allocated for only 6 entries in current_path[]. However,\nthe array is later indexed using the actual NUMA node ID. As a result,\naccesses such as:\nhead->current_path[8] or\nhead->current_path[252]\ngoes out of bounds, leading to the following KASAN splat:\n\n==================================================================\nBUG: KASAN: slab-out-of-bounds in nvme_mpath_revalidate_paths+0x22c/0x290 [nvme_core]\nWrite of size 8 at addr c00020003bda35b8 by task kworker/u641:2/1997\n\nCPU: 1 UID: 0 PID: 1997 Comm: kworker/u641:2 Not tainted 7.1.0-rc5-dirty #14 PREEMPT(lazy)\nHardware name: 8335-GTH POWER9 0x4e1202 opal:skiboot-v6.5.3-35-g1851b2a06 PowerNV\nWorkqueue: async async_run_entry_fn\nCall Trace:\n[c000200037fa7510] [c0000000021c23d4] dump_stack_lvl+0x88/0xdc (unreliable)\n[c000200037fa7540] [c0000000009fda90] print_report+0x22c/0x67c\n[c000200037fa7630] [c0000000009fd508] kasan_report+0x108/0x220\n[c000200037fa7740] [c0000000009fff48] __asan_store8+0xe8/0x120\n[c000200037fa7760] [c008000018e76474] nvme_mpath_revalidate_paths+0x22c/0x290 [nvme_core]\n[c000200037fa7800] [c008000018e6556c] nvme_update_ns_info+0x4a4/0x5e0 [nvme_core]\n[c000200037fa7a50] [c008000018e66270] nvme_alloc_ns+0x6d8/0x1a70 [nvme_core]\n[c000200037fa7c20] [c008000018e679fc] nvme_scan_ns+0x3f4/0x630 [nvme_core]\n[c000200037fa7d10] [c00000000031f22c] async_run_entry_fn+0x9c/0x3a0\n[c000200037fa7db0] [c0000000002fa544] process_one_work+0x414/0xa10\n[c000200037fa7ec0] [c0000000002fbf00] worker_thread+0x320/0x640\n[c000200037fa7f80] [c00000000030d0f8] kthread+0x278/0x290\n[c000200037fa7fe0] [c00000000000ded8] start_kernel_thread+0x14/0x18\n\nAllocated by task 1997 on cpu 1 at 35.928317s:\n\nThe buggy address belongs to the object at c00020003bda3000\n which belongs to the cache kmalloc-rnd-15-2k of size 2048\nThe buggy address is located 16 bytes to the right of\n allocated 1448-byte region [c00020003bda3000, c00020003bda35a8)\n\nThe buggy address belongs to the physical page:\n\nMemory state around the buggy address:\n c00020003bda3480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n c00020003bda3500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n>c00020003bda3580: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc\n                                        ^\n c00020003bda3600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc\n c00020003bda3680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc\n==================================================================\n\nFix this by allocating the flexible array using nr_node_ids instead\nof num_possible_nodes(). Since nr_node_ids represents the maximum\npossible NUMA node IDs, indexing current_path[] using numa_node_id()\nbecomes safe even on systems with sparse node IDs.","Type":"Description","Title":"nvme-multipath: fix flex array size in struct nvme_ns_head"}]}}}