Re: SELinux/SMACK/TOMOYO: ioctl permissions handling is wrong andnonsensicle

From: Tetsuo Handa
Date: Fri Jan 21 2011 - 21:01:27 EST


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.
--
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/