Re: PROBLEM: potential concurrency bug in rhashtable.h

2020-07-23 Thread Herbert Xu
On Thu, Jul 23, 2020 at 05:34:15PM -0700, Eric Dumazet wrote: > > Sure, but __rht_ptr() is used with different RCU checks, > I guess a that adding these lockdep conditions will make > a patch more invasive. Yes it is large but the only substantial change is to __rht_ptr and its callers. Everythin

Re: PROBLEM: potential concurrency bug in rhashtable.h

2020-07-23 Thread Eric Dumazet
On 7/23/20 5:09 PM, Herbert Xu wrote: > On Thu, Jul 23, 2020 at 03:32:05PM -0700, Eric Dumazet wrote: >> >> Thanks for the report/analysis. > > Thanks indeed. > >> READ_ONCE() should help here, can you test/submit an official patch ? > > This is basically a hand-rolled RCU access. So we sho

Re: PROBLEM: potential concurrency bug in rhashtable.h

2020-07-23 Thread Herbert Xu
On Thu, Jul 23, 2020 at 03:32:05PM -0700, Eric Dumazet wrote: > > Thanks for the report/analysis. Thanks indeed. > READ_ONCE() should help here, can you test/submit an official patch ? This is basically a hand-rolled RCU access. So we should instead use proper RCU operators if possible. Let m

Re: PROBLEM: potential concurrency bug in rhashtable.h

2020-07-23 Thread Eric Dumazet
On 7/23/20 1:14 PM, Gong, Sishuai wrote: > Hi, > > We found a concurrency bug in linux kernel 5.3.11. We were able to reproduce > this bug in x86 when the kernel is compiled with non-standard GCC options and > under specific thread interleavings. This bug causes a page fault that the > kerne

PROBLEM: potential concurrency bug in rhashtable.h

2020-07-23 Thread Gong, Sishuai
Hi, We found a concurrency bug in linux kernel 5.3.11. We were able to reproduce this bug in x86 when the kernel is compiled with non-standard GCC options and under specific thread interleavings. This bug causes a page fault that the kernel can’t handle due to an illegal memory access (“BUG: un