[PATCH] cred: remove RCU initializer for init_task.cred
From: Jann Horn
Date: Wed Aug 12 2026 - 10:52:12 EST
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 <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202608121153.nzs6HZg7-lkp@xxxxxxxxx/
Signed-off-by: Jann Horn <jannh@xxxxxxxxxx>
---
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 <jannh@xxxxxxxxxx>