History

Merge tag 'driver-core-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core

Pull driver core fixes from Danilo Krummrich: - Always inline I/O and IRQ methods using build_assert!() to avoid false positive build errors - Do not free the driver's device private data in I2C shutdown() avoiding race conditions that can lead to UAF bugs - Drop the driver's device private data after the driver has been fully unbound from its device to avoid UAF bugs from &Device<Bound> scopes, such as IRQ callbacks * tag 'driver-core-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core: rust: driver: drop device private data post unbind rust: driver: add DriverData type to the DriverLayout trait rust: driver: add DEVICE_DRIVER_OFFSET to the DriverLayout trait rust: driver: introduce a DriverLayout trait rust: auxiliary: add Driver::unbind() callback rust: i2c: do not drop device private data on shutdown() rust: irq: always inline functions using build_assert with arguments rust: io: always inline functions using build_assert with arguments

Linus Torvalds committed 9 months ago

Commit 5dbeeb22 parents 12a0094 a995fe112 files · +209 −74Browse files

Showing the changes to include/linux (1 of 12 files). Show all

Unified · Split

include/linux/device/driver.h+9−0
@@ -85,6 +85,8 @@ enum probe_type { · 84 unmodified lines
8585 * uevent.
8686 * @p: Driver core's private data, no one other than the driver
8787 * core can touch this.
88+ * @p_cb: Callbacks private to the driver core; no one other than the
89+ * driver core is allowed to touch this.
8890 *
8991 * The device driver-model tracks all of the drivers known to the system.
9092 * The main reason for this tracking is to enable the driver core to match
@@ -119,6 +121,13 @@ struct device_driver { · 28 unmodified lines
119121 void (*coredump) (struct device *dev);
120122
121123 struct driver_private *p;
124+ struct {
125+ /*
126+ * Called after remove() and after all devres entries have been
127+ * processed. This is a Rust only callback.
128+ */
129+ void (*post_unbind_rust)(struct device *dev);
130+ } p_cb;
122131 };
123132
124133