mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
audit: add support for session ID user filter
Define AUDIT_SESSIONID in the uapi and add support for specifying user filters based on the session ID. Also add the new session ID filter to the feature bitmap so userspace knows it is available. https://github.com/linux-audit/audit-kernel/issues/4 RFE: add a session ID filter to the kernel's user filter Signed-off-by: Richard Guy Briggs <rgb@redhat.com> [PM: combine multiple patches from Richard into this one] Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
c1e8f06d7a
commit
8fae477056
3 changed files with 11 additions and 1 deletions
|
@ -446,6 +446,7 @@ static int audit_filter_rules(struct task_struct *tsk,
|
|||
const struct cred *cred;
|
||||
int i, need_sid = 1;
|
||||
u32 sid;
|
||||
unsigned int sessionid;
|
||||
|
||||
cred = rcu_dereference_check(tsk->cred, tsk == current || task_creation);
|
||||
|
||||
|
@ -508,6 +509,10 @@ static int audit_filter_rules(struct task_struct *tsk,
|
|||
case AUDIT_FSGID:
|
||||
result = audit_gid_comparator(cred->fsgid, f->op, f->gid);
|
||||
break;
|
||||
case AUDIT_SESSIONID:
|
||||
sessionid = audit_get_sessionid(current);
|
||||
result = audit_comparator(sessionid, f->op, f->val);
|
||||
break;
|
||||
case AUDIT_PERS:
|
||||
result = audit_comparator(tsk->personality, f->op, f->val);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue