From: Chad Sellers <csellers@tresys.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux-dev@tresys.com, SELinux@tycho.nsa.gov
Subject: Re: [Fwd: Re: [RFC] SELinux file_ioctl hook permission checks changes]
Date: Fri, 06 Jan 2006 15:43:14 -0500 [thread overview]
Message-ID: <43BED662.5040501@tresys.com> (raw)
In-Reply-To: <1136550231.27632.523.camel@moss-spartans.epoch.ncsc.mil>
Stephen Smalley wrote:
>>>>A patch based upon Chris' comments was developed ([3]). It basically
>>>>performs a check for distinction
>>>>of a read/write ioctl command and constructs an access vector with
>>>>the getattr/setattr permissions.
>>>>Although, this approach has a potential concern. setattr permission
>>>>also covers chown/chmod and other
>>>>cases. This is the desired behavior for certain ioctl commands (ie.
>>>>EXT3_IOC_SETFLAGS) but other
>>>>ones that perform data write (write permission) may not be suitable
>>>>for setattr permission
>>>>(set attributes). One example of conflict is ssh performing an ioctl
>>>>on /dev/ptmx to allocate the
>>>>pty, triggering a setattr denial since it gets _IOC_WRITE back from
>>>>the _IOC_DIR checks in
>>>>selinux_file_ioctl hook.
>>
>>> Right, so if we stay with getattr/setattr as the ioctl permission
>>> checks, then we may need to allow setattr permission more widely
>>> than
>>> presently, which would also permit use of chown/chmod on the file.
>>> sshd
>>> has a legitimate need to write to ptmx; it doesn't need to
>>> chown/chmod
>>> it.
> On Thu, 2006-01-05 at 16:42 -0500, Chad Sellers wrote:
>
>>We would definitely not want to add these permissions to current
>>read/write or setattr/chattr. As stated above, this would result in
>>granting extra privileges that we don't want to see. So, perhaps
>>splitting ioctl into ioctl_read, ioctl_write, ioctl_none, and ioctl_rw
>>would solve this problem.
>
>
> Discussion should really be on the list, where the RFC was originally
> posted. But anyway, what you suggest would be much harder to do in any
> kind of compatible way - we need these permissions to work for all file
> classes and all socket classes (as ioctl can be applied to all file
> types), and we can't easily extend the common definition without
> perturbing the access vectors for the inheriting classes. I'm inclined
> to just map to read/write, as I view setattr as more sensitive.
>
Sorry for accidentally taking this off list. I re-added some context
above to clear up any confusion.
I see your point about the difficulty of my suggestion. I think mapping
ioctl to read/write might be useful, but the repercussions worry me. Not
only will this have the problems previously mentioned (requiring full
write or read for programs with previously limited access), but this
also may mean that both read and write are required for some utilities.
_IOWR is used in many drivers (sometimes legitimately, sometimes not),
which may make full read & write required for programs that only require
small control channels.
Additionally, relying on all driver writers to label the ioctl commands
properly seems precarious. At least with the separate ioctl permission,
we lumped the them all together, separate from the better defined read
and write.
So, despite my desire to map ioctls to directionality, I'm a little
worried about this approach. If we want to go that route, then I think
we at least have to do a good bit of testing to see what additional
policy will be necessary and to ensure that key drivers label their
ioctl directions properly.
Chad
--
----------------------
Chad Sellers
Tresys Technology, LLC
csellers@tresys.com
http://www.tresys.com
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
parent reply other threads:[~2006-01-06 20:43 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1136550231.27632.523.camel@moss-spartans.epoch.ncsc.mil>]
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=43BED662.5040501@tresys.com \
--to=csellers@tresys.com \
--cc=SELinux@tycho.nsa.gov \
--cc=sds@tycho.nsa.gov \
--cc=selinux-dev@tresys.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.