[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260129084119.32994-1-jongan.kim@lge.com>
Date: Thu, 29 Jan 2026 17:41:16 +0900
From: jongan.kim@....com
To: aliceryhl@...gle.com,
arve@...roid.com,
brauner@...nel.org,
cmllamas@...gle.com,
gregkh@...uxfoundation.org,
tkjos@...roid.com,
ojeda@...nel.org,
boqun.feng@...il.com,
gary@...yguo.net,
bjorn3_gh@...tonmail.com,
lossin@...nel.org,
a.hindborg@...nel.org,
tmgross@...ch.edu,
dakr@...nel.org,
yury.norov@...il.com,
vitaly.wool@...sulko.se,
tamird@...il.com,
viresh.kumar@...aro.org,
daniel.almeida@...labora.com
Cc: linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org,
jongan.kim@....com,
heesu0025.kim@....com,
ht.hong@....com,
jungsu.hwang@....com,
kernel-team@...roid.com,
sanghun.lee@....com,
seulgi.lee@....com,
sunghoon.kim@....com
Subject: [PATCH v2 0/3] binder: handle PID namespace conversion for freeze operation
From: JongAn Kim <jongan.kim@....com>
This patch series fixes PID namespace handling in binder's freeze operation
for both C and Rust implementations.
This series addresses the issue by:
1. Patch 1/3: Fixes the C binder implementation by adding PID namespace
conversion logic. It converts the caller's PID from their namespace to
the init namespace before matching against binder_proc->pid, ensuring
correct process identification.
2. Patch 2/3: Adds Rust abstractions for PID handling, including:
- New Pid abstraction wrapping kernel's struct pid
- find_vpid_with_guard() and pid_task_with_guard() functions with RCU
protection
- init_pid_ns() helper to access the init PID namespace
These abstractions provide safe Rust interfaces with lifetime-bounded
references tied to RCU guards for memory safety.
3. Patch 3/3: Ports the PID namespace conversion logic to the Rust binder
implementation, using the new abstractions to ensure freeze operations
from non-init namespaces target the correct process.
This ensures consistent and correct PID handling across both C and Rust
binder implementations when freeze operations occur in containerized
environments.
v1 : https://lore.kernel.org/lkml/20251203024140.175952-1-jongan.kim@lge.com/T/#u
v1 -> v2 changes:
- add two more patches to implement the same logic in Rust binder
HeeSu Kim (2):
rust: pid: add Pid abstraction and init_pid_ns helper
rust_binder: handle PID namespace conversion for freeze operation
JongAn Kim (1):
binder: handle PID namespace conversion for freeze operation
drivers/android/binder.c | 52 +++++++++++++++-
drivers/android/binder/process.rs | 40 +++++++++++-
rust/kernel/lib.rs | 1 +
rust/kernel/pid.rs | 100 ++++++++++++++++++++++++++++++
rust/kernel/pid_namespace.rs | 9 +++
5 files changed, 196 insertions(+), 6 deletions(-)
create mode 100644 rust/kernel/pid.rs
--
2.25.1
Powered by blists - more mailing lists