diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-08-19 16:28:23 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-08-19 16:28:23 -0700 |
| commit | 09005a63988521f74111fae344aecb3f63306168 (patch) | |
| tree | d77ec023ab384ca1ab073e707dd830b3d3117907 /rust | |
| parent | 4253eb09d25bcfe44f6987b6f67c09f09d80a966 (diff) | |
| parent | 0cee720cfd51402cfcb14d96cb326a36c13b823a (diff) | |
| download | linux-09005a63988521f74111fae344aecb3f63306168.tar.gz linux-09005a63988521f74111fae344aecb3f63306168.zip | |
Merge tag 'lsm-pr-20260814' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm
Pull LSM updates from Paul Moore:
- Remove task_euid()
The task_euid(), and Rust counterpart, was never widely used, for
good reason, and now that the only user is gone we're removing it to
rid ourselves of both dead and funky code.
- Documentation improvements
Correct some of the kdoc comments for security_task_prctl() and
clarify the rust comments on task UID accessors.
- Fix a memory leak in the LSM syscall selftests
* tag 'lsm-pr-20260814' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm:
selftests/lsm: Fix memory leak in attr_lsm_count
cred: delete task_euid()
rust: task: clarify comments on task UID accessors
lsm: clarify security_task_prctl() hook documentation
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/helpers/task.c | 5 | ||||
| -rw-r--r-- | rust/kernel/task.rs | 11 |
2 files changed, 2 insertions, 14 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 38273f4eedb5..c2b3457b700c 100644 --- a/rust/kernel/task.rs +++ b/rust/kernel/task.rs @@ -210,20 +210,13 @@ impl Task { unsafe { *ptr::addr_of!((*self.as_ptr()).pid) } } - /// Returns the UID of the given task. + /// Returns the objective real UID of the given task. #[inline] pub fn uid(&self) -> Kuid { // SAFETY: It's always safe to call `task_uid` on a valid task. Kuid::from_raw(unsafe { bindings::task_uid(self.as_ptr()) }) } - /// Returns the effective UID of the given task. - #[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 { @@ -371,7 +364,7 @@ impl PartialEq for Task { impl Eq for Task {} impl Kuid { - /// Get the current euid. + /// Get the current subjective effective UID. #[inline] pub fn current_euid() -> Kuid { // SAFETY: Just an FFI call. |
