]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
coredump: move revert_cred() before coredump_cleanup()
authorChristian Brauner <brauner@kernel.org>
Mon, 3 Nov 2025 14:57:31 +0000 (15:57 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 5 Nov 2025 22:11:51 +0000 (23:11 +0100)
There's no need to pin the credentials across the coredump_cleanup()
call. Nothing in there depends on elevated credentials.

Link: https://patch.msgid.link/20251103-work-creds-guards-prepare_creds-v1-5-b447b82f2c9b@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/coredump.c

index 5c1c381ee380693c0d3e0f1eacd98cb3d8339986..4fce2a2f279c0489e29c225b4b1bac046014552e 100644 (file)
@@ -1197,8 +1197,8 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
        }
 
 close_fail:
-       coredump_cleanup(&cn, &cprm);
        revert_creds(old_cred);
+       coredump_cleanup(&cn, &cprm);
        return;
 }