public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] audit: add arch field to seccomp event log
@ 2014-02-14 20:23 Richard Guy Briggs
  2014-02-14 20:49 ` Eric Paris
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Guy Briggs @ 2014-02-14 20:23 UTC (permalink / raw)
  To: linux-audit, linux-kernel; +Cc: Richard Guy Briggs, Eric Paris, Steve Grubb

The AUDIT_SECCOMP record looks something like this:

type=SECCOMP msg=audit(1373478171.953:32775): auid=4325 uid=4325 gid=4325 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0 pid=12381 comm="test" sig=31 syscall=231 compat=0 ip=0x39ea8bca89 code=0x0

In order to determine what syscall 231 maps to, we need to have the arch= field right before it.

To see the event, compile this test.c program:

=====
int main(void)
{
        return seccomp_load(seccomp_init(SCMP_ACT_KILL));
}
=====

gcc -g test.c -o test -lseccomp

After running the program, find the record by:  ausearch --start recent -m SECCOMP -i
---
 kernel/auditsc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 6874c1f..c464d44 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2412,6 +2412,7 @@ void __audit_seccomp(unsigned long syscall, long signr, int code)
 		return;
 	audit_log_task(ab);
 	audit_log_format(ab, " sig=%ld", signr);
+	audit_log_format(ab, " arch=%x", current->audit_context->arch);
 	audit_log_format(ab, " syscall=%ld", syscall);
 	audit_log_format(ab, " compat=%d", is_compat_task());
 	audit_log_format(ab, " ip=0x%lx", KSTK_EIP(current));
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-02-21 23:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14 20:23 [PATCH] audit: add arch field to seccomp event log Richard Guy Briggs
2014-02-14 20:49 ` Eric Paris
2014-02-14 20:50   ` Richard Guy Briggs
2014-02-14 20:52     ` Richard Guy Briggs
2014-02-14 21:12       ` Eric Paris
2014-02-18 20:50         ` Richard Guy Briggs
2014-02-18 20:55           ` Eric Paris
2014-02-18 21:01           ` Steve Grubb
2014-02-19  3:15             ` Richard Guy Briggs
2014-02-19 19:37               ` Richard Guy Briggs
2014-02-21 23:32                 ` Richard Guy Briggs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox