linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fixing setfsuid/setfsgid
@ 2014-01-22 12:40 Florian Weimer
  2014-01-22 13:56 ` Jeff Layton
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2014-01-22 12:40 UTC (permalink / raw)
  To: linux-fsdevel

At present, setfsuid and setfsgid return the same value on success and 
on error, so it is rather difficult to check for errors.  Since the 
userns changes at least, failure can not only be caused by lack of the 
CAP_SETUID capability, but also by an out-of-memory situation.

* Introduce new system calls setfsuid1, fetfsgid1 which have the usual 
"return -errno on failure, 0 on success" semantics.

* Introduce getfsuid, getfsgid, so that applications can check for 
failure by noting that the fs?id did not change.  These system calls 
might have other uses as well.  Emulation in glibc by parsing 
/proc/self/status is possible.

* Don't bother with fs?id at all anymore and attach effective security 
information to descriptors, which are then inherited by the *at 
functions.  This is far more invasive, but would solve the 
multi-threading ambiguity and could be reasonably extended to umask and 
security contexts.  This would need new system calls fsetuid, fsetgid, 
and probably socketat (for bind/connect) and perhaps socketpairat.

Comments?

-- 
Florian Weimer / Red Hat Product Security Team

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-23 11:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-22 12:40 Fixing setfsuid/setfsgid Florian Weimer
2014-01-22 13:56 ` Jeff Layton
2014-01-22 14:06   ` Florian Weimer
2014-01-22 18:21     ` Jim Lieb
2014-01-23 11:28       ` Florian Weimer

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).