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: <002d1dee-0e34-279d-c2e6-3d0fdfa385af@huawei.com>
Date: Thu, 26 Sep 2024 19:12:51 +0800
From: Zhihao Cheng <chengzhihao1@...wei.com>
To: Markus Elfring <Markus.Elfring@....de>, <linux-mtd@...ts.infradead.org>,
	Richard Weinberger <richard@....at>
CC: LKML <linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH 1/2] ubifs: Call iput(xino) only once in
 ubifs_purge_xattrs()

在 2024/9/26 17:49, Markus Elfring 写道:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Thu, 26 Sep 2024 11:05:29 +0200
> 
> An iput(xino) call was immediately used after a return value check
> for a remove_xattr() call in this function implementation.
> Thus call such a function only once instead directly before the check.
> 
> This issue was transformed by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>   fs/ubifs/xattr.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 

Reviewed-by: Zhihao Cheng <chengzhihao1@...wei.com>
> diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
> index f734588b224a..7757959e9f09 100644
> --- a/fs/ubifs/xattr.c
> +++ b/fs/ubifs/xattr.c
> @@ -541,16 +541,14 @@ int ubifs_purge_xattrs(struct inode *host)
> 
>   		clear_nlink(xino);
>   		err = remove_xattr(c, host, xino, &nm);
> +		iput(xino);
>   		if (err) {
>   			kfree(pxent);
>   			kfree(xent);
> -			iput(xino);
>   			ubifs_err(c, "cannot remove xattr, error %d", err);
>   			goto out_err;
>   		}
> 
> -		iput(xino);
> -
>   		kfree(pxent);
>   		pxent = xent;
>   		key_read(c, &xent->key, &key);
> --
> 2.46.1
> 
> .
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ