[PATCH v18 02/14] arm64: ptrace: Rework audit_syscall_entry()

Jinjie Ruan ruanjinjie at huawei.com
Sat Sep 19 18:24:59 PDT 2026



在 2026/9/20 0:43, Karl Mehltretter 写道:
>> +	if (unlikely(audit_context()))
>> +		syscall_enter_audit(regs);
> 
> With arm64 defconfig and CONFIG_AUDIT=n on v7.3-rc1, building
> arch/arm64/kernel/ptrace.o after this patch fails with GCC 15.2.0:
> 
> arch/arm64/kernel/ptrace.c: In function ‘syscall_trace_enter’:
> arch/arm64/kernel/ptrace.c:2491:17: error: implicit declaration of function ‘syscall_enter_audit’ [-Wimplicit-function-declaration]
>  2491 |                 syscall_enter_audit(regs);
>       |                 ^~~~~~~~~~~~~~~~~~~
> 
> The helper is defined only under CONFIG_AUDITSYSCALL, but this call
> remains when auditing is disabled. The audit_context() check does not
> avoid the missing declaration.
> 
> Could the helper get an audit-disabled stub, or could this call be
> guarded as well?

Hi Karl,

Thank you for pointing out this issue.

We discussed a similar problem with generic entry in the link below.
Thomas believed it appears to be a compiler problem, and we originally
planned to fix it using __always_inline. I will fix it following the
same approach used for generic entry.

https://lore.kernel.org/all/87tso45bqq.ffs@fw13/

Link:
https://lore.kernel.org/all/20260720094921.537716-1-ruanjinjie@huawei.com/
Link:
https://lore.kernel.org/all/20260721040118.1000554-1-ruanjinjie@huawei.com/

> 
> The same object builds after patches 1 and 13. Patch 12 still fails
> with the missing declaration. Patch 13 removes the affected code, but
> the intermediate commits should remain buildable.
> 
> Thanks,
> Karl

-- 
Best regards,
Jinjie




More information about the linux-arm-kernel mailing list