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]
Date:	Fri, 08 Jun 2012 04:03:09 +0100
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Theodore Tso <tytso@....edu>
Cc:	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
	alan@...rguk.ukuu.org.uk, Tao Ma <boyu.mt@...bao.com>,
	Greg KH <gregkh@...uxfoundation.org>
Subject: Re: [ 64/82] ext4: dont trash state flags in EXT4_IOC_SETFLAGS

On Thu, 2012-06-07 at 13:04 +0900, Greg KH wrote:
> 3.4-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Theodore Ts'o <tytso@....edu>
> 
> commit 79906964a187c405db72a3abc60eb9b50d804fbc upstream.
> 
> In commit 353eb83c we removed i_state_flags with 64-bit longs, But
> when handling the EXT4_IOC_SETFLAGS ioctl, we replace i_flags
> directly, which trashes the state flags which are stored in the high
> 32-bits of i_flags on 64-bit platforms.  So use the the
> ext4_{set,clear}_inode_flags() functions which use atomic bit
> manipulation functions instead.
[...]
> @@ -115,8 +115,14 @@ long ext4_ioctl(struct file *filp, unsig
>  		if (err)
>  			goto flags_err;
>  
> -		flags = flags & EXT4_FL_USER_MODIFIABLE;
> -		flags |= oldflags & ~EXT4_FL_USER_MODIFIABLE;
> +		for (i = 0, mask = 1; i < 32; i++, mask <<= 1) {
> +			if (!(mask & EXT4_FL_USER_MODIFIABLE))
> +				continue;
> +			if (mask & flags)
> +				ext4_set_inode_flag(inode, i);
> +			else
> +				ext4_clear_inode_flag(inode, i);
> +		}
>  		ei->i_flags = flags;
[...]

Shouldn't this last assignment have been deleted?

Ben.

-- 
Ben Hutchings
I haven't lost my mind; it's backed up on tape somewhere.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ