Commit ec229e83 authored by Li Zefan's avatar Li Zefan Committed by Linus Torvalds
Browse files

devcgroup: fix permission check when adding entry to child cgroup

 # 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: default avatarLi Zefan <>
Acked-by: default avatarSerge Hallyn <>
Cc: Serge Hallyn <>
Cc: Paul Menage <>
Cc: Pavel Emelyanov <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 17d213f8
......@@ -300,7 +300,7 @@ static int may_access_whitelist(struct dev_cgroup *c,
if (whitem->minor != ~0 && whitem->minor != refwh->minor)
if (refwh->access & (~(whitem->access | ACC_MASK)))
if (refwh->access & (~whitem->access))
return 1;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment