Re: [PATCH v3] printk: ringbuffer: Annotate speculative record reads

From: John Ogness

Date: Fri Nov 13 2026 - 16:34:39 EST


On 2026-11-13, Zhu Jun <zhujun2@xxxxxxxxxxxxxxxxxxxx> wrote:
> Readers may copy a finalized record while a writer recycles its storage.
> prb_read() checks the descriptor again after copying and rejects records
> that have changed, but the plain metadata and text accesses still trigger
> KCSAN reports.
>
> Annotate the speculative copies, line counting and length read with
> data_race(). The descriptor validation continues to determine whether
> the copied record can be used.
>
> Fixes: b6cf8b3f3312 ("printk: add lockless ringbuffer")
> Signed-off-by: Zhu Jun <zhujun2@xxxxxxxxxxxxxxxxxxxx>

Reviewed-by: John Ogness <john.ogness@xxxxxxxxxxxxx>

Thanks!