diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/audit.c | 4 | ||||
-rw-r--r-- | kernel/auditsc.c | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index d8646c23b427..ce6d8ea3131e 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -1121,9 +1121,7 @@ unsigned int audit_serial(void) | |||
1121 | static inline void audit_get_stamp(struct audit_context *ctx, | 1121 | static inline void audit_get_stamp(struct audit_context *ctx, |
1122 | struct timespec *t, unsigned int *serial) | 1122 | struct timespec *t, unsigned int *serial) |
1123 | { | 1123 | { |
1124 | if (ctx) | 1124 | if (!ctx || !auditsc_get_stamp(ctx, t, serial)) { |
1125 | auditsc_get_stamp(ctx, t, serial); | ||
1126 | else { | ||
1127 | *t = CURRENT_TIME; | 1125 | *t = CURRENT_TIME; |
1128 | *serial = audit_serial(); | 1126 | *serial = audit_serial(); |
1129 | } | 1127 | } |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 0a13d6895494..2a3f0afc4d2a 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -1957,15 +1957,18 @@ EXPORT_SYMBOL_GPL(__audit_inode_child); | |||
1957 | * | 1957 | * |
1958 | * Also sets the context as auditable. | 1958 | * Also sets the context as auditable. |
1959 | */ | 1959 | */ |
1960 | void auditsc_get_stamp(struct audit_context *ctx, | 1960 | int auditsc_get_stamp(struct audit_context *ctx, |
1961 | struct timespec *t, unsigned int *serial) | 1961 | struct timespec *t, unsigned int *serial) |
1962 | { | 1962 | { |
1963 | if (!ctx->in_syscall) | ||
1964 | return 0; | ||
1963 | if (!ctx->serial) | 1965 | if (!ctx->serial) |
1964 | ctx->serial = audit_serial(); | 1966 | ctx->serial = audit_serial(); |
1965 | t->tv_sec = ctx->ctime.tv_sec; | 1967 | t->tv_sec = ctx->ctime.tv_sec; |
1966 | t->tv_nsec = ctx->ctime.tv_nsec; | 1968 | t->tv_nsec = ctx->ctime.tv_nsec; |
1967 | *serial = ctx->serial; | 1969 | *serial = ctx->serial; |
1968 | ctx->auditable = 1; | 1970 | ctx->auditable = 1; |
1971 | return 1; | ||
1969 | } | 1972 | } |
1970 | 1973 | ||
1971 | /* global counter which is incremented every time something logs in */ | 1974 | /* global counter which is incremented every time something logs in */ |