[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFeW=pZcqnybTeMQPEMUguAwwgqpM1Hap2Dh3K-5majfYqMTaA@mail.gmail.com>
Date: Sat, 15 Oct 2011 08:39:16 +0800
From: Amos Kong <kongjianjun@...il.com>
To: serue@...ibm.com, viro@...iv.linux.org.uk
Cc: linux-kernel@...r.kernel.org
Subject: cgroup: denying device doesn't work with 'rw' mode string
# mount -t cgroup -o devices none /cgroup
# mkdir /cgroups/devices
# ls -l /dev/vg/lv
lrwxrwxrwx. 1 root root 7 Oct 14 19:03 /dev/vg/lv -> ../dm-3
# ls -l /dev/dm-3
brw-rw----. 1 root disk 253, 3 Oct 14 19:03 /dev/dm-3
------- test1
# echo a > devices/devices.allow
# echo 'b 253:3 rwm' > devices/devices.deny
^^^
# echo $$ > task
# dd if=/dev/zero of=/dev/dm-3 bs=1M count=1
couldn't write to /dev/dm-3 successfully
------- test2
deny read-write permission of dm-3, but it doesn't effect.
# echo a > devices/devices.allow
# echo 'b 253:2 rw' > devices.deny
^^
# echo $$ > task
# dd if=/dev/zero of=/dev/dm-3 bs=1M count=1
can write to /dev/dm-3 successfully ???
-----------
related upstream commit:
commit 08ce5f16ee466ffc5bf243800deeecd77d9eaf50
Author: Serge E. Hallyn <serue@...ibm.com>
Date: Tue Apr 29 01:00:10 2008 -0700
cgroups: implement device whitelist
cgroup tracks and enforces open and mknod restrictions on device files,
so 'm' are always needed in the mode string? 'rw' is uneffective?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists