From: "Javier Juan Martínez Cabezón" <tazok.id0@gmail.com>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] An observation
Date: Tue, 27 Nov 2012 19:29:26 +0100 [thread overview]
Message-ID: <50B50686.4070407@gmail.com> (raw)
In-Reply-To: <D68F6C91D760CA4E9DFBA5AC6FFD249E28970E64@mail1.cs.stonybrook.edu>
On 27/11/12 18:25, Bhushan Jain wrote:
> Hello Developers,
>
> I am a student at Stony Brook University researching system security.
> I noticed that the only reason dmcrypt-get-device (from eject package) needs setuid privilege is to read the major:minor numbers (unless I have missed something).
> A lot of distributions (Ubuntu, Fedora, etc.) are trying to avoid use of the setuid bit because it can potentially introduce a privilege escalation attack vector.
> I think the same thing could be accomplished by exporting the major:minor device numbers through a proc file, and then eliminate the need for dmcrypt-get-device.
> I would be happy to send you a patch that does this, if there is interest. Any comments/thoughts?
>
> Thanks,
> Bhushan Jain
> PhD student,
> Computer Science,
> Stony Brook University
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
This has no sense, I don't see any reason to need a SYS_SETUID privilege
(there is no need of any capability to read major/minor. On devices
usually, are needed CAP_CHOWN/TTY_CONFIG with software that manage ttys
of users logged (as getty and login), CAP_SYS_RAWIO to raw access to
devices (that is read/write in brute mode as with fsck/mkfs,lilo), or
SYS_MKNOD to create devices.
You can check why does it need SYS_SETUID (or do you want mean instead
setuid as "chmod +s"?) making an strace to eject as user without setuid
and check where the final EPERM return appears, probably the reason is
because nobody can mount/umount devices without CAP_SYS_ADMIN.
As suggestion and a bit of offtopic, check rsbac kernel patch ;-)
PD: ubuntu makes use of "sudo su" in a unrestricted way so... who cares.
next prev parent reply other threads:[~2012-11-27 18:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-27 17:25 [dm-crypt] An observation Bhushan Jain
2012-11-27 17:49 ` Milan Broz
2012-11-27 18:29 ` Javier Juan Martínez Cabezón [this message]
2013-07-10 2:10 ` Karl O. Pinc
2013-07-10 3:15 ` Bhushan Jain
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=50B50686.4070407@gmail.com \
--to=tazok.id0@gmail.com \
--cc=dm-crypt@saout.de \
/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