diff options
author | Matt Helsley <matthltc@us.ibm.com> | 2005-11-07 03:59:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:35 -0500 |
commit | 9f46080c41d5f3f7c00b4e169ba4b0b2865258bf (patch) | |
tree | e2c029ef7f0cd5fb8ea9b78db3f7be5badaf59b1 /kernel/sys.c | |
parent | 49364ce2534418462d681ad99e52e79a00b0f40b (diff) |
[PATCH] Process Events Connector
This patch adds a connector that reports fork, exec, id change, and exit
events for all processes to userspace. It replaces the fork_advisor patch
that ELSA is currently using. Applications that may find these events
useful include accounting/auditing (e.g. ELSA), system activity monitoring
(e.g. top), security, and resource management (e.g. CKRM).
Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 2fa1ed18123c..1e1f41b3fdf6 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> |
@@ -623,6 +624,7 @@ asmlinkage long sys_setregid(gid_t rgid, gid_t egid) | |||
623 | current->egid = new_egid; | 624 | current->egid = new_egid; |
624 | current->gid = new_rgid; | 625 | current->gid = new_rgid; |
625 | key_fsgid_changed(current); | 626 | key_fsgid_changed(current); |
627 | proc_id_connector(current, PROC_EVENT_GID); | ||
626 | return 0; | 628 | return 0; |
627 | } | 629 | } |
628 | 630 | ||
@@ -662,6 +664,7 @@ asmlinkage long sys_setgid(gid_t gid) | |||
662 | return -EPERM; | 664 | return -EPERM; |
663 | 665 | ||
664 | key_fsgid_changed(current); | 666 | key_fsgid_changed(current); |
667 | proc_id_connector(current, PROC_EVENT_GID); | ||
665 | return 0; | 668 | return 0; |
666 | } | 669 | } |
667 | 670 | ||
@@ -751,6 +754,7 @@ asmlinkage long sys_setreuid(uid_t ruid, uid_t euid) | |||
751 | current->fsuid = current->euid; | 754 | current->fsuid = current->euid; |
752 | 755 | ||
753 | key_fsuid_changed(current); | 756 | key_fsuid_changed(current); |
757 | proc_id_connector(current, PROC_EVENT_UID); | ||
754 | 758 | ||
755 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RE); | 759 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RE); |
756 | } | 760 | } |
@@ -798,6 +802,7 @@ asmlinkage long sys_setuid(uid_t uid) | |||
798 | current->suid = new_suid; | 802 | current->suid = new_suid; |
799 | 803 | ||
800 | key_fsuid_changed(current); | 804 | key_fsuid_changed(current); |
805 | proc_id_connector(current, PROC_EVENT_UID); | ||
801 | 806 | ||
802 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_ID); | 807 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_ID); |
803 | } | 808 | } |
@@ -846,6 +851,7 @@ asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) | |||
846 | current->suid = suid; | 851 | current->suid = suid; |
847 | 852 | ||
848 | key_fsuid_changed(current); | 853 | key_fsuid_changed(current); |
854 | proc_id_connector(current, PROC_EVENT_UID); | ||
849 | 855 | ||
850 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RES); | 856 | return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RES); |
851 | } | 857 | } |
@@ -898,6 +904,7 @@ asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) | |||
898 | current->sgid = sgid; | 904 | current->sgid = sgid; |
899 | 905 | ||
900 | key_fsgid_changed(current); | 906 | key_fsgid_changed(current); |
907 | proc_id_connector(current, PROC_EVENT_GID); | ||
901 | return 0; | 908 | return 0; |
902 | } | 909 | } |
903 | 910 | ||
@@ -940,6 +947,7 @@ asmlinkage long sys_setfsuid(uid_t uid) | |||
940 | } | 947 | } |
941 | 948 | ||
942 | key_fsuid_changed(current); | 949 | key_fsuid_changed(current); |
950 | proc_id_connector(current, PROC_EVENT_UID); | ||
943 | 951 | ||
944 | security_task_post_setuid(old_fsuid, (uid_t)-1, (uid_t)-1, LSM_SETID_FS); | 952 | security_task_post_setuid(old_fsuid, (uid_t)-1, (uid_t)-1, LSM_SETID_FS); |
945 | 953 | ||
@@ -968,6 +976,7 @@ asmlinkage long sys_setfsgid(gid_t gid) | |||
968 | } | 976 | } |
969 | current->fsgid = gid; | 977 | current->fsgid = gid; |
970 | key_fsgid_changed(current); | 978 | key_fsgid_changed(current); |
979 | proc_id_connector(current, PROC_EVENT_GID); | ||
971 | } | 980 | } |
972 | return old_fsgid; | 981 | return old_fsgid; |
973 | } | 982 | } |