netfilter: x_tables: ensure readers see new ->private value
Subsystems (2)
Florian Westphal
maintainerPATCH 1/1 netfilter: x_tables: ensure readers see new ->private value
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 <[email protected]>
Signed-off-by Florian Westphal <[email protected]>
--- net/netfilter/x_tables.c | 3 +++ 1 file changed, 3 insertions(+)
net/netfilter/x_tables.c +3 -0
@@ -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
Signature · 1 line
2.13.6
Quoted 10 lines · Florian Westphal
Eric Dumazet wrote:
But it seems we need an extrasmp_wmb()aftersmp_wmb(); table->private = newinfo;Otherwise we have no guarantee other cpus actually see the new ->private value.
Suggested-by Eric Dumazet <[email protected]>Signed-off-by Florian Westphal <[email protected]>
I do not believe this change is needed in net (or nf) tree. See my other reply.