diff options
Diffstat (limited to 'kernel/sys.c')
| -rw-r--r-- | kernel/sys.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 2fa1ed18123c..c43b3e22bbda 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/suspend.h> | 28 | #include <linux/suspend.h> |
| 29 | #include <linux/tty.h> | 29 | #include <linux/tty.h> |
| 30 | #include <linux/signal.h> | 30 | #include <linux/signal.h> |
| 31 | #include <linux/cn_proc.h> | ||
| 31 | 32 | ||
| 32 | #include <linux/compat.h> | 33 | #include <linux/compat.h> |
| 33 | #include <linux/syscalls.h> | 34 | #include <linux/syscalls.h> |
| @@ -375,18 +376,21 @@ void emergency_restart(void) | |||
| 375 | } | 376 | } |
| 376 | EXPORT_SYMBOL_GPL(emergency_restart); | 377 | EXPORT_SYMBOL_GPL(emergency_restart); |
| 377 | 378 | ||
| 378 | /** | ||
| 379 | * kernel_restart - reboot the system | ||
| 380 | * | ||
| 381 | * Shutdown everything and perform a clean reboot. | ||
| 382 | * This is not safe to call in interrupt context. | ||
| 383 | */ | ||
| 384 | void kernel_restart_prepare(char *cmd) | 379 | void kernel_restart_prepare(char *cmd) |
| 385 | { | 380 | { |
| 386 | notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd); | 381 | notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd); |
| 387 | system_state = SYSTEM_RESTART; | 382 | system_state = SYSTEM_RESTART; |
| 388 | device_shutdown(); | 383 | device_shutdown(); |
| 389 | } | 384 | } |
| 385 | |||
| 386 | /** | ||
| 387 | * kernel_restart - reboot the system | ||
| 388 | * @cmd: pointer to buffer containing command to execute for restart | ||
| 389 | * or %NULL | ||
| 390 | * | ||
| 391 | * Shutdown everything and perform a clean reboot. | ||
| 392 | * This is not safe to call in interrupt context. | ||
| 393 | */ | ||
| 390 | void kernel_restart(char *cmd) | 394 | void kernel_restart(char *cmd) |
| 391 | { | 395 | { |
| 392 | kernel_restart_prepare(cmd); | 396 | kernel_restart_prepare(cmd); |
| @@ -623,6 +627,7 @@ asmlinkage long sys_setregid(gid_t rgid, gid_t egid) | |||
| 623 | current->egid = new_egid; | 627 | current->egid = new_egid; |
| 624 | current->gid = new_rgid; | 628 | current->gid = new_rgid; |
| 625 | key_fsgid_changed(current); | 629 | key_fsgid_changed(current); |
| 630 | proc_id_connector(current, PROC_EVENT_GID); | ||
| 626 | return 0; | 631 | return 0; |
| 627 | } | 632 | } |
| 628 | 633 | ||
| @@ -662,6 +667,7 @@ asmlinkage long sys_setgid(gid_t gid) | |||
| 662 | return -EPERM; | 667 | return -EPERM; |
| 663 | 668 | ||
| 664 | key_fsgid_changed(current); | 669 | key_fsgid_changed(current); |
| 670 | proc_id_connector(current, PROC_EVENT_GID); | ||
| 665 | return 0; | 671 | return 0; |
| 666 | } | 672 | } |
| 667 | 673 | ||
| @@ -751,6 +757,7 @@ asmlinkage long sys_setreuid(uid_t ruid, uid_t euid) | |||
| 751 | current->fsuid = current->euid; | 757 | current->fsuid = current->euid; |
| 752 | 758 | ||
| 753 | key_fsuid_changed(current); | 759 | key_fsuid_changed(current); |
| 760 | proc_id_connector(current, PROC_EVENT_UID); | ||
| 754 | 761 | ||
| 755 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RE); | 762 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RE); |
| 756 | } | 763 | } |
| @@ -798,6 +805,7 @@ asmlinkage long sys_setuid(uid_t uid) | |||
| 798 | current->suid = new_suid; | 805 | current->suid = new_suid; |
| 799 | 806 | ||
| 800 | key_fsuid_changed(current); | 807 | key_fsuid_changed(current); |
| 808 | proc_id_connector(current, PROC_EVENT_UID); | ||
| 801 | 809 | ||
| 802 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_ID); | 810 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_ID); |
| 803 | } | 811 | } |
| @@ -846,6 +854,7 @@ asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) | |||
| 846 | current->suid = suid; | 854 | current->suid = suid; |
| 847 | 855 | ||
| 848 | key_fsuid_changed(current); | 856 | key_fsuid_changed(current); |
| 857 | proc_id_connector(current, PROC_EVENT_UID); | ||
| 849 | 858 | ||
| 850 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RES); | 859 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RES); |
| 851 | } | 860 | } |
| @@ -898,6 +907,7 @@ asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) | |||
| 898 | current->sgid = sgid; | 907 | current->sgid = sgid; |
| 899 | 908 | ||
| 900 | key_fsgid_changed(current); | 909 | key_fsgid_changed(current); |
| 910 | proc_id_connector(current, PROC_EVENT_GID); | ||
| 901 | return 0; | 911 | return 0; |
| 902 | } | 912 | } |
| 903 | 913 | ||
| @@ -940,6 +950,7 @@ asmlinkage long sys_setfsuid(uid_t uid) | |||
| 940 | } | 950 | } |
| 941 | 951 | ||
| 942 | key_fsuid_changed(current); | 952 | key_fsuid_changed(current); |
| 953 | proc_id_connector(current, PROC_EVENT_UID); | ||
| 943 | 954 | ||
| 944 | security_task_post_setuid(old_fsuid, (uid_t)-1, (uid_t)-1, LSM_SETID_FS); | 955 | security_task_post_setuid(old_fsuid, (uid_t)-1, (uid_t)-1, LSM_SETID_FS); |
| 945 | 956 | ||
| @@ -968,6 +979,7 @@ asmlinkage long sys_setfsgid(gid_t gid) | |||
| 968 | } | 979 | } |
| 969 | current->fsgid = gid; | 980 | current->fsgid = gid; |
| 970 | key_fsgid_changed(current); | 981 | key_fsgid_changed(current); |
| 982 | proc_id_connector(current, PROC_EVENT_GID); | ||
| 971 | } | 983 | } |
| 972 | return old_fsgid; | 984 | return old_fsgid; |
| 973 | } | 985 | } |
| @@ -1485,8 +1497,6 @@ EXPORT_SYMBOL(in_egroup_p); | |||
| 1485 | 1497 | ||
| 1486 | DECLARE_RWSEM(uts_sem); | 1498 | DECLARE_RWSEM(uts_sem); |
| 1487 | 1499 | ||
| 1488 | EXPORT_SYMBOL(uts_sem); | ||
| 1489 | |||
| 1490 | asmlinkage long sys_newuname(struct new_utsname __user * name) | 1500 | asmlinkage long sys_newuname(struct new_utsname __user * name) |
| 1491 | { | 1501 | { |
| 1492 | int errno = 0; | 1502 | int errno = 0; |
