Skip to content

Commit

Permalink
devcgroup: fix permission check when adding entry to child cgroup
Browse files Browse the repository at this point in the history
 # cat devices.list
 c 1:3 r
 # echo 'c 1:3 w' > sub/devices.allow
 # cat sub/devices.list
 c 1:3 w

As illustrated, the parent group has no write permission to /dev/null, so
it's child should not be allowed to add this write permission.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: Paul Menage <menage@google.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Li Zefan authored and torvalds committed Jul 13, 2008
1 parent 17d213f commit ec229e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/device_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static int may_access_whitelist(struct dev_cgroup *c,
continue;
if (whitem->minor != ~0 && whitem->minor != refwh->minor)
continue;
if (refwh->access & (~(whitem->access | ACC_MASK)))
if (refwh->access & (~whitem->access))
continue;
return 1;
}
Expand Down

0 comments on commit ec229e8

Please sign in to comment.