aboutsummaryrefslogtreecommitdiffstats
path: root/security/device_cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/device_cgroup.c')
-rw-r--r--security/device_cgroup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index 5ba78701adc3..3aacd0fe7179 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -513,11 +513,14 @@ int devcgroup_inode_mknod(int mode, dev_t dev)
513 struct dev_cgroup *dev_cgroup; 513 struct dev_cgroup *dev_cgroup;
514 struct dev_whitelist_item *wh; 514 struct dev_whitelist_item *wh;
515 515
516 if (!S_ISBLK(mode) && !S_ISCHR(mode))
517 return 0;
518
516 rcu_read_lock(); 519 rcu_read_lock();
517 520
518 dev_cgroup = task_devcgroup(current); 521 dev_cgroup = task_devcgroup(current);
519 522
520 list_for_each_entry(wh, &dev_cgroup->whitelist, list) { 523 list_for_each_entry_rcu(wh, &dev_cgroup->whitelist, list) {
521 if (wh->type & DEV_ALL) 524 if (wh->type & DEV_ALL)
522 goto acc_check; 525 goto acc_check;
523 if ((wh->type & DEV_BLOCK) && !S_ISBLK(mode)) 526 if ((wh->type & DEV_BLOCK) && !S_ISBLK(mode))