Re: [ovs-dev] [PATCH v4] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-05-27 Thread Eiichi Tsukata
Hello Ilya > On May 28, 2020, at 7:28, Ilya Maximets wrote: > > On 5/27/20 4:13 AM, Eiichi Tsukata wrote: >> Currently classifier tries and n_tries can be updated not atomically, >> there is a race condition which can lead to NULL dereference. >> The race can happen

[ovs-dev] [PATCH v4] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-05-26 Thread Eiichi Tsukata
;classifier: Remove internal mutex."), this patch makes trie field RCU protected and checks it after read. Fixes: fccd7c092e09 ("classifier: Remove internal mutex.") Signed-off-by: Eiichi Tsukata --- lib/classifier.c| 40 +--- lib/classi

Re: [ovs-dev] [PATCH v3 RESEND] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-05-26 Thread Eiichi Tsukata
Hello Ilya Thanks for comments! Replied inline. > On May 27, 2020, at 1:28, Ilya Maximets wrote: > > On 5/18/20 1:06 AM, Eiichi Tsukata wrote: >> >> >> diff --git a/lib/classifier.c b/lib/classifier.c >> index 0fad953..10909a6 100644 >> --- a/lib

[ovs-dev] [PATCH v3 RESEND] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-05-17 Thread Eiichi Tsukata
;classifier: Remove internal mutex."), this patch makes trie field RCU protected and checks it after read. Fixes: fccd7c092e09 ("classifier: Remove internal mutex.") Signed-off-by: Eiichi Tsukata --- lib/classifier.c| 37 ++--- lib/classi

Re: [ovs-dev] [PATCH v3] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-05-11 Thread Eiichi Tsukata
Hello Ilya, Could you review the patch? Thanks Eiichi > On Apr 30, 2020, at 14:16, Eiichi Tsukata wrote: > > Currently classifier tries and n_tries can be updated not atomically, > there is a race condition which can lead to NULL dereference. > The race can happen when main t

[ovs-dev] [PATCH v3] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-04-29 Thread Eiichi Tsukata
;classifier: Remove internal mutex."), this patch makes trie field RCU protected and checks it after read. Fixes: fccd7c092e09 ("classifier: Remove internal mutex.") Signed-off-by: Eiichi Tsukata --- lib/classifier.c| 37 ++--- lib/classi

Re: [ovs-dev] [PATCH v2] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-04-29 Thread Eiichi Tsukata
Thanks for comments Ilya, > On Apr 29, 2020, at 20:17, Ilya Maximets wrote: > > On 4/22/20 10:36 AM, Eiichi Tsukata wrote: >> Currently classifier tries and n_tries can be updated not atomically, >> there is a race condition which can lead to NULL dereference. >> Th

[ovs-dev] [PATCH v2] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-04-22 Thread Eiichi Tsukata
;classifier: Remove internal mutex."), this patch makes trie field RCU protected and checks it after read. Fixes: fccd7c092e09 ("classifier: Remove internal mutex.") Signed-off-by: Eiichi Tsukata --- lib/classifier.c| 36 ++-- lib/classifier.h

Re: [ovs-dev] [PATCH] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-04-19 Thread Eiichi Tsukata
> On Apr 18, 2020, at 1:14, Ilya Maximets wrote: > > On 4/15/20 2:24 AM, Eiichi Tsukata wrote: >> Thanks for comments, Ilya. >> >>> On Apr 14, 2020, at 21:11, Ilya Maximets wrote: >>> >>> On 4/14/20 6:00 AM, Eiichi Tsukata wrote: >>>

Re: [ovs-dev] [PATCH] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-04-14 Thread Eiichi Tsukata
Thanks for comments, Ilya. > On Apr 14, 2020, at 21:11, Ilya Maximets wrote: > > On 4/14/20 6:00 AM, Eiichi Tsukata wrote: >> >> >> @@ -1575,11 +1573,16 @@ check_tries(struct trie_ctx trie_ctx[CLS_MAX_TRIES], >> unsigned int n_tries, >> * fields u

[ovs-dev] [PATCH] classifier: Prevent tries vs n_tries race leading to NULL dereference.

2020-04-13 Thread Eiichi Tsukata
;classifier: Remove internal mutex."), this patch uses trie field after it checked subtable trie_plen is synchronized with field. This leaves classifier lookup lockless and prevent the NULL deref. Fixes: fccd7c092e09 ("classifier: Remove internal mutex.") Signed-off-by: Eiichi T