* [PATCH v2] audit: sort missing compat prototypes
@ 2026-01-09 13:39 Ben Dooks
2026-01-09 21:37 ` Paul Moore
0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2026-01-09 13:39 UTC (permalink / raw)
To: linux-kernel, audit; +Cc: eparis, paul, Ben Dooks
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: 4b58841149dca ("audit: Add generic compat syscall support")
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
v2: fixed missed commit of include/linux/audit.h
---
include/linux/audit.h | 6 ------
include/linux/audit_arch.h | 7 +++++++
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 536f8ee8da81..b8d8029c6c48 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -128,12 +128,6 @@ enum audit_nfcfgop {
extern int __init audit_register_class(int class, unsigned *list);
extern int audit_classify_syscall(int abi, unsigned syscall);
extern int audit_classify_arch(int arch);
-/* only for compat system calls */
-extern unsigned compat_write_class[];
-extern unsigned compat_read_class[];
-extern unsigned compat_dir_class[];
-extern unsigned compat_chattr_class[];
-extern unsigned compat_signal_class[];
/* audit_names->type values */
#define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */
diff --git a/include/linux/audit_arch.h b/include/linux/audit_arch.h
index 0e34d673ef17..2b8153791e6a 100644
--- a/include/linux/audit_arch.h
+++ b/include/linux/audit_arch.h
@@ -23,4 +23,11 @@ enum auditsc_class_t {
extern int audit_classify_compat_syscall(int abi, unsigned syscall);
+/* only for compat system calls */
+extern unsigned compat_write_class[];
+extern unsigned compat_read_class[];
+extern unsigned compat_dir_class[];
+extern unsigned compat_chattr_class[];
+extern unsigned compat_signal_class[];
+
#endif
--
2.37.2.352.g3c44437643
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] audit: sort missing compat prototypes
2026-01-09 13:39 [PATCH v2] audit: sort missing compat prototypes Ben Dooks
@ 2026-01-09 21:37 ` Paul Moore
0 siblings, 0 replies; 2+ messages in thread
From: Paul Moore @ 2026-01-09 21:37 UTC (permalink / raw)
To: Ben Dooks, linux-kernel, audit; +Cc: eparis, Ben Dooks
On Jan 9, 2026 Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>
> 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: 4b58841149dca ("audit: Add generic compat syscall support")
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> v2: fixed missed commit of include/linux/audit.h
> ---
> include/linux/audit.h | 6 ------
> include/linux/audit_arch.h | 7 +++++++
> 2 files changed, 7 insertions(+), 6 deletions(-)
I merged this into audit/dev, but I rewrote the subject line to "audit:
move the compat_xxx_class[] extern declarations to audit_arch.h" properly
reflect the change in the patch, and wrapped the compiler output examples
so that 'git log' on an 80-char wide terminal is not overly ugly. Please
take this into account in future patch submissions, thanks.
--
paul-moore.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-09 21:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-09 13:39 [PATCH v2] audit: sort missing compat prototypes Ben Dooks
2026-01-09 21:37 ` Paul Moore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®