{"id":"CVE-2026-99156","state":"PUBLISHED","title":"scsi: st: Fix use-after-free race between st_remove() and st_open()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: st: Fix use-after-free race between st_remove() and st_open()\n\nst_remove() drops the probe reference on the scsi_tape with kref_put()\nand only afterwards removes its index from st_index_idr. If that was the\nlast reference, scsi_tape_release() frees the structure while it is\nstill published in the idr.\n\nscsi_tape_get(), called from st_open(), looks up the tape in\nst_index_idr and takes a reference under st_ref_mutex and\nst_index_lock. remove_cdevs() does not wait for opens that are already\npast chrdev_open(), so an open that is blocked on st_ref_mutex while\nst_remove() holds it can take the mutex as soon as st_remove() drops it,\nfind the freed tpnt in the idr and call kref_get() on it:\n\n  BUG: KASAN: slab-use-after-free in st_open\n  Write of size 4 ...\n   st_open (drivers/scsi/st.c:254 drivers/scsi/st.c:1291)\n   chrdev_open\n  ...\n  Freed by task ...:\n   kfree\n   st_remove (drivers/scsi/st.c:4512)\n\nRemove the index from the idr before dropping the reference, all under\nst_ref_mutex. A concurrent scsi_tape_get() now either runs first and\nholds a valid reference that keeps the tape alive, or runs afterwards\nand finds nothing, so st_open() fails with -ENXIO.\n\nThis restores the ordering st_remove() had before the conversion to\nst_index_idr, where the tape was unpublished from scsi_tapes[] before\nthe final kref_put().","publishedAt":"2026-10-28T10:35:10.493Z","updatedAt":"2026-10-30T12:42:22.579Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"7d7f9d2ee4b0841f3eba9fa3627044ad329428de","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"d9517fc39ec3ee13eadefdc17f45300f7d23ed8c","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"e7a5da4a4820210aa7d7cd8e6eb25aabe9e5b5a7","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"00ff1128123d4bdfacd28d68fb4b6e6f657a3648","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"5ef230f734e0d23db007c8405f38b7e226740084","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"a1647b653549ff29f0422a63eabf329b842f3822","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"18a0e3733ce38718688e813e5e2d1106bd4830e5","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"71caf7f84bd62a4bf91cc95abd2de690afb8d15f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/scsi/st.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.7","versionType":"semver"},{"version":"5.10.273","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.224","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.161","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.115","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.59","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2.13","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/scsi/st.c"]}],"references":["https://git.kernel.org/stable/c/7d7f9d2ee4b0841f3eba9fa3627044ad329428de","https://git.kernel.org/stable/c/d9517fc39ec3ee13eadefdc17f45300f7d23ed8c","https://git.kernel.org/stable/c/e7a5da4a4820210aa7d7cd8e6eb25aabe9e5b5a7","https://git.kernel.org/stable/c/00ff1128123d4bdfacd28d68fb4b6e6f657a3648","https://git.kernel.org/stable/c/5ef230f734e0d23db007c8405f38b7e226740084","https://git.kernel.org/stable/c/a1647b653549ff29f0422a63eabf329b842f3822","https://git.kernel.org/stable/c/18a0e3733ce38718688e813e5e2d1106bd4830e5","https://git.kernel.org/stable/c/71caf7f84bd62a4bf91cc95abd2de690afb8d15f"],"weaknesses":[],"ingestedAt":"2026-10-30T13:02:04.640Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/99xxx/CVE-2026-99156.json","commit":"cb14bf1b43b0c9f05f7f40eae2246263fd430780","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99156","state":"PUBLISHED","datePublished":"2026-10-28T10:35:10.493Z","dateUpdated":"2026-10-30T12:42:22.579Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-25T10:25:14.397Z"},"containers":{"cna":{"title":"scsi: st: Fix use-after-free race between st_remove() and st_open()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: st: Fix use-after-free race between st_remove() and st_open()\n\nst_remove() drops the probe reference on the scsi_tape with kref_put()\nand only afterwards removes its index from st_index_idr. If that was the\nlast reference, scsi_tape_release() frees the structure while it is\nstill published in the idr.\n\nscsi_tape_get(), called from st_open(), looks up the tape in\nst_index_idr and takes a reference under st_ref_mutex and\nst_index_lock. remove_cdevs() does not wait for opens that are already\npast chrdev_open(), so an open that is blocked on st_ref_mutex while\nst_remove() holds it can take the mutex as soon as st_remove() drops it,\nfind the freed tpnt in the idr and call kref_get() on it:\n\n  BUG: KASAN: slab-use-after-free in st_open\n  Write of size 4 ...\n   st_open (drivers/scsi/st.c:254 drivers/scsi/st.c:1291)\n   chrdev_open\n  ...\n  Freed by task ...:\n   kfree\n   st_remove (drivers/scsi/st.c:4512)\n\nRemove the index from the idr before dropping the reference, all under\nst_ref_mutex. A concurrent scsi_tape_get() now either runs first and\nholds a valid reference that keeps the tape alive, or runs afterwards\nand finds nothing, so st_open() fails with -ENXIO.\n\nThis restores the ordering st_remove() had before the conversion to\nst_index_idr, where the tape was unpublished from scsi_tapes[] before\nthe final kref_put()."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"7d7f9d2ee4b0841f3eba9fa3627044ad329428de","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"d9517fc39ec3ee13eadefdc17f45300f7d23ed8c","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"e7a5da4a4820210aa7d7cd8e6eb25aabe9e5b5a7","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"00ff1128123d4bdfacd28d68fb4b6e6f657a3648","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"5ef230f734e0d23db007c8405f38b7e226740084","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"a1647b653549ff29f0422a63eabf329b842f3822","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"18a0e3733ce38718688e813e5e2d1106bd4830e5","versionType":"git"},{"version":"6c648d95a6af4a79241a916871df17c84c68ea20","status":"affected","lessThan":"71caf7f84bd62a4bf91cc95abd2de690afb8d15f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/scsi/st.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.7","versionType":"semver"},{"version":"5.10.273","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.224","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.161","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.115","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.59","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2.13","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/scsi/st.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/7d7f9d2ee4b0841f3eba9fa3627044ad329428de"},{"url":"https://git.kernel.org/stable/c/d9517fc39ec3ee13eadefdc17f45300f7d23ed8c"},{"url":"https://git.kernel.org/stable/c/e7a5da4a4820210aa7d7cd8e6eb25aabe9e5b5a7"},{"url":"https://git.kernel.org/stable/c/00ff1128123d4bdfacd28d68fb4b6e6f657a3648"},{"url":"https://git.kernel.org/stable/c/5ef230f734e0d23db007c8405f38b7e226740084"},{"url":"https://git.kernel.org/stable/c/a1647b653549ff29f0422a63eabf329b842f3822"},{"url":"https://git.kernel.org/stable/c/18a0e3733ce38718688e813e5e2d1106bd4830e5"},{"url":"https://git.kernel.org/stable/c/71caf7f84bd62a4bf91cc95abd2de690afb8d15f"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:42:22.579Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"5.10.273"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"5.15.224"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.6.161"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.12.115"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.18.59"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"7.2.13"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"7.3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}