{"id":"CVE-2023-54310","state":"PUBLISHED","title":"scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition\n\nmptlan_probe() calls mpt_register_lan_device() which initializes the\n&priv->post_buckets_task workqueue. A call to\nmpt_lan_wake_post_buckets_task() will subsequently start the work.\n\nDuring driver unload in mptlan_remove() the following race may occur:\n\nCPU0                  CPU1\n\n                    |mpt_lan_post_receive_buckets_work()\nmptlan_remove()     |\n  free_netdev()     |\n    kfree(dev);     |\n                    |\n                    | dev->mtu\n                    |   //use\n\nFix this by finishing the work prior to cleaning up in mptlan_remove().\n\n[mkp: we really should remove mptlan instead of attempting to fix it]","publishedAt":"2025-12-30T12:23:42.509Z","updatedAt":"2026-08-05T09:19:10.783Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"92f869693d84e813895ff4d25363744575515423","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"60c8645ad6f5b722615383d595d63b62b07a13c3","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"410e610a96c52a7b41e2ab6c9ca60868d9acecce","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"697f92f8317e538d8409a0c95d6370eb40b34c05","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"e84282efc87f2414839f6e15c31b4daa34ebaac1","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"9c6da3b7f12528cd52c458b33496a098b838fcfc","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"48daa4a3015d859ee424948844ce3c12f2fe44e6","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"f486893288f3e9b171b836f43853a6426515d800","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/message/fusion/mptlan.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.12","versionType":"semver"},{"version":"4.14.316","status":"unaffected","lessThanOrEqual":"4.14.*","versionType":"semver"},{"version":"4.19.284","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.244","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.181","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.113","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.30","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.3.4","status":"unaffected","lessThanOrEqual":"6.3.*","versionType":"semver"},{"version":"6.4","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/message/fusion/mptlan.c"]}],"references":["https://git.kernel.org/stable/c/92f869693d84e813895ff4d25363744575515423","https://git.kernel.org/stable/c/60c8645ad6f5b722615383d595d63b62b07a13c3","https://git.kernel.org/stable/c/410e610a96c52a7b41e2ab6c9ca60868d9acecce","https://git.kernel.org/stable/c/697f92f8317e538d8409a0c95d6370eb40b34c05","https://git.kernel.org/stable/c/e84282efc87f2414839f6e15c31b4daa34ebaac1","https://git.kernel.org/stable/c/9c6da3b7f12528cd52c458b33496a098b838fcfc","https://git.kernel.org/stable/c/48daa4a3015d859ee424948844ce3c12f2fe44e6","https://git.kernel.org/stable/c/f486893288f3e9b171b836f43853a6426515d800"],"weaknesses":[],"ingestedAt":"2026-10-29T20:06:42.242Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2023/54xxx/CVE-2023-54310.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2023-54310","state":"PUBLISHED","datePublished":"2025-12-30T12:23:42.509Z","dateUpdated":"2026-08-05T09:19:10.783Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-12-30T12:06:44.530Z"},"containers":{"cna":{"title":"scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition\n\nmptlan_probe() calls mpt_register_lan_device() which initializes the\n&priv->post_buckets_task workqueue. A call to\nmpt_lan_wake_post_buckets_task() will subsequently start the work.\n\nDuring driver unload in mptlan_remove() the following race may occur:\n\nCPU0                  CPU1\n\n                    |mpt_lan_post_receive_buckets_work()\nmptlan_remove()     |\n  free_netdev()     |\n    kfree(dev);     |\n                    |\n                    | dev->mtu\n                    |   //use\n\nFix this by finishing the work prior to cleaning up in mptlan_remove().\n\n[mkp: we really should remove mptlan instead of attempting to fix it]"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"92f869693d84e813895ff4d25363744575515423","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"60c8645ad6f5b722615383d595d63b62b07a13c3","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"410e610a96c52a7b41e2ab6c9ca60868d9acecce","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"697f92f8317e538d8409a0c95d6370eb40b34c05","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"e84282efc87f2414839f6e15c31b4daa34ebaac1","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"9c6da3b7f12528cd52c458b33496a098b838fcfc","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"48daa4a3015d859ee424948844ce3c12f2fe44e6","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"f486893288f3e9b171b836f43853a6426515d800","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/message/fusion/mptlan.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.12","versionType":"semver"},{"version":"4.14.316","status":"unaffected","lessThanOrEqual":"4.14.*","versionType":"semver"},{"version":"4.19.284","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.244","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.181","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.113","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.30","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.3.4","status":"unaffected","lessThanOrEqual":"6.3.*","versionType":"semver"},{"version":"6.4","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/message/fusion/mptlan.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/92f869693d84e813895ff4d25363744575515423"},{"url":"https://git.kernel.org/stable/c/60c8645ad6f5b722615383d595d63b62b07a13c3"},{"url":"https://git.kernel.org/stable/c/410e610a96c52a7b41e2ab6c9ca60868d9acecce"},{"url":"https://git.kernel.org/stable/c/697f92f8317e538d8409a0c95d6370eb40b34c05"},{"url":"https://git.kernel.org/stable/c/e84282efc87f2414839f6e15c31b4daa34ebaac1"},{"url":"https://git.kernel.org/stable/c/9c6da3b7f12528cd52c458b33496a098b838fcfc"},{"url":"https://git.kernel.org/stable/c/48daa4a3015d859ee424948844ce3c12f2fe44e6"},{"url":"https://git.kernel.org/stable/c/f486893288f3e9b171b836f43853a6426515d800"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The freeing side of the race is only reachable through local actions — module unload of mptlan/mptfc, or a sysfs PCI remove/unbind on the Fusion adapter — so the attacker must have local system access. A remote Fibre Channel peer can keep the post_buckets work armed but cannot itself trigger free_netdev().\nAC:L - The attacker controls both sides of the race: driving traffic on the fc0 IP-over-FC interface keeps priv->post_buckets_task continuously scheduled (rearmed on every receive once buckets fall below priv->bucketthresh), while the attacker separately chooses the moment of driver removal, and the attempt is freely repeatable across probe/remove cycles.\nPR:L - Consistent with how this subsystem class is scored, a local user account is treated as sufficient to reach the driver teardown path and to generate the interface traffic that arms the work item; no separately-authenticated or hardware-privileged role is needed to influence the racing side.\nUI:N - No victim action is required — the attacker performs both the traffic generation that schedules the work and the driver-removal that frees the net_device.\nS:U - The use-after-free corrupts kernel heap memory and is exploited within the kernel's own security authority; there is no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - The work function dereferences the freed allocation extensively (priv->dev, dev->mtu, dev->hard_header_len, priv->mpt_dev, priv->RcvCtl[], priv->mpt_rxfidx[]), so an attacker who reclaims the slab controls what is read and can leak kernel memory contents, including DMA addresses and skb pointers.\nI:H - Beyond reading, mpt_lan_post_receive_buckets() writes into the freed object (priv->RcvCtl[ctx].skb/dma/len, priv->mpt_rxfidx[], the buckets_out atomic) and programs attacker-influenced addresses and lengths into HBA DMA scatter-gather entries, giving a controlled write primitive suitable for control-flow hijacking.\nA:H - The use-after-free reliably oopses or panics the kernel when the freed net_device slab has been reused, and the bogus dma_map_single()/DMA descriptor programming can additionally wedge the storage adapter."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T09:19:10.783Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"4.14.316"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"4.19.284"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.4.244"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.10.181"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.15.113"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.1.30"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.4"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}