From: jongan.kim@lge.com
To: aliceryhl@google.com, arve@android.com, brauner@kernel.org,
cmllamas@google.com, gregkh@linuxfoundation.org,
tkjos@android.com, ojeda@kernel.org, boqun.feng@gmail.com,
gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org,
yury.norov@gmail.com, vitaly.wool@konsulko.se, tamird@gmail.com,
viresh.kumar@linaro.org, daniel.almeida@collabora.com
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
jongan.kim@lge.com, heesu0025.kim@lge.com, ht.hong@lge.com,
jungsu.hwang@lge.com, kernel-team@android.com,
sanghun.lee@lge.com, seulgi.lee@lge.com, sunghoon.kim@lge.com
Subject: [PATCH v2 0/3] binder: handle PID namespace conversion for freeze operation
Date: Thu, 29 Jan 2026 17:41:16 +0900 [thread overview]
Message-ID: <20260129084119.32994-1-jongan.kim@lge.com> (raw)
From: JongAn Kim <jongan.kim@lge.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
next reply other threads:[~2026-01-29 9:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 8:41 jongan.kim [this message]
2026-01-29 8:41 ` [PATCH v2 1/3] binder: handle PID namespace conversion for freeze operation jongan.kim
2026-01-29 10:41 ` Alice Ryhl
2026-01-30 1:54 ` jongan.kim
2026-01-29 8:41 ` [PATCH v2 2/3] rust: pid: add Pid abstraction and init_pid_ns helper jongan.kim
2026-01-29 10:32 ` Alice Ryhl
2026-01-30 11:34 ` heesu0025.kim
2026-01-29 14:33 ` Gary Guo
2026-01-30 4:57 ` heesu0025.kim
2026-01-29 8:41 ` [PATCH v2 3/3] rust_binder: handle PID namespace conversion for freeze operation jongan.kim
2026-01-29 10:35 ` Alice Ryhl
2026-01-30 5:22 ` heesu0025.kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260129084119.32994-1-jongan.kim@lge.com \
--to=jongan.kim@lge.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=arve@android.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=brauner@kernel.org \
--cc=cmllamas@google.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=heesu0025.kim@lge.com \
--cc=ht.hong@lge.com \
--cc=jungsu.hwang@lge.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=sanghun.lee@lge.com \
--cc=seulgi.lee@lge.com \
--cc=sunghoon.kim@lge.com \
--cc=tamird@gmail.com \
--cc=tkjos@android.com \
--cc=tmgross@umich.edu \
--cc=viresh.kumar@linaro.org \
--cc=vitaly.wool@konsulko.se \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox