Re: [NFS] [PATCH 2/7] NFS: if ATTR_KILL_S*ID bits are set, then skip mode change



On Fri, 14 Sep 2007 20:25:45 +1000
Greg Banks <gnb@xxxxxxx> wrote:

On Tue, Sep 04, 2007 at 10:37:04AM -0400, Jeff Layton wrote:
If the ATTR_KILL_S*ID bits are set then any mode change is only for
clearing the setuid/setgid bits. For NFS skip the mode change and
let the server handle it.

You're assuming the server will remove setuid and setgid bits on WRITE?
I don't see that behaviour specified in the RFC, at least for v3.
The RFC specifies a behaviour for the mtime attribute as a side
effect of WRITE, but says nothing about mode. This means server
implementations are free to clobber setuid or not. A quick experiment
shows that at least the Irix server will *NOT* clobber those bits.
So with an Irix server you've now lost this Linux-specific "security
feature".

I'm curious about the reasons behind this change. You mention
credential issues; how exactly is it that you have the correct creds
to perform a WRITE rpc but not a SETATTR rpc?


Consider this case. user1 and user2 are both members of group
"allusers":

user1$ echo foo > foo
user1$ chgrp allusers foo
user1$ chmod 04770 foo
user2$ echo bar >> foo

On most local filesystems, this would work correctly. The end result
would be a file with mode 0770 and the expected contents. On NFS
though, the write by user2 fails. When the write is attempted, the
kernel tries to squash the setuid bit using the credentials of user2,
who's not allowed to change the mode. The write then fails because the
setattr fails.

There are other situations that are similar, but the bottom line is
that the linux-specific security feature doesn't work in all cases, and
in some situations it means that operations fail where they shouldn't.

--
Jeff Layton <jlayton@xxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • RE: Faulting application ntbackup.exe version 5.2.3790.70
    ... if I start the job manually it fails after a very shoort time. ... Also note the server which is running the ntbackup.exe program is ... Below is the error in the event log, also the data that fails to backup is ... > Hi Aaron, ...
    (microsoft.public.windows.server.sbs)
  • Re: dcpromo failed
    ... You can tell this is the problem if other RPC operations ... I disjoined the server from the domain. ... MVP - Directory Services ... This is the only domain controller that fails. ...
    (microsoft.public.windows.server.active_directory)
  • Re: [opensuse] Thunderbird password nuisance.
    ... time the smtp session timed out in the server and fails. ... Easily fixed by correctly configuring your smtp settings in Account ... It knows you need it because the smtp server requires it, ...
    (SuSE)
  • hyperlinks and file monikers... please help!
    ... I have an MDI doc server that knows about .foo files. ... opens a foo file, it creates a file moniker for that foo file on disk and ... I'm thinking somehow it needs to get a moniker for the ...
    (microsoft.public.win32.programmer.ole)
  • Re: Mulberry gone, now what?
    ... ANNOTATEMORE also suffers from somewhat strange syntax. ... client must either ask the server to rethread the entire mailbox, or else fetch much of the data required anyway. ... It isn't like server side sorting, where it's just a question of inserting in the right place; that would be easy to do, but the problem is that most users prefer to thread instead of sort. ... will create a name foo such that foo can be accessed as a mailbox. ...
    (comp.mail.imap)