mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
ovl: avoid pointless cred reference count bump
security_inode_copy_up() allocates a set of new credentials and has taken a reference count. Link: https://lore.kernel.org/r/20241125-work-cred-v2-18-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
7708f3a7d2
commit
facc239a8c
|
|
@ -741,7 +741,7 @@ static int ovl_prep_cu_creds(struct dentry *dentry, struct ovl_cu_creds *cc)
|
|||
return err;
|
||||
|
||||
if (cc->new)
|
||||
cc->old = override_creds(get_new_cred(cc->new));
|
||||
cc->old = override_creds(cc->new);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -749,7 +749,7 @@ static int ovl_prep_cu_creds(struct dentry *dentry, struct ovl_cu_creds *cc)
|
|||
static void ovl_revert_cu_creds(struct ovl_cu_creds *cc)
|
||||
{
|
||||
if (cc->new) {
|
||||
put_cred(revert_creds(cc->old));
|
||||
revert_creds(cc->old);
|
||||
put_cred(cc->new);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user