]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: i2c: do not drop device private data on shutdown()
authorDanilo Krummrich <dakr@kernel.org>
Wed, 7 Jan 2026 10:35:00 +0000 (11:35 +0100)
committerDanilo Krummrich <dakr@kernel.org>
Thu, 15 Jan 2026 00:18:34 +0000 (01:18 +0100)
commit4181aceb4af414bd6d2ce5eb9a22637bbb4f5f8c
treeddf0164b6e249eaf438f392dce41f1cd60014660
parent5d9c4c272ba06055d19e05c2a02e16e58acc8943
rust: i2c: do not drop device private data on shutdown()

We must not drop the device private data on shutdown(); none of the
registrations attached to devres that might access the device private
data are released before shutdown() is called.

Hence, freeing the device private data on shutdown() can cause UAF bugs.

Fixes: 57c5bd9aee94 ("rust: i2c: add basic I2C device and driver abstractions")
Acked-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Igor Korotin <igor.korotin.linux@gmail.com>
Link: https://patch.msgid.link/20260107103511.570525-2-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/i2c.rs