* [PATCH] rust_binder: report EINVAL for unknown handles
@ 2026-11-18 11:25 Alice Ryhl
2026-11-21 18:34 ` Carlos Llamas
0 siblings, 1 reply; 2+ messages in thread
From: Alice Ryhl @ 2026-11-18 11:25 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, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan, rust-for-linux, linux-kernel,
stable
Currently unknown handles are reported as ENOENT, which userspace
doesn't treat as a fatal error. However, providing the wrong handle is a
fatal API violation, and indicates UAF in the userspace process.
Thus, change it to EINVAL to match C Binder and make userspace treat it
as a fatal error.
Cc: stable@vger.kernel.org
Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
drivers/android/binder/process.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs
index e97213250beb..406d80cfff08 100644
--- a/drivers/android/binder/process.rs
+++ b/drivers/android/binder/process.rs
@@ -958,7 +958,7 @@ pub(crate) fn get_node_from_handle(&self, handle: u32, strong: bool) -> Result<N
.lock()
.by_handle
.get_mut(&handle)
- .ok_or(ENOENT)?
+ .ok_or(EINVAL)?
.node_ref()
.clone(strong)
}
---
base-commit: 917fcbf033154a6c8d83cfa6c88f012b71eb37b2
change-id: 20261029-binder-unknown-einval-10407d1ebb1e
Best regards,
--
Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rust_binder: report EINVAL for unknown handles
2026-11-18 11:25 [PATCH] rust_binder: report EINVAL for unknown handles Alice Ryhl
@ 2026-11-21 18:34 ` Carlos Llamas
0 siblings, 0 replies; 2+ messages in thread
From: Carlos Llamas @ 2026-11-21 18:34 UTC (permalink / raw)
To: Alice Ryhl
Cc: Greg Kroah-Hartman, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan, rust-for-linux, linux-kernel,
stable
On Wed, Nov 18, 2026 at 11:25:40AM +0000, Alice Ryhl wrote:
> Currently unknown handles are reported as ENOENT, which userspace
> doesn't treat as a fatal error. However, providing the wrong handle is a
> fatal API violation, and indicates UAF in the userspace process.
>
> Thus, change it to EINVAL to match C Binder and make userspace treat it
> as a fatal error.
>
> Cc: stable@vger.kernel.org
> Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> drivers/android/binder/process.rs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs
> index e97213250beb..406d80cfff08 100644
> --- a/drivers/android/binder/process.rs
> +++ b/drivers/android/binder/process.rs
> @@ -958,7 +958,7 @@ pub(crate) fn get_node_from_handle(&self, handle: u32, strong: bool) -> Result<N
> .lock()
> .by_handle
> .get_mut(&handle)
> - .ok_or(ENOENT)?
> + .ok_or(EINVAL)?
> .node_ref()
> .clone(strong)
> }
>
> ---
> base-commit: 917fcbf033154a6c8d83cfa6c88f012b71eb37b2
> change-id: 20261029-binder-unknown-einval-10407d1ebb1e
>
> Best regards,
> --
> Alice Ryhl <aliceryhl@google.com>
>
LGTM,
Acked-by: Carlos Llamas <cmllamas@google.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-21 18:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 11:25 [PATCH] rust_binder: report EINVAL for unknown handles Alice Ryhl
2026-11-21 18:34 ` Carlos Llamas
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®