diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-09-04 07:02:35 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-09-04 07:02:35 -0400 |
| commit | 42390cdec5f6e6e2ee54f308474a6ef7dd16aa5c (patch) | |
| tree | e9684c84f53272319a5acd4b9c86503f30274a51 /security/device_cgroup.c | |
| parent | 11c231a962c740b3216eb6565149ae5a7944cba7 (diff) | |
| parent | d210baf53b699fc61aa891c177b71d7082d3b957 (diff) | |
Merge branch 'linus' into x86/x2apic
Conflicts:
arch/x86/kernel/cpu/cyrix.c
include/asm-x86/cpufeature.h
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'security/device_cgroup.c')
| -rw-r--r-- | security/device_cgroup.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 7bd296cca041..46f23971f7e4 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
| @@ -508,12 +508,11 @@ int devcgroup_inode_permission(struct inode *inode, int mask) | |||
| 508 | return 0; | 508 | return 0; |
| 509 | if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode)) | 509 | if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode)) |
| 510 | return 0; | 510 | return 0; |
| 511 | dev_cgroup = css_to_devcgroup(task_subsys_state(current, | ||
| 512 | devices_subsys_id)); | ||
| 513 | if (!dev_cgroup) | ||
| 514 | return 0; | ||
| 515 | 511 | ||
| 516 | rcu_read_lock(); | 512 | rcu_read_lock(); |
| 513 | |||
| 514 | dev_cgroup = task_devcgroup(current); | ||
| 515 | |||
| 517 | list_for_each_entry_rcu(wh, &dev_cgroup->whitelist, list) { | 516 | list_for_each_entry_rcu(wh, &dev_cgroup->whitelist, list) { |
| 518 | if (wh->type & DEV_ALL) | 517 | if (wh->type & DEV_ALL) |
| 519 | goto acc_check; | 518 | goto acc_check; |
| @@ -533,6 +532,7 @@ acc_check: | |||
| 533 | rcu_read_unlock(); | 532 | rcu_read_unlock(); |
| 534 | return 0; | 533 | return 0; |
| 535 | } | 534 | } |
| 535 | |||
| 536 | rcu_read_unlock(); | 536 | rcu_read_unlock(); |
| 537 | 537 | ||
| 538 | return -EPERM; | 538 | return -EPERM; |
| @@ -543,12 +543,10 @@ int devcgroup_inode_mknod(int mode, dev_t dev) | |||
| 543 | struct dev_cgroup *dev_cgroup; | 543 | struct dev_cgroup *dev_cgroup; |
| 544 | struct dev_whitelist_item *wh; | 544 | struct dev_whitelist_item *wh; |
| 545 | 545 | ||
| 546 | dev_cgroup = css_to_devcgroup(task_subsys_state(current, | ||
| 547 | devices_subsys_id)); | ||
| 548 | if (!dev_cgroup) | ||
| 549 | return 0; | ||
| 550 | |||
| 551 | rcu_read_lock(); | 546 | rcu_read_lock(); |
| 547 | |||
| 548 | dev_cgroup = task_devcgroup(current); | ||
| 549 | |||
| 552 | list_for_each_entry(wh, &dev_cgroup->whitelist, list) { | 550 | list_for_each_entry(wh, &dev_cgroup->whitelist, list) { |
| 553 | if (wh->type & DEV_ALL) | 551 | if (wh->type & DEV_ALL) |
| 554 | goto acc_check; | 552 | goto acc_check; |
| @@ -566,6 +564,8 @@ acc_check: | |||
| 566 | rcu_read_unlock(); | 564 | rcu_read_unlock(); |
| 567 | return 0; | 565 | return 0; |
| 568 | } | 566 | } |
| 567 | |||
| 569 | rcu_read_unlock(); | 568 | rcu_read_unlock(); |
| 569 | |||
| 570 | return -EPERM; | 570 | return -EPERM; |
| 571 | } | 571 | } |
