Re: [PATCH 1/2] fuse2fs: fix normal (non-kernel) permissions checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 01, 2025 at 11:50:43PM -0400, Theodore Ts'o wrote:
> Commit 9f69dfc4e275 ("fuse2fs: implement O_APPEND correctly") defined
> a new flag, A_OK, to add support for testing whether the file is valid
> for append operations.  This is relevant for the check_iflags_access()
> function, but when are later testing operations mask against the inode
> permissions, this new flag gets in the way and causes non-root users
> attempting to create new inodes in a directory to fail.  Fix this by
> masking off A_OK before doing these tests.
> 
> Fixes: 9f69dfc4e275 ("fuse2fs: implement O_APPEND correctly")
> Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>

Looks correct to me,
Reviewed-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>

--D

> ---
>  misc/fuse2fs.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
> index bb75d9421..d209bc790 100644
> --- a/misc/fuse2fs.c
> +++ b/misc/fuse2fs.c
> @@ -687,6 +687,9 @@ static int check_inum_access(struct fuse2fs *ff, ext2_ino_t ino, int mask)
>  		return -EACCES;
>  	}
>  
> +	/* Remove the O_APPEND flag before testing permissions */
> +	mask &= ~A_OK;
> +
>  	/* allow owner, if perms match */
>  	if (inode_uid(inode) == ctxt->uid) {
>  		if ((mask & (perms >> 6)) == mask)
> -- 
> 2.47.2
> 
> 




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux