diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-26 07:04:41 -1000 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-26 07:04:41 -1000 |
| commit | 0cc3ad8f4d2e2009c2005278c754caf7c07fe0a4 (patch) | |
| tree | 06e66926022aadb527013fd19569597d2a2c12fe /include | |
| parent | 7313d94c67daf04bc1b6ee39b492d2795fe2f3da (diff) | |
| parent | 187a62f99da29b1a55602b0d401a783d8dc86161 (diff) | |
Merge tag 'driver-core-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core
Pull driver core fixes from Danilo Krummrich:
- Make parent-lock requirements per device type instead of per bus,
fixing a use-after-free on USB disconnect by limiting the requirement
to USB interfaces, which retain a reference to their parent
- Honor parent-lock requirements during deferred and asynchronous
probing, fixing USB interface probe races, including duplicate
endpoint creation attempts in sysfs
* tag 'driver-core-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core:
driver core: take parent lock in async device attach
driver core: take parent lock on deferred probe
driver core: fix parent lock use-after-free on USB disconnect
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/device.h | 5 | ||||
| -rw-r--r-- | include/linux/device/bus.h | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 879eb758b5ee..429e39f647cf 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -83,6 +83,10 @@ int subsys_virtual_register(const struct bus_type *subsys, * information, equivalent to the kobj_type of a kobject. * If "name" is specified, the uevent will contain it in * the DEVTYPE variable. + * + * @need_parent_lock: When probing or removing a device of this type, + * driver core should lock the device's parent. Note that + * the device must hold a reference to its parent. */ struct device_type { const char *name; @@ -93,6 +97,7 @@ struct device_type { void (*release)(struct device *dev); const struct dev_pm_ops *pm; + bool need_parent_lock; }; /** diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h index 89e156b9acb5..9ef7538a9a7f 100644 --- a/include/linux/device/bus.h +++ b/include/linux/device/bus.h @@ -68,8 +68,6 @@ struct fwnode_handle; * @driver_override: Set to true if this bus supports the driver_override * mechanism, which allows userspace to force a specific * driver to bind to a device via a sysfs attribute. - * @need_parent_lock: When probing or removing a device on this bus, the - * device core should lock the device's parent. * * A bus is a channel between the processor and one or more devices. For the * purposes of the device model, all devices are connected via a bus, even if @@ -110,7 +108,6 @@ struct bus_type { const struct dev_pm_ops *pm; bool driver_override; - bool need_parent_lock; }; int __must_check companion_bus_register(const struct bus_type *bus); |
