From: Martin Pool <mbp@sourcefrog.net>
To: trond.myklebust@fys.uio.no, linux-kernel@vger.kernel.org
Subject: NFS sillyrename possibly leaves setuid files behind
Date: Mon, 22 Jul 2002 14:32:27 +1000 [thread overview]
Message-ID: <20020722043226.GB5732@samba.org> (raw)
I realize what follows is only arguably a bug, but please bear with
me.
Dan Stromberg originally raised this issue on the rsync mailing list,
but it seemed to be more of an NFS issue than an rsync one.
Basically, his situation is that he's was using rsync to update
software on a machine whose filesystem is NFS-mounted. Some of those
updates might be security fixes, and in particular installation of new
versions of setuid/setgid programs, or deletion of setuid programs.
If any of the files being replaced/removed are in use at the time, the
client will create a .nfs* sillyrename file on the server. I think
this will happen regardless of what tool is used for the update:
rsync, "make install", dpkg, rpm, ...
The problem from the administrator's point of view is that the old
vulnerable program is still accessible under the .nfs* name, at least
while the text is still in use. If the client's abruptly
disconnected, then the sillyrename file could persist indefinitely, so
possibly somebody could exploit the security problem hours or days
after the administrator thought they'd updated the program.
I'm not sure what fix, if any, would be appropriate.
One possibility would be for nfs_sillyrename to mask off the
setuid/setgid bits both locally and remotely if it moves the file, by
doing a SETATTR as well as RENAME. That would fix this particular
problem, but at the cost of confusing anyone who does an fstat() on
the open file, etc. You might well think it's too kludgy too.
I advised Dan to run rsync directly to the server, which works for
him, but will not work for some people because they're using e.g.
NetApp (which doesn't run rsync), or something non-Linux (so they
can't run dpkg, etc).
rsync could remove the setuid bits before replacing the file, but
that's only fixes this one tool, is perhaps even more kludgy, and
leaves a window where the program being updated is just broken.
(e.g. non-setuid passwd.)
You might also argue that the administrator should just make sure the
file is not in use; or that they should sweep for .nfs files straight
afterwards.
On the whole I think nfs_sillyrename should mask it, but I'd
completely understand if people disagreed.
--
Martin
(please cc me on replies)
reply other threads:[~2002-07-22 4:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20020722043226.GB5732@samba.org \
--to=mbp@sourcefrog.net \
--cc=linux-kernel@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
/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
all inboxes | Powered by JetHome®