[PATCH] cred: remove RCU initializer for init_task.cred

Jann Horn <[email protected]>
Newsgroups org.kernel.vger.linux-security-module,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
sparse noticed that an RCU initializer was left behind for init_task.cred,
which is no longer marked __rcu. Fix it up.

Fixes: a4229a2a16a8 ("cred: clarify that task_struct::cred is only for the current task")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Jann Horn <[email protected]>
---
maybe squash this into the original commit, if that is a thing you do on
the dev-staging branch?
---
 init/init_task.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init/init_task.c b/init/init_task.c
index b67ef6040a65..6529b002135b 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -159,7 +159,7 @@ struct task_struct init_task __aligned(L1_CACHE_BYTES) = {
 	.sibling	= LIST_HEAD_INIT(init_task.sibling),
 	.group_leader	= &init_task,
 	RCU_POINTER_INITIALIZER(real_cred, &init_cred),
-	RCU_POINTER_INITIALIZER(cred, &init_cred),
+	.cred		= &init_cred,
 	.comm		= INIT_TASK_COMM,
 	.thread		= INIT_THREAD,
 	.fs		= &init_fs,

---
base-commit: 1f2f7a1fd1fc34e757107e3a3849f8d22b14cc6b
change-id: 20260812-task-cred-fixup-2e5c5dbe6a3b

Best regards,
--  
Jann Horn <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.