devscgroup: check for device permissions at mount time
authorPavel Emelyanov <xemul@openvz.org>
Fri, 6 Jun 2008 05:46:27 +0000 (22:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jun 2008 18:29:11 +0000 (11:29 -0700)
commit7db9cfd380205f6b50afdc3bc3619f876a5eaf0d
tree270b0212f0501b2dcf927e92e7374aba79c909df
parentcc9cb219aac24ffc711566c8f372c2b3a3bf840f
devscgroup: check for device permissions at mount time

Currently even if a task sits in an all-denied cgroup it can still mount
any block device in any mode it wants.

Put a proper check in do_open for block device to prevent this.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Tested-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/block_dev.c