{"id":"CVE-2024-54458","state":"PUBLISHED","title":"scsi: ufs: bsg: Set bsg_queue to NULL after removal","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: ufs: bsg: Set bsg_queue to NULL after removal\n\nCurrently, this does not cause any issues, but I believe it is necessary to\nset bsg_queue to NULL after removing it to prevent potential use-after-free\n(UAF) access.","publishedAt":"2025-02-27T02:18:08.616Z","updatedAt":"2026-10-15T00:59:11.652Z","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":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"bb4783c670180b922267222408e1c48d22dfbb46","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"22018622e1e9e371198dbd983af946a844d5924c","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"5e7b6e44468c3242c21c2a8656d009fb3eb50a73","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"5f782d4741bf558def60df192b858b0efc6a5f0a","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"88a01e9c9ad40c075756ba93b47984461d4ff15d","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"9193bdc170cc23fe98aca71d1a63c0bf6e1e853b","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"1e95c798d8a7f70965f0f88d4657b682ff0ec75f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/ufs/core/ufs_bsg.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.20","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.20","versionType":"semver"},{"version":"5.10.237","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.181","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.129","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.79","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.16","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.4","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/ufs/core/ufs_bsg.c"]}],"references":["https://git.kernel.org/stable/c/bb4783c670180b922267222408e1c48d22dfbb46","https://git.kernel.org/stable/c/22018622e1e9e371198dbd983af946a844d5924c","https://git.kernel.org/stable/c/5e7b6e44468c3242c21c2a8656d009fb3eb50a73","https://git.kernel.org/stable/c/5f782d4741bf558def60df192b858b0efc6a5f0a","https://git.kernel.org/stable/c/88a01e9c9ad40c075756ba93b47984461d4ff15d","https://git.kernel.org/stable/c/9193bdc170cc23fe98aca71d1a63c0bf6e1e853b","https://git.kernel.org/stable/c/1e95c798d8a7f70965f0f88d4657b682ff0ec75f","https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html","https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html","https://cert-portal.siemens.com/productcert/html/ssa-019113.html","https://cert-portal.siemens.com/productcert/html/ssa-457936.html"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:08:04.920Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/54xxx/CVE-2024-54458.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-54458","state":"PUBLISHED","datePublished":"2025-02-27T02:18:08.616Z","dateUpdated":"2026-10-15T00:59:11.652Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-02-27T02:16:34.074Z"},"containers":{"cna":{"title":"scsi: ufs: bsg: Set bsg_queue to NULL after removal","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: ufs: bsg: Set bsg_queue to NULL after removal\n\nCurrently, this does not cause any issues, but I believe it is necessary to\nset bsg_queue to NULL after removing it to prevent potential use-after-free\n(UAF) access."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"bb4783c670180b922267222408e1c48d22dfbb46","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"22018622e1e9e371198dbd983af946a844d5924c","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"5e7b6e44468c3242c21c2a8656d009fb3eb50a73","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"5f782d4741bf558def60df192b858b0efc6a5f0a","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"88a01e9c9ad40c075756ba93b47984461d4ff15d","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"9193bdc170cc23fe98aca71d1a63c0bf6e1e853b","versionType":"git"},{"version":"df032bf27a414acf61c957ec2fad22a57d903b39","status":"affected","lessThan":"1e95c798d8a7f70965f0f88d4657b682ff0ec75f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/ufs/core/ufs_bsg.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.20","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.20","versionType":"semver"},{"version":"5.10.237","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.181","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.129","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.79","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.16","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.4","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/ufs/core/ufs_bsg.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/bb4783c670180b922267222408e1c48d22dfbb46"},{"url":"https://git.kernel.org/stable/c/22018622e1e9e371198dbd983af946a844d5924c"},{"url":"https://git.kernel.org/stable/c/5e7b6e44468c3242c21c2a8656d009fb3eb50a73"},{"url":"https://git.kernel.org/stable/c/5f782d4741bf558def60df192b858b0efc6a5f0a"},{"url":"https://git.kernel.org/stable/c/88a01e9c9ad40c075756ba93b47984461d4ff15d"},{"url":"https://git.kernel.org/stable/c/9193bdc170cc23fe98aca71d1a63c0bf6e1e853b"},{"url":"https://git.kernel.org/stable/c/1e95c798d8a7f70965f0f88d4657b682ff0ec75f"}],"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 affected code is entirely in the UFS host controller driver lifecycle path (`ufshcd_remove()` → `ufs_bsg_remove()`), reached through local actions such as sysfs driver unbind, module unload, or device teardown, and the associated `/dev/bsg/ufs-bsg0` endpoint is a local character device. No network or adjacent-network input reaches this code.\nAC:L - The stale `hba->bsg_queue` pointer is created unconditionally on every teardown — there is no error path to hit, no race to win, and no memory-layout precondition the attacker cannot influence; reclaiming the freed `request_queue`/`bsg_set` slab is a standard heap spray the attacker drives, and an open bsg fd lets the attacker choose when the object is actually freed.\nPR:L - Consistent with how this database scores driver-teardown and \"set pointer to NULL after free\" UAFs, a low-privileged local account able to drive device/driver lifecycle events is sufficient; no authentication beyond ordinary local access to the UFS host's lifecycle and bsg endpoint is assumed.\nUI:N - The teardown sequence is performed by the attacker itself (unbind/unload) or happens autonomously during device removal; no victim must mount a filesystem, open a file, or take any other action.\nS:U - The freed `struct request_queue` and `struct bsg_set` and all consequences of dereferencing them stay within the kernel's own security authority, with no crossing into a hypervisor, IOMMU, or other separate scope.\nC:H - Re-entry through the dangling pointer reads `q->tag_set` from freed memory and follows `bset->bd` into `bd->queue->disk` and `cdev_device_del()`, so reclaimed heap contents are interpreted as kernel structures, giving attacker-directed pointer dereferences and disclosure of arbitrary kernel memory.\nI:H - The freed `struct bsg_set` contains the `job_fn` and `timeout_fn` function pointers and the `bd` device pointer, and the reuse path performs `put_device()` (refcount decrement plus release-callback indirect call) and a second `kfree(bset)`, so heap spraying the reclaimed allocation yields write and control-flow-hijack primitives.\nA:H - Use-after-free and double-free on the request queue and bsg set reliably produce slab corruption, a kernel oops, or a panic, which on a UFS-backed Android phone or embedded system means loss of the primary storage controller and of the machine."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:44:50.975Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"5.10.237"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"5.15.181"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"6.1.129"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"6.6.79"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"6.12.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"6.13.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"6.14"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2024-54458","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-02-27T17:57:50.924132Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-02-27T18:02:27.581Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T19:32:07.681Z"}},{"affected":[{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.6","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.7","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.6","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.7","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.6","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.7","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.6","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.7","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIPLUS S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.6","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIPLUS S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.7","status":"affected","lessThan":"*","versionType":"custom"}]}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-019113.html"},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-457936.html"}],"providerMetadata":{"shortName":"siemens-SADP","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","dateUpdated":"2026-10-15T00:59:11.652Z"},"x_adpType":"supplier"}]}}}