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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090807222813.GB28019@cmpxchg.org>
Date:	Sat, 8 Aug 2009 00:28:13 +0200
From:	Johannes Weiner <hannes@...xchg.org>
To:	Jeff Layton <jlayton@...hat.com>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org, hch@...radead.org, rlove@...gle.com,
	msb@...gle.com, viro@...iv.linux.org.uk
Subject: Re: [PATCH 1/4] vfs: make get_sb_pseudo set s_maxbytes to value that can be cast to signed

On Fri, Aug 07, 2009 at 02:57:38PM -0400, Jeff Layton wrote:
> This patch is a counterpart to the CIFS patch posted yesterday. I
> believe either patch will fix the problem seen in do_sendfile since the
> smaller s_maxbytes value for the two superblocks is used there.

This refers to the 'yesterday' 2-3 weeks ago, no? :-)

> get_sb_pseudo sets s_maxbytes to ~0ULL, which becomes negative when cast
> to a signed value. Fix it to use MAX_LFS_FILESIZE which casts properly
> to a positive signed value.

I think the proper term is 'converted' in this case, not 'cast'.  Even
without casts it gets converted by arithmetic operands.

> Signed-off-by: Jeff Layton <jlayton@...hat.com>

Reviewed-by: Johannes Weiner <hannes@...xchg.org>

> ---
>  fs/libfs.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/libfs.c b/fs/libfs.c
> index ddfa899..dcec3d3 100644
> --- a/fs/libfs.c
> +++ b/fs/libfs.c
> @@ -217,7 +217,7 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
>  		return PTR_ERR(s);
>  
>  	s->s_flags = MS_NOUSER;
> -	s->s_maxbytes = ~0ULL;
> +	s->s_maxbytes = MAX_LFS_FILESIZE;
>  	s->s_blocksize = PAGE_SIZE;
>  	s->s_blocksize_bits = PAGE_SHIFT;
>  	s->s_magic = magic;
> -- 
> 1.6.0.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ