Skip to content
/ linux Public

Commit 4baa849

Browse files
bjdooks-ctSasha Levin
authored andcommitted
audit: move the compat_xxx_class[] extern declarations to audit_arch.h
[ Upstream commit 7648995 ] The comapt_xxx_class symbols aren't declared in anything that lib/comapt_audit.c is including (arm64 build) which is causing the following sparse warnings: lib/compat_audit.c:7:10: warning: symbol 'compat_dir_class' was not declared. Should it be static? lib/compat_audit.c:12:10: warning: symbol 'compat_read_class' was not declared. Should it be static? lib/compat_audit.c:17:10: warning: symbol 'compat_write_class' was not declared. Should it be static? lib/compat_audit.c:22:10: warning: symbol 'compat_chattr_class' was not declared. Should it be static? lib/compat_audit.c:27:10: warning: symbol 'compat_signal_class' was not declared. Should it be static? Trying to fix this by chaning compat_audit.c to inclde <linux/audit.h> does not work on arm64 due to compile errors with the extra includes that changing this header makes. The simpler thing would be just to move the definitons of these symbols out of <linux/audit.h> into <linux/audit_arch.h> which is included. Fixes: 4b58841 ("audit: Add generic compat syscall support") Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> [PM: rewrite subject line, fixed line length in description] Signed-off-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 990d2ba commit 4baa849

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

include/linux/audit.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,6 @@ enum audit_nfcfgop {
122122
extern int __init audit_register_class(int class, unsigned *list);
123123
extern int audit_classify_syscall(int abi, unsigned syscall);
124124
extern int audit_classify_arch(int arch);
125-
/* only for compat system calls */
126-
extern unsigned compat_write_class[];
127-
extern unsigned compat_read_class[];
128-
extern unsigned compat_dir_class[];
129-
extern unsigned compat_chattr_class[];
130-
extern unsigned compat_signal_class[];
131125

132126
/* audit_names->type values */
133127
#define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */

include/linux/audit_arch.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,11 @@ enum auditsc_class_t {
2323

2424
extern int audit_classify_compat_syscall(int abi, unsigned syscall);
2525

26+
/* only for compat system calls */
27+
extern unsigned compat_write_class[];
28+
extern unsigned compat_read_class[];
29+
extern unsigned compat_dir_class[];
30+
extern unsigned compat_chattr_class[];
31+
extern unsigned compat_signal_class[];
32+
2633
#endif

0 commit comments

Comments
 (0)