Skip to content

Commit 12c5e81

Browse files
committed
audit: prepare audit_context for use in calling contexts beyond syscalls
This patch cleans up some of our audit_context handling by abstracting out the reset and return code fixup handling to dedicated functions. Not only does this help make things easier to read and inspect, it allows for easier reuse by future patches. We also convert the simple audit_context->in_syscall flag into an enum which can be used to by future patches to indicate a calling context other than the syscall context. Thanks to Richard Guy Briggs for review and feedback. Acked-by: Richard Guy Briggs <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 6880fa6 commit 12c5e81

File tree

2 files changed

+167
-94
lines changed

2 files changed

+167
-94
lines changed

kernel/audit.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ struct audit_proctitle {
100100
/* The per-task audit context. */
101101
struct audit_context {
102102
int dummy; /* must be the first element */
103-
int in_syscall; /* 1 if task is in a syscall */
103+
enum {
104+
AUDIT_CTX_UNUSED, /* audit_context is currently unused */
105+
AUDIT_CTX_SYSCALL, /* in use by syscall */
106+
} context;
104107
enum audit_state state, current_state;
105108
unsigned int serial; /* serial number for record */
106109
int major; /* syscall number */

0 commit comments

Comments
 (0)