You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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>
This commit is contained in:
committed by
Linus Torvalds
parent
49364ce253
commit
9f46080c41
@@ -28,6 +28,7 @@
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/cn_proc.h>
|
||||
|
||||
#include <linux/compat.h>
|
||||
#include <linux/syscalls.h>
|
||||
@@ -623,6 +624,7 @@ asmlinkage long sys_setregid(gid_t rgid, gid_t egid)
|
||||
current->egid = new_egid;
|
||||
current->gid = new_rgid;
|
||||
key_fsgid_changed(current);
|
||||
proc_id_connector(current, PROC_EVENT_GID);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -662,6 +664,7 @@ asmlinkage long sys_setgid(gid_t gid)
|
||||
return -EPERM;
|
||||
|
||||
key_fsgid_changed(current);
|
||||
proc_id_connector(current, PROC_EVENT_GID);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -751,6 +754,7 @@ asmlinkage long sys_setreuid(uid_t ruid, uid_t euid)
|
||||
current->fsuid = current->euid;
|
||||
|
||||
key_fsuid_changed(current);
|
||||
proc_id_connector(current, PROC_EVENT_UID);
|
||||
|
||||
return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RE);
|
||||
}
|
||||
@@ -798,6 +802,7 @@ asmlinkage long sys_setuid(uid_t uid)
|
||||
current->suid = new_suid;
|
||||
|
||||
key_fsuid_changed(current);
|
||||
proc_id_connector(current, PROC_EVENT_UID);
|
||||
|
||||
return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_ID);
|
||||
}
|
||||
@@ -846,6 +851,7 @@ asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
|
||||
current->suid = suid;
|
||||
|
||||
key_fsuid_changed(current);
|
||||
proc_id_connector(current, PROC_EVENT_UID);
|
||||
|
||||
return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RES);
|
||||
}
|
||||
@@ -898,6 +904,7 @@ asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
|
||||
current->sgid = sgid;
|
||||
|
||||
key_fsgid_changed(current);
|
||||
proc_id_connector(current, PROC_EVENT_GID);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -940,6 +947,7 @@ asmlinkage long sys_setfsuid(uid_t uid)
|
||||
}
|
||||
|
||||
key_fsuid_changed(current);
|
||||
proc_id_connector(current, PROC_EVENT_UID);
|
||||
|
||||
security_task_post_setuid(old_fsuid, (uid_t)-1, (uid_t)-1, LSM_SETID_FS);
|
||||
|
||||
@@ -968,6 +976,7 @@ asmlinkage long sys_setfsgid(gid_t gid)
|
||||
}
|
||||
current->fsgid = gid;
|
||||
key_fsgid_changed(current);
|
||||
proc_id_connector(current, PROC_EVENT_GID);
|
||||
}
|
||||
return old_fsgid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user