lkml.org 
[lkml]   [2015]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] net: fix data race on sk_buff after re-cloning
From
Date
On Thu, 2015-09-17 at 20:44 +0200, Dmitry Vyukov wrote:
> KernelThreadSanitizer (KTSAN) reported the following race (on 4.2 rc2):
>
> ThreadSanitizer: data-race in __copy_skb_header
...

> if (likely(atomic_read(&skb->users) == 1))
> smp_rmb();
>
> The patch contains a proposed fix.
> If it looks good to you and the scenario looks sane,
> then I will update the description and resend it.
> ---
> net/core/skbuff.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)

I have to double check this patch, but in the case it is needed,
it would be better to not use fancy new atomic_read_acquire(),
as backporting the fix up to 3.19 (where the bug was probably added)
will require extra hassle.

atomic_read_acquire() would be fine for cleanups and new code, in next
branch.

Thanks !




\
 
 \ /
  Last update: 2015-09-17 21:21    [W:0.033 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site