Re: [PATCH nf 2/2] netfilter: nf_tables: add clone interface to expression operations

2015-11-10 Thread Patrick McHardy
On 10.11, Pablo Neira Ayuso wrote: > On Tue, Nov 10, 2015 at 06:58:05PM +, Patrick McHardy wrote: > > On 10.11, Pablo Neira Ayuso wrote: > > > On Tue, Nov 10, 2015 at 06:30:34PM +, Patrick McHardy wrote: > > > > > __module_get(src->ops->type->owner); > > > > > - memcpy(dst, src, s

Re: [PATCH nf 2/2] netfilter: nf_tables: add clone interface to expression operations

2015-11-10 Thread Pablo Neira Ayuso
On Tue, Nov 10, 2015 at 06:58:05PM +, Patrick McHardy wrote: > On 10.11, Pablo Neira Ayuso wrote: > > On Tue, Nov 10, 2015 at 06:30:34PM +, Patrick McHardy wrote: > > > > __module_get(src->ops->type->owner); > > > > - memcpy(dst, src, src->ops->size); > > > > + if (src->

Re: [PATCH nf 2/2] netfilter: nf_tables: add clone interface to expression operations

2015-11-10 Thread Patrick McHardy
On 10.11, Pablo Neira Ayuso wrote: > On Tue, Nov 10, 2015 at 06:30:34PM +, Patrick McHardy wrote: > > > __module_get(src->ops->type->owner); > > > - memcpy(dst, src, src->ops->size); > > > + if (src->ops->clone) { > > > + memcpy(dst, src, sizeof(*src)); > > > > Why copy if we clone?

Re: [PATCH nf 2/2] netfilter: nf_tables: add clone interface to expression operations

2015-11-10 Thread Pablo Neira Ayuso
On Tue, Nov 10, 2015 at 06:30:34PM +, Patrick McHardy wrote: > On 10.11, Pablo Neira Ayuso wrote: > > With the conversion of the counter expressions to make it percpu, we > > need to clone the percpu memory area, otherwise we crash when using > > counters from flow tables. > > > > Signed-off-b

Re: [PATCH nf 2/2] netfilter: nf_tables: add clone interface to expression operations

2015-11-10 Thread Patrick McHardy
On 10.11, Pablo Neira Ayuso wrote: > With the conversion of the counter expressions to make it percpu, we > need to clone the percpu memory area, otherwise we crash when using > counters from flow tables. > > Signed-off-by: Pablo Neira Ayuso > --- > include/net/netfilter/nf_tables.h | 16 +++

[PATCH nf 2/2] netfilter: nf_tables: add clone interface to expression operations

2015-11-10 Thread Pablo Neira Ayuso
With the conversion of the counter expressions to make it percpu, we need to clone the percpu memory area, otherwise we crash when using counters from flow tables. Signed-off-by: Pablo Neira Ayuso --- include/net/netfilter/nf_tables.h | 16 +++-- net/netfilter/nft_counter.c | 49 ++