Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: "Hobin Woo" <hobin.woo@samsung.com>
To: "'Tom Talpey'" <tom@talpey.com>,
	"'Ralph Boehme'" <slow@samba.org>,
	"'Namjae Jeon'" <linkinjeon@kernel.org>
Cc: <linux-cifs@vger.kernel.org>, <sfrench@samba.org>,
	<senozhatsky@chromium.org>, <sj1557.seo@samsung.com>,
	<yoonho.shin@samsung.com>, <kiras.lee@samsung.com>
Subject: RE: [PATCH v2] ksmb: discard write access to the directory open
Date: Mon, 8 Jul 2024 21:31:09 +0900	[thread overview]
Message-ID: <02ad01dad132$b62837f0$2278a7d0$@samsung.com> (raw)
In-Reply-To: <e39d83a4-4f8c-41c6-98e5-089a51a2e833@talpey.com>

> On 7/5/2024 9:16 AM, Ralph Boehme wrote:
> > On 7/5/24 2:33 PM, Namjae Jeon wrote:
> >> 2024년 7월 5일 (금) 오후 8:54, Ralph Boehme <slow@samba.org>님이 작성:
> >>>
> >>> On 7/5/24 5:27 AM, Hobin Woo wrote:
> >>>> may_open() does not allow a directory to be opened with the write
> >>>> access.
> >>>> However, some writing flags set by client result in adding write
> access
> >>>> on server, making ksmbd incompatible with FUSE file system. Simply,
> >>>> let's
> >>>> discard the write access when opening a directory.
> >>>
> >>> afair this should cause a failure like EACCESS or EISDIR and just be
> >>> ignored. What does a Windows server return in this case, or Samba for
> >>> that matter as it (hopefully) will behave like Windows.
> >>  From what I've checked the packet dump, Samba doesn't return any
> >> errors in the same case.
> >> Samba seems to open it with O_RDONLY if it is directory, So there is
> >> no problem, is it right?
> >
> > Hm, it seems my memory is playing tricks on me. Samba indeed forces
> > O_RDONLY for directories in the servers and ignores the client
> requested
> > access mask. Interestingly we don't seem to have any test for this case,
> > at least I couldn't find any with a quick search. Quickly putting
> > together a torture test shows Windows behaves the same. MS-FSA doesn't
> > mention any such check should be done for directories as well. Getinfo
> > on such a handle even returns the original unmodified client access
> > mask, including the write access.
Right. That is why I fixed ksmd not FUSE.
> >
> > Sorry for the noise! :)
> >
> > -slow
> 
> I would ask to see that the SMB3 protocol test suite results are not
> impacted by this change, and ideally the various Linux/XFS tests as
> well. I don't see any indication these were run?
> 
> The other thing I want to point out is that the crash reported in the
> commit message is a FUSE failure. Why is that not a bug, and why does
> the message not justify why the "fix" is in ksmbd?
As you pointed out, if FUSE had additional checks for this, then the issue
wouldn't have occurred in the first place. However, I believe it is not the
fundamental fix since FUSE operates correctly under the sanity checks of VFS. 

Widely used file systems may perform such checks by themselves or might not 
have the functionality related to this. But if any new functionality
relevant to this were added, we can expect similar problems to happen.

Hobin
> 
> Tom.



      reply	other threads:[~2024-07-08 12:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240705032731epcas1p177d910a154ded37c459af1c2374a3571@epcas1p1.samsung.com>
2024-07-05  3:27 ` [PATCH v2] ksmb: discard write access to the directory open Hobin Woo
2024-07-05 11:39   ` Namjae Jeon
2024-07-05 14:57     ` Steve French
2024-07-05 11:53   ` Ralph Boehme
2024-07-05 12:33     ` Namjae Jeon
2024-07-05 13:16       ` Ralph Boehme
2024-07-05 13:51         ` Tom Talpey
2024-07-08 12:31           ` Hobin Woo [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='02ad01dad132$b62837f0$2278a7d0$@samsung.com' \
    --to=hobin.woo@samsung.com \
    --cc=kiras.lee@samsung.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=sfrench@samba.org \
    --cc=sj1557.seo@samsung.com \
    --cc=slow@samba.org \
    --cc=tom@talpey.com \
    --cc=yoonho.shin@samsung.com \
    /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