{"id":"CVE-2024-26935","summary":"scsi: core: Fix unremoved procfs host directory regression","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: core: Fix unremoved procfs host directory regression\n\nCommit fc663711b944 (\"scsi: core: Remove the /proc/scsi/${proc_name}\ndirectory earlier\") fixed a bug related to modules loading/unloading, by\nadding a call to scsi_proc_hostdir_rm() on scsi_remove_host(). But that led\nto a potential duplicate call to the hostdir_rm() routine, since it's also\ncalled from scsi_host_dev_release(). That triggered a regression report,\nwhich was then fixed by commit be03df3d4bfe (\"scsi: core: Fix a procfs host\ndirectory removal regression\"). The fix just dropped the hostdir_rm() call\nfrom dev_release().\n\nBut it happens that this proc directory is created on scsi_host_alloc(),\nand that function \"pairs\" with scsi_host_dev_release(), while\nscsi_remove_host() pairs with scsi_add_host(). In other words, it seems the\nreason for removing the proc directory on dev_release() was meant to cover\ncases in which a SCSI host structure was allocated, but the call to\nscsi_add_host() didn't happen. And that pattern happens to exist in some\nerror paths, for example.\n\nSyzkaller causes that by using USB raw gadget device, error'ing on\nusb-storage driver, at usb_stor_probe2(). By checking that path, we can see\nthat the BadDevice label leads to a scsi_host_put() after a SCSI host\nallocation, but there's no call to scsi_add_host() in such path. That leads\nto messages like this in dmesg (and a leak of the SCSI host proc\nstructure):\n\nusb-storage 4-1:87.51: USB Mass Storage device detected\nproc_dir_entry 'scsi/usb-storage' already registered\nWARNING: CPU: 1 PID: 3519 at fs/proc/generic.c:377 proc_register+0x347/0x4e0 fs/proc/generic.c:376\n\nThe proper fix seems to still call scsi_proc_hostdir_rm() on dev_release(),\nbut guard that with the state check for SHOST_CREATED; there is even a\ncomment in scsi_host_dev_release() detailing that: such conditional is\nmeant for cases where the SCSI host was allocated but there was no calls to\n{add,remove}_host(), like the usb-storage case.\n\nThis is what we propose here and with that, the error path of usb-storage\ndoes not trigger the warning anymore.","modified":"2026-11-13T04:02:50.093166527Z","published":"2024-05-01T05:17:31.445Z","related":["ALSA-2024:8617","ALSA-2025:1067","ALSA-2025:1068","SUSE-SU-2024:2008-1","SUSE-SU-2024:2019-1","SUSE-SU-2024:2135-1","SUSE-SU-2024:2190-1","SUSE-SU-2024:2203-1","SUSE-SU-2024:2894-1","SUSE-SU-2024:2939-1","SUSE-SU-2024:2947-1","SUSE-SU-2024:2973-1","SUSE-SU-2025:02264-1","SUSE-SU-2025:02321-1","SUSE-SU-2025:02322-1","SUSE-SU-2025:02537-1","SUSE-SU-2025:20008-1","SUSE-SU-2025:20028-1","SUSE-SU-2025:20166-1","SUSE-SU-2025:20249-1","SUSE-SU-2026:0473-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/26xxx/CVE-2024-26935.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html"},{"type":"WEB","url":"https://git.kernel.org/stable/c/0053f15d50d50c9312d8ab9c11e2e405812dfcac"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3678cf67ff7136db1dd3bf63c361650db5d92889"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5c2386ba80e779a92ec3bb64ccadbedd88f779b1"},{"type":"WEB","url":"https://git.kernel.org/stable/c/cea234bb214b17d004dfdccce4491e6ff57c96ee"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d4c34782b6d7b1e68d18d9549451b19433bd4c6c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e293c773c13b830cdc251f155df2254981abc320"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f23a4d6e07570826fe95023ca1aa96a011fa9f84"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f4ff08fab66eb5c0b97e1a24edac052fb40bf5d7"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/26xxx/CVE-2024-26935.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-26935"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"88c3d3bb6469cea929ac68fd326bdcbefcdfdd83"},{"fixed":"0053f15d50d50c9312d8ab9c11e2e405812dfcac"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"68c665bb185037e7eb66fb792c61da9d7151e99c"},{"fixed":"5c2386ba80e779a92ec3bb64ccadbedd88f779b1"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"2a764d55e938743efa7c2cba7305633bcf227f09"},{"fixed":"cea234bb214b17d004dfdccce4491e6ff57c96ee"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"7e0ae8667fcdd99d1756922e1140cac75f5fa279"},{"fixed":"3678cf67ff7136db1dd3bf63c361650db5d92889"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"be03df3d4bfe7e8866d4aa43d62e648ffe884f5f"},{"fixed":"d4c34782b6d7b1e68d18d9549451b19433bd4c6c"},{"fixed":"e293c773c13b830cdc251f155df2254981abc320"},{"fixed":"f4ff08fab66eb5c0b97e1a24edac052fb40bf5d7"},{"fixed":"f23a4d6e07570826fe95023ca1aa96a011fa9f84"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"73f030d4ef6d1ad17f824a0a2eb637ef7a9c7d51"}]}],"versions":["v5.4.273","v5.4.272","v5.4.271","v5.4.270","v5.4.269","v5.4.268","v5.4.267","v5.4.266","v5.4.265","v5.4.264","v5.4.263","v5.4.262","v5.4.261","v5.4.260","v5.4.259","v5.4.258","v5.4.257","v5.4.256","v5.4.255","v5.4.254","v5.4.253","v5.4.252","v5.4.251","v5.4.250","v5.4.249","v5.4.248","v5.4.247","v5.4.246","v5.4.245","v5.4.244","v5.4.243","v5.4.242","v5.4.241","v5.4.240","v5.4.239","v5.4.238","v5.10.214","v5.10.213","v5.10.212","v5.10.211","v5.10.210","v5.10.209","v5.10.208","v5.10.207","v5.10.206","v5.10.205","v5.10.204","v5.10.203","v5.10.202","v5.10.201","v5.10.200","v5.10.199","v5.10.198","v5.10.197","v5.10.196","v5.10.195","v5.10.194","v5.10.193","v5.10.192","v5.10.191","v5.10.190","v5.10.189","v5.10.188","v5.10.187","v5.10.186","v5.10.185","v5.10.184","v5.10.183","v5.10.182","v5.10.181","v5.10.180","v5.10.179","v5.10.178","v5.10.177","v5.10.176","v5.15.153","v5.15.152","v5.15.151","v5.15.150","v5.15.149","v5.15.148","v5.15.147","v5.15.146","v5.15.145","v5.15.144","v5.15.143","v5.15.142","v5.15.141","v5.15.140","v5.15.139","v5.15.138","v5.15.137","v5.15.136","v5.15.135","v5.15.134","v5.15.133","v5.15.132","v5.15.131","v5.15.130","v5.15.129","v5.15.128","v5.15.127","v5.15.126","v5.15.125","v5.15.124","v5.15.123","v5.15.122","v5.15.121","v5.15.120","v5.15.119","v5.15.118","v5.15.117","v5.15.116","v5.15.115","v5.15.114","v5.15.113","v5.15.112","v5.15.111","v5.15.110","v5.15.109","v5.15.108","v5.15.107","v5.15.106","v5.15.105","v5.15.104","v6.1.83","v6.1.82","v6.1.81","v6.1.80","v6.1.79","v6.1.78","v6.1.77","v6.1.76","v6.1.75","v6.1.74","v6.1.73","v6.1.72","v6.1.71","v6.1.70","v6.1.69","v6.1.68","v6.1.67","v6.1.66","v6.1.65","v6.1.64","v6.1.63","v6.1.62","v6.1.61","v6.1.60","v6.1.59","v6.1.58","v6.1.57","v6.1.56","v6.1.55","v6.1.54","v6.1.53","v6.1.52","v6.1.51","v6.1.50","v6.1.49","v6.1.48","v6.1.47","v6.1.46","v6.1.45","v6.1.44","v6.1.43","v6.1.42","v6.1.41","v6.1.40","v6.1.39","v6.1.38","v6.1.37","v6.1.36","v6.1.35","v6.1.34","v6.1.33","v6.1.32","v6.1.31","v6.1.30","v6.1.29","v6.1.28","v6.1.27","v6.1.26","v6.1.25","v6.1.24","v6.1.23","v6.1.22","v6.1.21","v6.2.16","v6.2.15","v6.2.14","v6.2.13","v6.2.12","v6.2.11","v6.2.10","v6.2.9","v6.2.8"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-26935.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.4.238"},{"fixed":"5.4.274"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.10.176"},{"fixed":"5.10.215"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.15.104"},{"fixed":"5.15.154"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.1.21"},{"fixed":"6.1.84"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.8"},{"fixed":"6.3"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.3.0"},{"fixed":"6.6.24"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.7.12"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.8.0"},{"fixed":"6.8.3"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-26935.json"}}],"schema_version":"1.9.2"}