Thread (15 messages) 15 messages, 2 authors, 2025-11-03
STALE215d

[PATCH 09/12] coredump: use prepare credential guard

From: Christian Brauner <brauner@kernel.org>
Date: 2025-11-03 14:58:19
Also in: cgroups, linux-cifs, linux-crypto, linux-fsdevel, linux-nfs, linux-unionfs, lkml, netdev
Subsystem: filesystems (vfs and infrastructure), the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

Use the prepare credential guard for allocating a new set of
credentials.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 fs/coredump.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/coredump.c b/fs/coredump.c
index 79c681f1d647..5424a6c4e360 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -1155,7 +1155,6 @@ static void do_coredump(struct core_name *cn, struct coredump_params *cprm,
 
 void vfs_coredump(const kernel_siginfo_t *siginfo)
 {
-	struct cred *cred __free(put_cred) = NULL;
 	size_t *argv __free(kfree) = NULL;
 	struct core_state core_state;
 	struct core_name cn;
@@ -1183,7 +1182,7 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
 	if (coredump_skip(&cprm, binfmt))
 		return;
 
-	cred = prepare_creds();
+	CLASS(prepare_creds, cred)();
 	if (!cred)
 		return;
 	/*
-- 
2.47.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help