Skip to content

Commit ec229e8

Browse files
Li Zefantorvalds
authored andcommitted
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: Li Zefan <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Serge Hallyn <[email protected]> Cc: Paul Menage <[email protected]> Cc: Pavel Emelyanov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 17d213f commit ec229e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/device_cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static int may_access_whitelist(struct dev_cgroup *c,
300300
continue;
301301
if (whitem->minor != ~0 && whitem->minor != refwh->minor)
302302
continue;
303-
if (refwh->access & (~(whitem->access | ACC_MASK)))
303+
if (refwh->access & (~whitem->access))
304304
continue;
305305
return 1;
306306
}

0 commit comments

Comments
 (0)