All of lore.kernel.org
 help / color / mirror / Atom feed
* cgroup: denying device doesn't work with 'rw' mode string
@ 2011-10-15  0:39 Amos Kong
  2012-05-18  3:37 ` Amos Kong
  0 siblings, 1 reply; 25+ messages in thread
From: Amos Kong @ 2011-10-15  0:39 UTC (permalink / raw)
  To: serue, viro; +Cc: linux-kernel

# 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@us.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?

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-05-22 12:48 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-15  0:39 cgroup: denying device doesn't work with 'rw' mode string Amos Kong
2012-05-18  3:37 ` Amos Kong
2012-05-18  3:52   ` Li Zefan
2012-05-18  4:31     ` Amos Kong
2012-05-18  7:46       ` Amos Kong
     [not found]         ` <CAFeW=pZ8Y7ycxjxro7zBMqdtaCOYs4RmoxtDrsN8+mqLhOL--g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-18  8:19           ` [PATCH] cgroup: fix device deny of DEV_ALL Amos Kong
2012-05-18  8:19             ` Amos Kong
2012-05-21 14:03             ` Serge Hallyn
2012-05-21 14:03               ` Serge Hallyn
2012-05-22  0:34               ` Li Zefan
2012-05-22  0:34                 ` Li Zefan
     [not found]                 ` <4FBADF1A.6040303-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-05-22  1:54                   ` Serge E. Hallyn
2012-05-22  1:54                     ` Serge E. Hallyn
     [not found]                     ` <20120522015426.GA10344-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2012-05-22  2:08                       ` Serge E. Hallyn
2012-05-22  2:08                       ` Serge E. Hallyn
2012-05-22  2:08                         ` Serge E. Hallyn
     [not found]                         ` <20120522020857.GA10499-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2012-05-22  2:23                           ` Amos Kong
2012-05-22  2:23                           ` Amos Kong
2012-05-22  2:23                             ` Amos Kong
2012-05-22  2:14                       ` Amos Kong
2012-05-22  2:14                       ` Amos Kong
2012-05-22  2:14                         ` Amos Kong
     [not found]                         ` <4FBAF680.90007-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-22 12:48                           ` Serge Hallyn
2012-05-22 12:48                             ` Serge Hallyn
2012-05-21 14:03             ` Serge Hallyn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.