[PATCH] afs: Fix updating of i_mode due to 3rd party change

David Howells dhowells at redhat.com
Wed Feb 10 14:01:31 EST 2021


Al Viro <viro at zeniv.linux.org.uk> wrote:

> On Wed, Feb 10, 2021 at 08:59:52AM +0000, David Howells wrote:
> > Fix afs_apply_status() to mask off the irrelevant bits from status->mode
> > when OR'ing them into i_mode.  This can happen when a 3rd party chmod
> > occurs.
> > 
> > Also fix afs_inode_init_from_status() to mask off the mode bits when
> > initialising i_mode.
> 
> afd_inode_init_from_status() would be better off with
> 	status->mode &= S_IALLUGO;
> before the switch, seeing that normally it has all-zeroes in type bits anyway.

That might cause the check in afs_apply_status() to malfunction.  Any such
masking off would need to be done earlier than that.

Also, it's been suggested that I should also mask off the SUID, SGID and VTX
bits.

David




More information about the linux-afs mailing list