mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 17:22:07 +00:00
cgroup: avoid pointless cred reference count bump
of->file->f_cred already holds a reference count that is stable during the operation. Link: https://lore.kernel.org/r/20241125-work-cred-v2-24-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
6256d2377e
commit
34ab26fb6b
@ -5216,11 +5216,11 @@ static ssize_t __cgroup_procs_write(struct kernfs_open_file *of, char *buf,
|
||||
* permissions using the credentials from file open to protect against
|
||||
* inherited fd attacks.
|
||||
*/
|
||||
saved_cred = override_creds(get_new_cred(of->file->f_cred));
|
||||
saved_cred = override_creds(of->file->f_cred);
|
||||
ret = cgroup_attach_permissions(src_cgrp, dst_cgrp,
|
||||
of->file->f_path.dentry->d_sb,
|
||||
threadgroup, ctx->ns);
|
||||
put_cred(revert_creds(saved_cred));
|
||||
revert_creds(saved_cred);
|
||||
if (ret)
|
||||
goto out_finish;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user