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: <F552F506-E58D-4705-A2B5-FA2DD8BA2F92@dilger.ca>
Date:   Sat, 3 Apr 2021 12:34:50 -0600
From:   Andreas Dilger <adilger@...ger.ca>
To:     Fengnan Chang <changfengnan@...o.com>
Cc:     "Theodore Y. Ts'o" <tytso@....edu>,
        Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH v2] ext4: fix error code in ext4_commit_super

On Apr 2, 2021, at 4:16 AM, Fengnan Chang <changfengnan@...o.com> wrote:
> 
> We should set the error code when ext4_commit_super check argument failed.
> Found in code review.
> Fixes: c4be0c1dc4cdc ("filesystem freeze: add error handling of write_super_lockfs/unlockfs").
> 
> Signed-off-by: Fengnan Chang <changfengnan@...o.com>

Reviewed-by: Andreas Dilger <adilger@...ger.ca>

> ---
> fs/ext4/super.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 03373471131c..1130599c87dc 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -5500,8 +5500,10 @@ static int ext4_commit_super(struct super_block *sb, int sync)
> 	struct buffer_head *sbh = EXT4_SB(sb)->s_sbh;
> 	int error = 0;
> 
> -	if (!sbh || block_device_ejected(sb))
> -		return error;
> +	if (!sbh)
> +		return -EINVAL;
> +	if (block_device_ejected(sb))
> +		return -ENODEV;
> 
> 	/*
> 	 * If the file system is mounted read-only, don't update the
> --
> 2.29.0
> 


Cheers, Andreas






Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ