* [PATCH] rust_binder: fix setting the extended_error
@ 2026-05-27 13:41 Alice Ryhl
2026-05-28 7:50 ` Alice Ryhl
0 siblings, 1 reply; 2+ messages in thread
From: Alice Ryhl @ 2026-05-27 13:41 UTC (permalink / raw)
To: Greg Kroah-Hartman, Carlos Llamas
Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, rust-for-linux, linux-kernel, stable
This code currently copies the ExtendedError struct to the stack,
modifies the copy, and then doesn't modify the original. Thus, fix it.
Clearly nobody actually uses this feature, because nobody noticed that
this is broken until they tried changing userspace to make some errors
fatal.
A test in userspace is being added along with this change.
Cc: stable@vger.kernel.org
Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
drivers/android/binder/thread.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/android/binder/thread.rs b/drivers/android/binder/thread.rs
index 97d5f31e8fe3..0c74436c4e62 100644
--- a/drivers/android/binder/thread.rs
+++ b/drivers/android/binder/thread.rs
@@ -1249,9 +1249,9 @@ fn transaction(self: &Arc<Self>, cmd: u32, reader: &mut UserSliceReader) -> Resu
info.reply = err.reply;
{
- let mut ee = self.inner.lock().extended_error;
- ee.command = err.reply;
- ee.param = source.to_errno();
+ let mut inner = self.inner.lock();
+ inner.extended_error.command = err.reply;
+ inner.extended_error.param = source.to_errno();
}
pr_warn!(
---
base-commit: 7fd2df204f342fc17d1a0bfcd474b24232fb0f32
change-id: 20260527-set-extended-error-e2ca37e0696d
Best regards,
--
Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] rust_binder: fix setting the extended_error
2026-05-27 13:41 [PATCH] rust_binder: fix setting the extended_error Alice Ryhl
@ 2026-05-28 7:50 ` Alice Ryhl
0 siblings, 0 replies; 2+ messages in thread
From: Alice Ryhl @ 2026-05-28 7:50 UTC (permalink / raw)
To: Greg Kroah-Hartman, Carlos Llamas
Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Danilo Krummrich,
rust-for-linux, linux-kernel, stable
On Wed, May 27, 2026 at 3:41 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> This code currently copies the ExtendedError struct to the stack,
> modifies the copy, and then doesn't modify the original. Thus, fix it.
> Clearly nobody actually uses this feature, because nobody noticed that
> this is broken until they tried changing userspace to make some errors
> fatal.
>
> A test in userspace is being added along with this change.
>
> Cc: stable@vger.kernel.org
> Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Hrm, looks like this patch is insufficient.
Alice
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-28 7:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-27 13:41 [PATCH] rust_binder: fix setting the extended_error Alice Ryhl
2026-05-28 7:50 ` Alice Ryhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®