Re: [PATCH] task: delete task_euid()

From
Alice Ryhl <aliceryhl@google.com>
Date
2026-02-19 14:35:12
Also in
linux-doc, lkml, rust-for-linux
Reply to
Alex Shi, 2026-02-19
On Thu, Feb 19, 2026 at 10:27:01PM +0800, Alex Shi wrote:

On 2026/2/19 20:14, Alice Ryhl wrote:
quoted
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.
quoted
diff --git a/Documentation/translations/zh_CN/security/credentials.rst b/Documentation/translations/zh_CN/security/credentials.rst
index 88fcd9152ffe91d79fc10bfc7b2a37d301b4938a..f0b2efec342438b81be415dc513622c961bb7e59 100644
--- a/Documentation/translations/zh_CN/security/credentials.rst
+++ b/Documentation/translations/zh_CN/security/credentials.rst
@@ -337,15 +337,13 @@ const指针上操作,因此不需要进行类型转换,但需要临时放弃
     ``__task_cred()`` 的结果不应直接传递给 ``get_cred()`` ,
     因为这可能与 ``commit_cred()`` 发生竞争条件。
-还有一些方便的函数可以访问另一个任务凭据的特定部分,将RCU操作对调用方隐藏起来::
+有一个方便的函数可用于访问另一个任务凭据的特定部分,从而对调用方隐藏RCU机制::
LGTM.
quoted
  	uid_t task_uid(task)		Task's real UID
-	uid_t task_euid(task)		Task's effective UID
-如果调用方在此时已经持有RCU读锁,则应使用::
+如果调用方在此时已经持有RCU读锁,则应改为使用::
Please keep the old version. the new one is a bit ambiguous.
Thanks for checking!

Alice
Thread (5 messages) 5 messages, 3 authors, last reply 2026-02-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help