@@ -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;
No need for the extra reference count bump. Signed-off-by: Christian Brauner <brauner@kernel.org> --- kernel/cgroup/cgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)