linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Chakra Divi <chakragithub@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fuse:send filep uid as part of fuse write req
Date: Thu, 12 Sep 2019 09:32:00 +0200	[thread overview]
Message-ID: <CAJfpeguLbiJt0L5cZjZTkXcGMHHviSdQV=yEei6FgRi23DBTMQ@mail.gmail.com> (raw)
In-Reply-To: <CAH7=fot46GSdanJg9P2rRKrxWnpZq7+vW2CVhtZvGzKTzk__nA@mail.gmail.com>

On Thu, Sep 12, 2019 at 6:59 AM Chakra Divi <chakragithub@gmail.com> wrote:
>
> Hi Miklos,
>
> On Wed, Sep 11, 2019 at 5:05 PM Miklos Szeredi <miklos@szeredi.hu> wrote:
>>
>> On Wed, Sep 11, 2019 at 12:15 PM Chakra Divi <chakragithub@gmail.com> wrote:
>> >
>> > In current code in fuse write request current_fsuid is sent,
>> > however this creates an issue in sudo execution context.
>> > Changes to consider uid and gid from file struture pointer
>> > that is created as part of open file instead of current_fsuid,gid
>> >
>> > Steps to reproduce the issue:
>> > 1) create user1 and user2
>> > 2) create a file1 with user1 on fusemount
>> > 3) change the file1 permissions to 600
>> > 4) execute the following command
>> > user1@linux# sudo -u user2 whoami >> /fusemnt/file1
>> > Here write fails with permission denied error
>>
>> Not sure what's the issue here.  If filesystem wants to check open
>> creds, it should do so with the creds sent at open.
>>
>> Does that solve your problem?
>>
>
> Are you saying that our filesystem should store the credentials in open call,  ignore the credentials in write request and use open credentials instead

Yes.  And even that would be dubious in case of mmap-ed writes or with
FUSE_WRITEBACK_CACHE because the information about which open file
instance received the modification is lost.

So generally credential checking on writeback is useless.  Not sure
what NFS does, because there's no way to get around those rules.

Thanks,
Miklos

      parent reply	other threads:[~2019-09-12  7:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11 10:15 [PATCH] fuse:send filep uid as part of fuse write req Chakra Divi
2019-09-11 11:35 ` Miklos Szeredi
     [not found]   ` <CAH7=fot46GSdanJg9P2rRKrxWnpZq7+vW2CVhtZvGzKTzk__nA@mail.gmail.com>
2019-09-12  7:32     ` Miklos Szeredi [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='CAJfpeguLbiJt0L5cZjZTkXcGMHHviSdQV=yEei6FgRi23DBTMQ@mail.gmail.com' \
    --to=miklos@szeredi.hu \
    --cc=chakragithub@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).