util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca>
Cc: util-linux@vger.kernel.org
Subject: Re: Utilities don't take into account capabilities
Date: Mon, 18 Aug 2014 08:05:29 -0400	[thread overview]
Message-ID: <3715739.62j44Bg1Aj@vapier> (raw)
In-Reply-To: <fbcec6cf5352.53efd3e4@langara.bc.ca>

[-- Attachment #1: Type: text/plain, Size: 1560 bytes --]

On Sat 16 Aug 2014 21:57:56 Steven Stewart-Gallus wrote:
> The utilities such as mount don't take into account capabilities and always
> fail for non root users which is wrong.
> 
> This is really, really, really annoying when working in a sandboxed non root
> shell with pseudo capabilities.
> 
> One possible solution to my problem is do some complicated checking for
> capabilities that I don't even know how would work. I believe a better and
> simpler approach that would work for possible future extensions as well
> would be to simply drop privileges whenever one is unprivileged and attempt
> to do the task as normally. If you felt like it, a warning along the lines
> of "warning: user is unprivileged, attempting mount without privileges"
> could be made. As a bonus, failed system calls can sometimes leave
> important diagnostic information in the dmesg.

guessing the sandbox isn't really meant for security purposes since 
CAP_SYS_ADMIN can easily be used to recover just about every other capability.
	http://lwn.net/Articles/486306/

especially considering access to mount means you're allowed to mount arbitrary 
filesystems w/arbitrary content including set*id progs.

so what exactly is the point of trying to support CAP_SYS_ADMIN ?

note: i'm not arguing about whether the current UID checks in `mount` are even 
useful ... it'd make the code simpler to just assume the privs exist, else 
it'll get errors from the respective syscalls and the user of a misconfigured 
system can deal with it themselves.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2014-08-18 12:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-16 21:57 Utilities don't take into account capabilities Steven Stewart-Gallus
2014-08-17 20:54 ` Linda Walsh
2014-08-18  0:57   ` Steven Stewart-Gallus
2014-08-18  1:23     ` Linda Walsh
2014-08-18 14:47       ` Dale R. Worley
2014-08-18 19:19         ` Linda Walsh
2014-08-18 21:57           ` Dale R. Worley
2014-08-18 12:05 ` Mike Frysinger [this message]
2014-08-18 17:40   ` Steven Stewart-Gallus
2014-08-19  9:07     ` Karel Zak
2014-08-19 21:54       ` Steven Stewart-Gallus
2014-08-22  0:38       ` Linda Walsh

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=3715739.62j44Bg1Aj@vapier \
    --to=vapier@gentoo.org \
    --cc=sstewartgallus00@mylangara.bc.ca \
    --cc=util-linux@vger.kernel.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).