Re: [PATCH nf] netfilter: x_tables: ensure readers see new ->private value

2017-10-11 Thread Eric Dumazet
On Wed, Oct 11, 2017 at 11:03 AM, Florian Westphal  wrote:
> Eric Dumazet wrote:
>  But it seems we need an extra smp_wmb() after
>   smp_wmb();
>   table->private = newinfo;
>
> Otherwise we have no guarantee other cpus actually see the new
> ->private value.
>
> Suggested-by: Eric Dumazet 
> Signed-off-by: Florian Westphal 

I do not believe this change is needed in net (or nf) tree.
See my other reply.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH nf] netfilter: x_tables: ensure readers see new ->private value

2017-10-11 Thread Florian Westphal
Eric Dumazet wrote:
 But it seems we need an extra smp_wmb() after
  smp_wmb();
  table->private = newinfo;

Otherwise we have no guarantee other cpus actually see the new
->private value.

Suggested-by: Eric Dumazet 
Signed-off-by: Florian Westphal 
---
 net/netfilter/x_tables.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index d8571f414208..64cf669ecd6c 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -1182,6 +1182,9 @@ xt_replace_table(struct xt_table *table,
smp_wmb();
table->private = newinfo;
 
+   /* Ensure other cpus see the new ->private value. */
+   smp_wmb();
+
/*
 * Even though table entries have now been swapped, other CPU's
 * may still be using the old entries. This is okay, because
-- 
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html