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 --- 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