Re: [PATCH] skbuff: fix a data race in skb_queue_len()

From: Qian Cai
Date: Mon Feb 03 2020 - 17:34:40 EST




> On Feb 3, 2020, at 3:28 PM, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:
>
> We added recently skb_queue_empty_lockless() helper, to use in these contexts.
>
> The fact that we use READ_ONCE() is more of an implementation detail I think.
>

Make sense. Iâll use lockless in naming instead.

> Also, addressing load-stearing issues without making sure the write side
> is using WRITE_ONCE() might be not enough (even if KCSAN warnings disappear)

I suppose that could be a case. Iâll have,

WRITE_ONCE(list->qlen, list->qlen - 1);

in __skb_unlink() where it had already had a few WRITE_ONCE() for other variables.