All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 1/2] fuse2fs: fix normal (non-kernel) permissions checking
Date: Wed, 2 Jul 2025 08:15:33 -0700	[thread overview]
Message-ID: <20250702151533.GJ9987@frogsfrogsfrogs> (raw)
In-Reply-To: <20250702035044.47373-1-tytso@mit.edu>

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@mit.edu>

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

--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
> 
> 

      parent reply	other threads:[~2025-07-02 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-02  3:50 [PATCH 1/2] fuse2fs: fix normal (non-kernel) permissions checking Theodore Ts'o
2025-07-02  3:50 ` [PATCH 2/2] fuse2fs.1: fix formatting of newly added options in the man page Theodore Ts'o
2025-07-02 15:19   ` Darrick J. Wong
2025-07-02 15:15 ` Darrick J. Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250702151533.GJ9987@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.