diff options
| author | Alice Ryhl <aliceryhl@google.com> | 2026-07-03 06:57:02 +0000 |
|---|---|---|
| committer | Paul Moore <paul@paul-moore.com> | 2026-07-07 15:10:48 -0400 |
| commit | 15c1f17979712407a4a71f2129f89ecd625ccbe8 (patch) | |
| tree | 4c64b96ef8dd541ad505e1b5bac6e81b4e5ad630 /rust | |
| parent | ef2d3e4635761b0af2bf1b89a2252e42a3bf37f1 (diff) | |
cred: delete task_euid()
task_euid() is a very weird operation. You can see how weird it is by
grepping for task_euid() - binder is its only user. task_euid() obtains
the objective effective UID - it looks at the credentials of the task
for purposes of acting on it as an object, but then accesses the
effective UID (which the credentials.7 man page describes as "[...] used
by the kernel to determine the permissions that the process will have
when accessing shared resources [...]").
Since usage in Binder has now been removed, get rid of the resulting
dead code.
Changes to the zh_CN translation was carried out with the help of
Gemini and Google Translate, and since adjusted as per Alex Shi's
feedback.
Suggested-by: Jann Horn <jannh@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/helpers/task.c | 5 | ||||
| -rw-r--r-- | rust/kernel/task.rs | 10 |
2 files changed, 0 insertions, 15 deletions
diff --git a/rust/helpers/task.c b/rust/helpers/task.c index c0e1a06ede78..b46b1433a67e 100644 --- a/rust/helpers/task.c +++ b/rust/helpers/task.c @@ -28,11 +28,6 @@ __rust_helper kuid_t rust_helper_task_uid(struct task_struct *task) return task_uid(task); } -__rust_helper kuid_t rust_helper_task_euid(struct task_struct *task) -{ - return task_euid(task); -} - #ifndef CONFIG_USER_NS __rust_helper uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid) { diff --git a/rust/kernel/task.rs b/rust/kernel/task.rs index eabd65bfde12..c2b3457b700c 100644 --- a/rust/kernel/task.rs +++ b/rust/kernel/task.rs @@ -217,16 +217,6 @@ impl Task { Kuid::from_raw(unsafe { bindings::task_uid(self.as_ptr()) }) } - /// Returns the objective effective UID of the given task. - /// - /// You should probably not be using this; the effective UID is normally - /// only relevant in subjective credentials. - #[inline] - pub fn euid(&self) -> Kuid { - // SAFETY: It's always safe to call `task_euid` on a valid task. - Kuid::from_raw(unsafe { bindings::task_euid(self.as_ptr()) }) - } - /// Determines whether the given task has pending signals. #[inline] pub fn signal_pending(&self) -> bool { |
