Re: SELinux/SMACK/TOMOYO: ioctl permissions handling is wrongandnonsensicle

From: Eric Paris
Date: Fri Jan 21 2011 - 21:16:06 EST


On Sat, 2011-01-22 at 11:01 +0900, Tetsuo Handa wrote:
> Eric Paris wrote:
> > I'm planning to revert this SELinux commit, but I want other LSM authors
> > to realize that (assuming I'm not completely off in the woods somewhere)
> > you should take a look at your ioctl permissions checking as well....
>
> Since the mapping of ioctl cmd number and what the kernel does with that number
> is unknown for LSM modules, TOMOYO does not use permission bits.
> TOMOYO simply checks ioctl cmd number value passed to ioctl() requests.
> For example,
>
> file ioctl /dev/tty0 0x4B4E
> file ioctl /dev/console 0x5402
> file ioctl /dev/snd/controlC0 0x80045500
> file ioctl socket:[family=2:type=1:protocol=6] 0x8942
> file ioctl socket:[family=2:type=2:protocol=17] 0x8913
>
> http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/centos5.5/domain_policy.conf?v=policy-sample
>
> So, I think nothing to change for TOMOYO.

You are correct, I thought I saw you guys doing something similar, but
that is clearly not the case. It's just SELinux and SMACK that are
doing it wrong.

-Eric


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/