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: <20241124183743.GX3387508@ZenIV>
Date: Sun, 24 Nov 2024 18:37:43 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Christian Brauner <brauner@...nel.org>
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 21/26] smb: avoid pointless cred reference count bump

On Sun, Nov 24, 2024 at 02:44:07PM +0100, Christian Brauner wrote:
> No need for the extra reference count bump.
> 
> Signed-off-by: Christian Brauner <brauner@...nel.org>
> ---
>  fs/smb/server/smb_common.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/smb/server/smb_common.c b/fs/smb/server/smb_common.c
> index f1d770a214c8b2c7d7dd4083ef57c7130bbce52c..a3f96804f84f03c22376769dffdf60cd66f5e3d2 100644
> --- a/fs/smb/server/smb_common.c
> +++ b/fs/smb/server/smb_common.c
> @@ -780,7 +780,7 @@ int __ksmbd_override_fsids(struct ksmbd_work *work,
>  		cred->cap_effective = cap_drop_fs_set(cred->cap_effective);
>  
>  	WARN_ON(work->saved_cred);
> -	work->saved_cred = override_creds(get_new_cred(cred));
> +	work->saved_cred = override_creds(cred);
>  	if (!work->saved_cred) {
>  		abort_creds(cred);
>  		return -EINVAL;

Won't that leave a dangling pointer?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ