mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 05:26:07 +00:00
coredump: avoid pointless cred reference count bump
The creds are allocated via prepare_creds() which has already taken a reference. Link: https://lore.kernel.org/r/20241125-work-cred-v2-12-68b9d38bb5b2@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
caf6bf48f9
commit
bd05aeb1ee
@ -576,7 +576,7 @@ void do_coredump(const kernel_siginfo_t *siginfo)
|
|||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
goto fail_creds;
|
goto fail_creds;
|
||||||
|
|
||||||
old_cred = override_creds(get_new_cred(cred));
|
old_cred = override_creds(cred);
|
||||||
|
|
||||||
ispipe = format_corename(&cn, &cprm, &argv, &argc);
|
ispipe = format_corename(&cn, &cprm, &argv, &argc);
|
||||||
|
|
||||||
@ -781,7 +781,7 @@ fail_unlock:
|
|||||||
kfree(argv);
|
kfree(argv);
|
||||||
kfree(cn.corename);
|
kfree(cn.corename);
|
||||||
coredump_finish(core_dumped);
|
coredump_finish(core_dumped);
|
||||||
put_cred(revert_creds(old_cred));
|
revert_creds(old_cred);
|
||||||
fail_creds:
|
fail_creds:
|
||||||
put_cred(cred);
|
put_cred(cred);
|
||||||
fail:
|
fail:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user