Re: [PATCH v2] audit: annotate the lockless read of the audit control lock owner

From: Paul Moore

Date: Tue Nov 03 2026 - 19:04:26 EST


On Oct 7, 2026 Babanpreet Singh <bbnpreetsingh@xxxxxxxxx> wrote:
>
> audit_ctl_owner_current() reads the lock owner without taking the lock
> and KCSAN complains about it. Only the current task can store itself as
> owner, so the check can't give a wrong answer. Mark the accesses with
> READ_ONCE() and WRITE_ONCE().
>
> Reported-by: syzbot+39b8fea0641107a1ccee@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://syzkaller.appspot.com/bug?extid=39b8fea0641107a1ccee
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Babanpreet Singh <bbnpreetsingh@xxxxxxxxx>
> Reviewed-by: Bradley Morgan <brads@xxxxxxxxxxxxxx>
> Tested-by: Bradley Morgan <brads@xxxxxxxxxxxxxx> # Power10
> ---
> v2: drop the comment in audit_ctl_owner_current(). The KCSAN build of
> audit.o disassembles the same as v1.
> v1: https://lore.kernel.org/all/20261002011712.7-1-bbnpreetsingh@xxxxxxxxx/
> Compile tested only (gcc W=1 and the KCSAN instrumentation diff); I
> could not reproduce the race in QEMU.
>
> kernel/audit.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)

Merged into audit/dev, thanks!

--
paul-moore.com