diff options
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 462d78d55895..f64e97cabe25 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/dcookies.h> | 25 | #include <linux/dcookies.h> |
26 | #include <linux/suspend.h> | 26 | #include <linux/suspend.h> |
27 | #include <linux/tty.h> | 27 | #include <linux/tty.h> |
28 | #include <linux/signal.h> | ||
28 | 29 | ||
29 | #include <linux/compat.h> | 30 | #include <linux/compat.h> |
30 | #include <linux/syscalls.h> | 31 | #include <linux/syscalls.h> |
@@ -227,7 +228,7 @@ static int set_one_prio(struct task_struct *p, int niceval, int error) | |||
227 | error = -EPERM; | 228 | error = -EPERM; |
228 | goto out; | 229 | goto out; |
229 | } | 230 | } |
230 | if (niceval < task_nice(p) && !capable(CAP_SYS_NICE)) { | 231 | if (niceval < task_nice(p) && !can_nice(p, niceval)) { |
231 | error = -EACCES; | 232 | error = -EACCES; |
232 | goto out; | 233 | goto out; |
233 | } | 234 | } |
@@ -525,7 +526,7 @@ asmlinkage long sys_setregid(gid_t rgid, gid_t egid) | |||
525 | if (new_egid != old_egid) | 526 | if (new_egid != old_egid) |
526 | { | 527 | { |
527 | current->mm->dumpable = 0; | 528 | current->mm->dumpable = 0; |
528 | wmb(); | 529 | smp_wmb(); |
529 | } | 530 | } |
530 | if (rgid != (gid_t) -1 || | 531 | if (rgid != (gid_t) -1 || |
531 | (egid != (gid_t) -1 && egid != old_rgid)) | 532 | (egid != (gid_t) -1 && egid != old_rgid)) |
@@ -556,7 +557,7 @@ asmlinkage long sys_setgid(gid_t gid) | |||
556 | if(old_egid != gid) | 557 | if(old_egid != gid) |
557 | { | 558 | { |
558 | current->mm->dumpable=0; | 559 | current->mm->dumpable=0; |
559 | wmb(); | 560 | smp_wmb(); |
560 | } | 561 | } |
561 | current->gid = current->egid = current->sgid = current->fsgid = gid; | 562 | current->gid = current->egid = current->sgid = current->fsgid = gid; |
562 | } | 563 | } |
@@ -565,7 +566,7 @@ asmlinkage long sys_setgid(gid_t gid) | |||
565 | if(old_egid != gid) | 566 | if(old_egid != gid) |
566 | { | 567 | { |
567 | current->mm->dumpable=0; | 568 | current->mm->dumpable=0; |
568 | wmb(); | 569 | smp_wmb(); |
569 | } | 570 | } |
570 | current->egid = current->fsgid = gid; | 571 | current->egid = current->fsgid = gid; |
571 | } | 572 | } |
@@ -596,7 +597,7 @@ static int set_user(uid_t new_ruid, int dumpclear) | |||
596 | if(dumpclear) | 597 | if(dumpclear) |
597 | { | 598 | { |
598 | current->mm->dumpable = 0; | 599 | current->mm->dumpable = 0; |
599 | wmb(); | 600 | smp_wmb(); |
600 | } | 601 | } |
601 | current->uid = new_ruid; | 602 | current->uid = new_ruid; |
602 | return 0; | 603 | return 0; |
@@ -653,7 +654,7 @@ asmlinkage long sys_setreuid(uid_t ruid, uid_t euid) | |||
653 | if (new_euid != old_euid) | 654 | if (new_euid != old_euid) |
654 | { | 655 | { |
655 | current->mm->dumpable=0; | 656 | current->mm->dumpable=0; |
656 | wmb(); | 657 | smp_wmb(); |
657 | } | 658 | } |
658 | current->fsuid = current->euid = new_euid; | 659 | current->fsuid = current->euid = new_euid; |
659 | if (ruid != (uid_t) -1 || | 660 | if (ruid != (uid_t) -1 || |
@@ -703,7 +704,7 @@ asmlinkage long sys_setuid(uid_t uid) | |||
703 | if (old_euid != uid) | 704 | if (old_euid != uid) |
704 | { | 705 | { |
705 | current->mm->dumpable = 0; | 706 | current->mm->dumpable = 0; |
706 | wmb(); | 707 | smp_wmb(); |
707 | } | 708 | } |
708 | current->fsuid = current->euid = uid; | 709 | current->fsuid = current->euid = uid; |
709 | current->suid = new_suid; | 710 | current->suid = new_suid; |
@@ -748,7 +749,7 @@ asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) | |||
748 | if (euid != current->euid) | 749 | if (euid != current->euid) |
749 | { | 750 | { |
750 | current->mm->dumpable = 0; | 751 | current->mm->dumpable = 0; |
751 | wmb(); | 752 | smp_wmb(); |
752 | } | 753 | } |
753 | current->euid = euid; | 754 | current->euid = euid; |
754 | } | 755 | } |
@@ -798,7 +799,7 @@ asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) | |||
798 | if (egid != current->egid) | 799 | if (egid != current->egid) |
799 | { | 800 | { |
800 | current->mm->dumpable = 0; | 801 | current->mm->dumpable = 0; |
801 | wmb(); | 802 | smp_wmb(); |
802 | } | 803 | } |
803 | current->egid = egid; | 804 | current->egid = egid; |
804 | } | 805 | } |
@@ -845,7 +846,7 @@ asmlinkage long sys_setfsuid(uid_t uid) | |||
845 | if (uid != old_fsuid) | 846 | if (uid != old_fsuid) |
846 | { | 847 | { |
847 | current->mm->dumpable = 0; | 848 | current->mm->dumpable = 0; |
848 | wmb(); | 849 | smp_wmb(); |
849 | } | 850 | } |
850 | current->fsuid = uid; | 851 | current->fsuid = uid; |
851 | } | 852 | } |
@@ -875,7 +876,7 @@ asmlinkage long sys_setfsgid(gid_t gid) | |||
875 | if (gid != old_fsgid) | 876 | if (gid != old_fsgid) |
876 | { | 877 | { |
877 | current->mm->dumpable = 0; | 878 | current->mm->dumpable = 0; |
878 | wmb(); | 879 | smp_wmb(); |
879 | } | 880 | } |
880 | current->fsgid = gid; | 881 | current->fsgid = gid; |
881 | key_fsgid_changed(current); | 882 | key_fsgid_changed(current); |
@@ -1637,7 +1638,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, | |||
1637 | switch (option) { | 1638 | switch (option) { |
1638 | case PR_SET_PDEATHSIG: | 1639 | case PR_SET_PDEATHSIG: |
1639 | sig = arg2; | 1640 | sig = arg2; |
1640 | if (sig < 0 || sig > _NSIG) { | 1641 | if (!valid_signal(sig)) { |
1641 | error = -EINVAL; | 1642 | error = -EINVAL; |
1642 | break; | 1643 | break; |
1643 | } | 1644 | } |