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: <4C28B8AD.6040001@redhat.com>
Date:	Mon, 28 Jun 2010 09:58:53 -0500
From:	Eric Sandeen <sandeen@...hat.com>
To:	Toshiyuki Okajima <toshi.okajima@...fujitsu.com>
CC:	tytso@....edu, adilger@....com, linux-ext4@...r.kernel.org
Subject: Re: [PATCH][BUG] ext4: do not execute ext4_std_error with EFBIG at
 ext4_setattr

Toshiyuki Okajima wrote:
> From: Toshiyuki Okajima <toshi.okajima@...fujitsu.com>
> 
> You know, do_truncate() can call ext4_setattr() (via notify_change()).
> And, ext4_setattr() can return with -EFBIG if the argument(length) of 
> do_truncate() is more than sbi->s_bitmap_maxbytes. At that time, 
> it also calls ext4_std_error() with -EFBIG.
> 
> Besides, a panic happens when ext4_setattr() returns with -EFBIG
> after we mount an ext4 filesystem with errors=panic.

...

> This changes prevent this problem from happening.

Whoops, that one was my fault; thanks for catching it.

I might just "return error" at that spot, but this works fine too.

Reviewed-by: Eric Sandeen <sandeen@...hat.com>
 
> Signed-off-by: Toshiyuki Okajima <toshi.okajima@...fujitsu.com>
> ---
>  fs/ext4/inode.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 42272d6..e87bb45 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -5485,7 +5485,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
>  
>  			if (attr->ia_size > sbi->s_bitmap_maxbytes) {
>  				error = -EFBIG;
> -				goto err_out;
> +				goto err_out2;
>  			}
>  		}
>  	}
> @@ -5544,6 +5544,7 @@ err_out:
>  	ext4_std_error(inode->i_sb, error);
>  	if (!error)
>  		error = rc;
> +err_out2:
>  	return error;
>  }
>  

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ