lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241125-braumeister-dorfbewohner-9d1caf8f56a1@brauner>
Date: Mon, 25 Nov 2024 12:31:19 +0100
From: Christian Brauner <brauner@...nel.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>, 
	Amir Goldstein <amir73il@...il.com>, Miklos Szeredi <miklos@...redi.hu>, linux-kernel@...r.kernel.org, 
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 09/26] target_core_configfs: avoid pointless cred
 reference count bump

On Sun, Nov 24, 2024 at 06:26:12PM +0000, Al Viro wrote:
> On Sun, Nov 24, 2024 at 02:43:55PM +0100, Christian Brauner wrote:
> > The creds are allocated via prepare_kernel_cred() which has already
> > taken a reference.
> > 
> > Signed-off-by: Christian Brauner <brauner@...nel.org>
> > ---
> >  drivers/target/target_core_configfs.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
> > index ec7a5598719397da5cadfed12a05ca8eb81e46a9..d102ab79c56dd7977465f7455749e6e7a2c9fba1 100644
> > --- a/drivers/target/target_core_configfs.c
> > +++ b/drivers/target/target_core_configfs.c
> > @@ -3756,10 +3756,9 @@ static int __init target_core_init_configfs(void)
> >  		ret = -ENOMEM;
> >  		goto out;
> >  	}
> > -	old_cred = override_creds(get_new_cred(kern_cred));
> > +	old_cred = override_creds(kern_cred);
> >  	target_init_dbroot();
> >  	put_cred(revert_creds(old_cred));
> > -	put_cred(kern_cred);
> 
> FWIW, I agree with Amir - 
>  	revert_creds(old_cred);
> 	put_cred(kern_cred);

Ok, done.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ