Home
last modified time | relevance | path

Searched hist:"242631 c49d4cf39642741d6627750151b058233b" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/security/selinux/
H A Dhooks.cdiff 0b24dcb7f2f7a0ce9b762eef0362c21c88f47b32 Fri Feb 25 14:39:20 CST 2011 Eric Paris <eparis@redhat.com> Revert "selinux: simplify ioctl checking"

This reverts commit 242631c49d4cf39642741d6627750151b058233b.

Conflicts:

security/selinux/hooks.c

SELinux used to recognize certain individual ioctls and check
permissions based on the knowledge of the individual ioctl. In commit
242631c49d4cf396 the SELinux code stopped trying to understand
individual ioctls and to instead looked at the ioctl access bits to
determine in we should check read or write for that operation. This
same suggestion was made to SMACK (and I believe copied into TOMOYO).
But this suggestion is total rubbish. The ioctl access bits are
actually the access requirements for the structure being passed into the
ioctl, and are completely unrelated to the operation of the ioctl or the
object the ioctl is being performed upon.

Take FS_IOC_FIEMAP as an example. FS_IOC_FIEMAP is defined as:

FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)

So it has access bits R and W. What this really means is that the
kernel is going to both read and write to the struct fiemap. It has
nothing at all to do with the operations that this ioctl might perform
on the file itself!

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
diff 242631c49d4cf39642741d6627750151b058233b Thu Jun 05 08:21:28 CDT 2008 Stephen Smalley <sds@tycho.nsa.gov> selinux: simplify ioctl checking

Simplify and improve the robustness of the SELinux ioctl checking by
using the "access mode" bits of the ioctl command to determine the
permission check rather than dealing with individual command values.
This removes any knowledge of specific ioctl commands from SELinux
and follows the same guidance we gave to Smack earlier.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>