]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
s390/cio: use generic driver_override infrastructure
authorDanilo Krummrich <dakr@kernel.org>
Tue, 24 Mar 2026 00:59:13 +0000 (01:59 +0100)
committerDanilo Krummrich <dakr@kernel.org>
Fri, 3 Apr 2026 22:48:40 +0000 (00:48 +0200)
commitac4d8bb6e2e13e8684a76ea48d13ebaaaf5c24c4
tree60f76be6332c35bdb268b77a6374a554b7c50b47
parent85bb534ff12aab6916058897b39c748940a7a4c6
s390/cio: use generic driver_override infrastructure

When a driver is probed through __driver_attach(), the bus' match()
callback is called without the device lock held, thus accessing the
driver_override field without a lock, which can cause a UAF.

Fix this by using the driver-core driver_override infrastructure taking
care of proper locking internally.

Note that calling match() from __driver_attach() without the device lock
held is intentional. [1]

Link: https://lore.kernel.org/driver-core/DGRGTIRHA62X.3RY09D9SOK77P@kernel.org/
Reported-by: Gui-Dong Han <hanguidong02@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220789
Fixes: ebc3d1791503 ("s390/cio: introduce driver_override on the css bus")
Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Link: https://patch.msgid.link/20260324005919.2408620-10-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
drivers/s390/cio/cio.h
drivers/s390/cio/css.c