Skip to content

Commit 7599a89

Browse files
olsajiridavem330
authored andcommitted
audit: Move audit_log_task declaration under CONFIG_AUDITSYSCALL
The 0-DAY found that audit_log_task is not declared under CONFIG_AUDITSYSCALL which causes compilation error when it is not defined: kernel/bpf/syscall.o: In function `bpf_audit_prog.isra.30': >> syscall.c:(.text+0x860): undefined reference to `audit_log_task' Adding the audit_log_task declaration and stub within CONFIG_AUDITSYSCALL ifdef. Fixes: 91e6015 ("bpf: Emit audit messages upon successful prog load and unload") Reported-by: kbuild test robot <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 43da141 commit 7599a89

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/linux/audit.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ extern void audit_log_key(struct audit_buffer *ab,
159159
extern void audit_log_link_denied(const char *operation);
160160
extern void audit_log_lost(const char *message);
161161

162-
extern void audit_log_task(struct audit_buffer *ab);
163162
extern int audit_log_task_context(struct audit_buffer *ab);
164163
extern void audit_log_task_info(struct audit_buffer *ab);
165164

@@ -220,8 +219,6 @@ static inline void audit_log_key(struct audit_buffer *ab, char *key)
220219
{ }
221220
static inline void audit_log_link_denied(const char *string)
222221
{ }
223-
static inline void audit_log_task(struct audit_buffer *ab)
224-
{ }
225222
static inline int audit_log_task_context(struct audit_buffer *ab)
226223
{
227224
return 0;
@@ -361,6 +358,8 @@ static inline void audit_ptrace(struct task_struct *t)
361358
__audit_ptrace(t);
362359
}
363360

361+
extern void audit_log_task(struct audit_buffer *ab);
362+
364363
/* Private API (for audit.c only) */
365364
extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
366365
extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode);
@@ -648,6 +647,9 @@ static inline void audit_ntp_log(const struct audit_ntp_data *ad)
648647

649648
static inline void audit_ptrace(struct task_struct *t)
650649
{ }
650+
651+
static inline void audit_log_task(struct audit_buffer *ab)
652+
{ }
651653
#define audit_n_rules 0
652654
#define audit_signals 0
653655
#endif /* CONFIG_AUDITSYSCALL */

0 commit comments

Comments
 (0)