diff options
-rw-r--r-- | include/linux/audit.h | 4 | ||||
-rw-r--r-- | kernel/audit.c | 12 | ||||
-rw-r--r-- | kernel/auditsc.c | 7 |
3 files changed, 8 insertions, 15 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index baa80760824c..58c5589b531f 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -192,7 +192,7 @@ extern void audit_inode(const char *name, const struct inode *inode); | |||
192 | /* Private API (for audit.c only) */ | 192 | /* Private API (for audit.c only) */ |
193 | extern int audit_receive_filter(int type, int pid, int uid, int seq, | 193 | extern int audit_receive_filter(int type, int pid, int uid, int seq, |
194 | void *data, uid_t loginuid); | 194 | void *data, uid_t loginuid); |
195 | extern void audit_get_stamp(struct audit_context *ctx, | 195 | extern int audit_get_stamp(struct audit_context *ctx, |
196 | struct timespec *t, unsigned int *serial); | 196 | struct timespec *t, unsigned int *serial); |
197 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | 197 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); |
198 | extern uid_t audit_get_loginuid(struct audit_context *ctx); | 198 | extern uid_t audit_get_loginuid(struct audit_context *ctx); |
@@ -206,6 +206,8 @@ extern void audit_signal_info(int sig, struct task_struct *t); | |||
206 | #define audit_getname(n) do { ; } while (0) | 206 | #define audit_getname(n) do { ; } while (0) |
207 | #define audit_putname(n) do { ; } while (0) | 207 | #define audit_putname(n) do { ; } while (0) |
208 | #define audit_inode(n,i) do { ; } while (0) | 208 | #define audit_inode(n,i) do { ; } while (0) |
209 | #define audit_receive_filter(t,p,u,s,d,l) ({ -EOPNOTSUPP; }) | ||
210 | #define audit_get_stamp(c,t,s) ({ 0; }) | ||
209 | #define audit_get_loginuid(c) ({ -1; }) | 211 | #define audit_get_loginuid(c) ({ -1; }) |
210 | #define audit_ipc_perms(q,u,g,m) ({ 0; }) | 212 | #define audit_ipc_perms(q,u,g,m) ({ 0; }) |
211 | #define audit_signal_info(s,t) do { ; } while (0) | 213 | #define audit_signal_info(s,t) do { ; } while (0) |
diff --git a/kernel/audit.c b/kernel/audit.c index dc4aba21f30a..c18b769e23a2 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -416,12 +416,8 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
416 | return -EINVAL; | 416 | return -EINVAL; |
417 | /* fallthrough */ | 417 | /* fallthrough */ |
418 | case AUDIT_LIST: | 418 | case AUDIT_LIST: |
419 | #ifdef CONFIG_AUDITSYSCALL | ||
420 | err = audit_receive_filter(nlh->nlmsg_type, NETLINK_CB(skb).pid, | 419 | err = audit_receive_filter(nlh->nlmsg_type, NETLINK_CB(skb).pid, |
421 | uid, seq, data, loginuid); | 420 | uid, seq, data, loginuid); |
422 | #else | ||
423 | err = -EOPNOTSUPP; | ||
424 | #endif | ||
425 | break; | 421 | break; |
426 | case AUDIT_SIGNAL_INFO: | 422 | case AUDIT_SIGNAL_INFO: |
427 | sig_data.uid = audit_sig_uid; | 423 | sig_data.uid = audit_sig_uid; |
@@ -636,15 +632,11 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx) | |||
636 | return NULL; | 632 | return NULL; |
637 | } | 633 | } |
638 | 634 | ||
639 | #ifdef CONFIG_AUDITSYSCALL | 635 | if (!audit_get_stamp(ab->ctx, &t, &serial)) { |
640 | if (ab->ctx) | ||
641 | audit_get_stamp(ab->ctx, &t, &serial); | ||
642 | else | ||
643 | #endif | ||
644 | { | ||
645 | t = CURRENT_TIME; | 636 | t = CURRENT_TIME; |
646 | serial = 0; | 637 | serial = 0; |
647 | } | 638 | } |
639 | |||
648 | audit_log_format(ab, "audit(%lu.%03lu:%u): ", | 640 | audit_log_format(ab, "audit(%lu.%03lu:%u): ", |
649 | t.tv_sec, t.tv_nsec/1000000, serial); | 641 | t.tv_sec, t.tv_nsec/1000000, serial); |
650 | return ab; | 642 | return ab; |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 680bb928343b..94338abf76f5 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -992,7 +992,7 @@ void audit_inode(const char *name, const struct inode *inode) | |||
992 | context->names[idx].rdev = inode->i_rdev; | 992 | context->names[idx].rdev = inode->i_rdev; |
993 | } | 993 | } |
994 | 994 | ||
995 | void audit_get_stamp(struct audit_context *ctx, | 995 | int audit_get_stamp(struct audit_context *ctx, |
996 | struct timespec *t, unsigned int *serial) | 996 | struct timespec *t, unsigned int *serial) |
997 | { | 997 | { |
998 | if (ctx) { | 998 | if (ctx) { |
@@ -1000,10 +1000,9 @@ void audit_get_stamp(struct audit_context *ctx, | |||
1000 | t->tv_nsec = ctx->ctime.tv_nsec; | 1000 | t->tv_nsec = ctx->ctime.tv_nsec; |
1001 | *serial = ctx->serial; | 1001 | *serial = ctx->serial; |
1002 | ctx->auditable = 1; | 1002 | ctx->auditable = 1; |
1003 | } else { | 1003 | return 1; |
1004 | *t = CURRENT_TIME; | ||
1005 | *serial = 0; | ||
1006 | } | 1004 | } |
1005 | return 0; | ||
1007 | } | 1006 | } |
1008 | 1007 | ||
1009 | extern int audit_set_type(struct audit_buffer *ab, int type); | 1008 | extern int audit_set_type(struct audit_buffer *ab, int type); |