Re: [PATCH v2] printk: annotate the intentional data race on the data block id
From: John Ogness
Date: Mon Oct 12 2026 - 08:38:54 EST
On 2026-10-12, Nguyen Ngoc Thang <ngocthang2710.1999@xxxxxxxxx> wrote:
> data_alloc() stores the descriptor ID into a newly reserved data block
> while data_make_reusable(), running from data_push_tail() on another CPU,
> may still be loading the ID from the same area. The ringbuffer allows
> this race: a stale or garbage ID simply fails the descriptor lookup or
> the blk_lpos check. KCSAN nevertheless reports it.
>
> Annotate the accesses with data_race() instead of READ_ONCE()/WRITE_ONCE(),
> which would needlessly restrict compiler optimizations for a race that is
> allowed by design. No functional change.
>
> Reported-by: syzbot+8324b8fd984b86905a66@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://syzkaller.appspot.com/bug?extid=8324b8fd984b86905a66
> Fixes: 896fbe20b4e2 ("printk: use the lockless ringbuffer")
> Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999@xxxxxxxxx>
Reviewed-by: John Ogness <john.ogness@xxxxxxxxxxxxx>