aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2008-11-11 05:48:22 -0500
committerJames Morris <jmorris@namei.org>2008-11-11 05:48:22 -0500
commite68b75a027bb94066576139ee33676264f867b87 (patch)
tree2c31f59a4abe9d7bb3cb75fdf3b57772feeeb6f6 /include
parent3fc689e96c0c90b6fede5946d6c31075e9464f69 (diff)
When the capset syscall is used it is not possible for audit to record the
actual capbilities being added/removed. This patch adds a new record type which emits the target pid and the eff, inh, and perm cap sets. example output if you audit capset syscalls would be: type=SYSCALL msg=audit(1225743140.465:76): arch=c000003e syscall=126 success=yes exit=0 a0=17f2014 a1=17f201c a2=80000000 a3=7fff2ab7f060 items=0 ppid=2160 pid=2223 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm="setcap" exe="/usr/sbin/setcap" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) type=UNKNOWN[1322] msg=audit(1225743140.465:76): pid=0 cap_pi=ffffffffffffffff cap_pp=ffffffffffffffff cap_pe=ffffffffffffffff Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/audit.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 8cfb9feb2a05..6fbebac7b1bf 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -100,6 +100,7 @@
100#define AUDIT_TTY 1319 /* Input on an administrative TTY */ 100#define AUDIT_TTY 1319 /* Input on an administrative TTY */
101#define AUDIT_EOE 1320 /* End of multi-record event */ 101#define AUDIT_EOE 1320 /* End of multi-record event */
102#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */ 102#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */
103#define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */
103 104
104#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 105#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
105#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 106#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
@@ -454,6 +455,7 @@ extern int __audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __u
454extern int __audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification); 455extern int __audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification);
455extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); 456extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
456extern void __audit_log_bprm_fcaps(struct linux_binprm *bprm, kernel_cap_t *pP, kernel_cap_t *pE); 457extern void __audit_log_bprm_fcaps(struct linux_binprm *bprm, kernel_cap_t *pP, kernel_cap_t *pE);
458extern int __audit_log_capset(pid_t pid, kernel_cap_t *eff, kernel_cap_t *inh, kernel_cap_t *perm);
457 459
458static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) 460static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)
459{ 461{
@@ -526,6 +528,13 @@ static inline void audit_log_bprm_fcaps(struct linux_binprm *bprm, kernel_cap_t
526 __audit_log_bprm_fcaps(bprm, pP, pE); 528 __audit_log_bprm_fcaps(bprm, pP, pE);
527} 529}
528 530
531static inline int audit_log_capset(pid_t pid, kernel_cap_t *eff, kernel_cap_t *inh, kernel_cap_t *perm)
532{
533 if (unlikely(!audit_dummy_context()))
534 return __audit_log_capset(pid, eff, inh, perm);
535 return 0;
536}
537
529extern int audit_n_rules; 538extern int audit_n_rules;
530extern int audit_signals; 539extern int audit_signals;
531#else 540#else
@@ -558,6 +567,7 @@ extern int audit_signals;
558#define audit_mq_notify(d,n) ({ 0; }) 567#define audit_mq_notify(d,n) ({ 0; })
559#define audit_mq_getsetattr(d,s) ({ 0; }) 568#define audit_mq_getsetattr(d,s) ({ 0; })
560#define audit_log_bprm_fcaps(b, p, e) do { ; } while (0) 569#define audit_log_bprm_fcaps(b, p, e) do { ; } while (0)
570#define audit_log_capset(pid, e, i, p) ({ 0; })
561#define audit_ptrace(t) ((void)0) 571#define audit_ptrace(t) ((void)0)
562#define audit_n_rules 0 572#define audit_n_rules 0
563#define audit_signals 0 573#define audit_signals 0