linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Shilovsky <piastry@etersoft.ru>
To: Christoph Hellwig <hch@infradead.org>
Cc: <linux-cifs@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-fsdevel@vger.kernel.org>, <wine-devel@winehq.org>,
	<linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 0/3] Add O_DENY* flags to fcntl and cifs
Date: Sat, 08 Dec 2012 00:43:14 +0400	[thread overview]
Message-ID: <495d17310e0a687d446afc86def0f058@office.etersoft.ru> (raw)
In-Reply-To: <20121207161602.GA17710@infradead.org>

Christoph Hellwig писал 07.12.2012 20:16:
> On Thu, Dec 06, 2012 at 10:26:28PM +0400, Pavel Shilovsky wrote:
>> Network filesystems CIFS, SMB2.0, SMB3.0 and NFSv4 have such flags - 
>> this change can benefit cifs and nfs modules. While this change is ok 
>> for network filesystems, itsn't not targeted for local filesystems due 
>> security problems (e.g. when a user process can deny root to delete a 
>> file).
>>
>> Share flags are used by Windows applications and WINE have to deal 
>> with them too. While WINE can process open share flags itself on local 
>> filesystems, it can't do it if a file stored on a network share and is 
>> used by several clients. This patchset makes it possible for 
>> CIFS/SMB2.0/SMB3.0.
>
> I don't think introducing user visible flags that are only supported 
> on
> a single network filesystem is a good idea.

It can bring benefits for both CIFS and NFS filesystems - so, at least 
two ones.

>
> I'm not even sure adding these flags does make a lot of sense, but
> assuming we'd actually want this (and I'd like some more detailed
> explanation) I think we'd at least need to make sure that:
>
>  a) opening files with the new modes gives a proper error message if 
> not
>     supported

It makes us add such checks for all other filesystems, if I understand 
right, - not a problem, I think.

>  b) there needs to be local support for them as well
>  c) we need to think really hard when they should be supported, and 
> need
>     a good rational for it.  I can't see how we could do it
>     unconditionally for all users as that would introduce easy denial
>     of services attacks the way I understand the semantics (correct 
> me
>     if I'm wrong).  So a mount option like you currently do probably 
> is
>     the least bad even if don't fell overly happy about that version.
>
> What is the reason your special wine use case can't simply use a
> userspace cifs client?  Given that wine uses windows filesystem
> semantics and cifs does as well tunnelling it through a Posix-like 
> API
> inbetween is never going to be perfect.

Ideally we should not make any difference between underlying 
filesystems in Wine: an application requests an open of the file and we 
issue this open with flags it passed. Since Wineserver can process share 
flags locally itself (for one linux user), we only need to add this 
support for CIFS (that is actively used by Wine applications because of 
it's Windows nature). Bringing these flags for local filesystems can 
benefit Wine too: it will help in cases when Wine applications of 
different users on the same machine use the same file and can make all 
those things easier, of course.

The problem is the possibility of denial-of-service attacks here. We 
can try to prevent them by:
1) specifying an extra security bit on the file that indicates that 
share flags are accepted (like we have for mandatory locks now) and 
setting it for neccessary files only, or
2) adding a special mount option (but it it probably makes sense if we 
decided to add this support for CIFS and NFS only).

--
Best regards,
Pavel Shilovsky.



  reply	other threads:[~2012-12-07 20:52 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-06 18:26 [PATCH 0/3] Add O_DENY* flags to fcntl and cifs Pavel Shilovsky
2012-12-06 18:26 ` [PATCH 1/3] fcntl: Introduce new O_DENY* open flags for network filesystems Pavel Shilovsky
2012-12-06 18:26 ` [PATCH 2/3] CIFS: Add O_DENY* open flags support Pavel Shilovsky
2012-12-06 18:26 ` [PATCH 3/3] CIFS: Use NT_CREATE_ANDX command for forcemand mounts Pavel Shilovsky
2012-12-06 19:49 ` [PATCH 0/3] Add O_DENY* flags to fcntl and cifs Alan Cox
2012-12-06 19:57   ` Jeremy Allison
2012-12-06 20:13     ` Jeremy Allison
2012-12-06 21:31     ` Theodore Ts'o
2012-12-06 21:33       ` Jeremy Allison
2012-12-06 21:37         ` Theodore Ts'o
2012-12-06 21:39           ` Jeremy Allison
2012-12-07 14:29     ` Steve French
2012-12-07 14:30       ` Steve French
2012-12-07 16:34       ` Alan Cox
2012-12-07  9:08 ` Pavel Shilovsky
2012-12-07 14:52   ` J. Bruce Fields
2012-12-07 15:37     ` simo
2012-12-07 16:09       ` J. Bruce Fields
2012-12-07 16:16 ` Christoph Hellwig
2012-12-07 20:43   ` Pavel Shilovsky [this message]
2012-12-07 21:35     ` Alan Cox
2012-12-07 23:55     ` Myklebust, Trond
2012-12-10 16:41     ` J. Bruce Fields
2012-12-11 13:11       ` Jeff Layton
2012-12-12  8:34     ` David Laight
2012-12-14 14:12       ` Pavel Shilovsky
2012-12-14 15:30         ` Alan Cox
2012-12-14 19:19           ` Steve French
2012-12-17 15:36             ` J. Bruce Fields
  -- strict thread matches above, loose matches on Subject: below --
2012-11-30 10:20 Pavel Shilovsky
2012-11-30 11:10 ` Pavel Shilovsky

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=495d17310e0a687d446afc86def0f058@office.etersoft.ru \
    --to=piastry@etersoft.ru \
    --cc=hch@infradead.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=wine-devel@winehq.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).