[PATCH net] net/sched: act_police: fix memory leak in case of invalid control action

2018-11-28 Thread Davide Caratti
71f2>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [<450c38ef>] 0x change tcf_police_init() to avoid leaking 'new' in case TCA_POLICE_RESULT contains TC_ACT_GOTO_CHAIN extended action. Fixes: c08f5ed5d625 ("net/sched: act_police: disallow 'goto chain' on fallback

[PATCH net] net/sched: act_police: add missing spinlock initialization

2018-11-21 Thread Davide Caratti
000 Fixes: f2cbd4852820 ("net/sched: act_police: fix race condition on state variables") Reported-by: Cong Wang Signed-off-by: Davide Caratti --- net/sched/act_police.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sched/act_police.c b/net/sched/act_police.c index e

Re: [PATCH net v2] net/sched: act_police: fix race condition on state variables

2018-11-21 Thread Davide Caratti
On Tue, 2018-11-20 at 20:13 -0800, Cong Wang wrote: > On Tue, Nov 20, 2018 at 3:30 PM Eric Dumazet wrote: > > On Tue, Nov 20, 2018 at 3:28 PM David Miller wrote: > > > Applied. > > > > We need a fix to make lockdep happy, as reported by Cong. > > > > Cong, do you want to handle this ? > > >

[PATCH net v2] net/sched: act_police: fix race condition on state variables

2018-11-20 Thread Davide Caratti
f tcf_lock - improve cache-line usage Fixes: 2d550dbad83c ("net/sched: act_police: don't use spinlock in the data path") Reported-and-suggested-by: Eric Dumazet Signed-off-by: Davide Caratti --- net/sched/act_police.c | 35 +-- 1 file changed, 21 inserti

Re: [PATCH net-next 2/2] net/sched: act_police: don't use spinlock in the data path

2018-11-16 Thread Davide Caratti
On Thu, 2018-11-15 at 05:53 -0800, Eric Dumazet wrote: > > On 11/15/2018 03:43 AM, Davide Caratti wrote: > > On Wed, 2018-11-14 at 22:46 -0800, Eric Dumazet wrote: > > > On 09/13/2018 10:29 AM, Davide Caratti wrote: > > > > use RCU instead of spinlocks,

Re: [PATCH net-next 2/2] net/sched: act_police: don't use spinlock in the data path

2018-11-15 Thread Davide Caratti
On Wed, 2018-11-14 at 22:46 -0800, Eric Dumazet wrote: > > On 09/13/2018 10:29 AM, Davide Caratti wrote: > > use RCU instead of spinlocks, to protect concurrent read/write on > > act_police configuration. This reduces the effects of contention in the > > data path,

[PATCH net] net/sched: act_pedit: fix memory leak when IDR allocation fails

2018-11-14 Thread Davide Caratti
tcf_idr_check_alloc() can return a negative value, on allocation failures (-ENOMEM) or IDR exhaustion (-ENOSPC): don't leak keys_ex in these cases. Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action") Signed-off-by: Davide Caratti --- net/sched/act_pedit.c | 3 +

[PATCH net-next] net: vlan: add support for tunnel offload

2018-11-07 Thread Davide Caratti
Signed-off-by: Davide Caratti --- net/8021q/vlan.c | 1 + net/8021q/vlan.h | 12 net/8021q/vlan_dev.c | 2 ++ 3 files changed, 15 insertions(+) diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 5e9950453955..1b7a375c6616 100644 --- a/net/8021q/vlan.c +++ b/net/80

[PATCH RFC net-next] net: vlan: add support for tunnel offload

2018-11-02 Thread Davide Caratti
Signed-off-by: Davide Caratti --- net/8021q/vlan.c | 1 + net/8021q/vlan.h | 12 net/8021q/vlan_dev.c | 2 ++ 3 files changed, 15 insertions(+) diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 5e9950453955..1b7a375c6616 100644 --- a/net/8021q/vlan.c +++ b/net/80

Re: [PATCH net v2] net/sched: act_gact: properly init 'goto chain'

2018-10-20 Thread Davide Caratti
hello Cong and Jamal, On Fri, 2018-10-19 at 13:40 -0700, Cong Wang wrote: > On Thu, Oct 18, 2018 at 8:30 AM Davide Caratti wrote: > > The alternative is, we systematically forbid usage of 'goto chain' in > > tcfg_paction, so that: > > > > # tc f a dev v0 egress mat

[PATCH net 1/4] net/sched: act_gact: disallow 'goto chain' on fallback control action

2018-10-20 Thread Davide Caratti
in the following command: # tc action add action random 'goto chain x' is allowed only for c1: setting it for c2 makes the kernel crash with NULL pointer dereference, since TC core doesn't initialize the chain handle. Signed-off-by: Davide Caratti --- net/sched/act_gact.c | 5 + 1

[PATCH net 4/4] tc-tests: test denial of 'goto chain' for exceed traffic in police.json

2018-10-20 Thread Davide Caratti
add test to verify if act_police forbids 'goto chain' control actions for 'exceed' traffic. Signed-off-by: Davide Caratti --- .../tc-testing/tc-tests/actions/police.json | 24 +++ 1 file changed, 24 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests

[PATCH net 2/4] net/sched: act_police: disallow 'goto chain' on fallback control action

2018-10-20 Thread Davide Caratti
in the following command: # tc action add action police rate burst conform-exceed / 'goto chain x' is allowed only for c1: setting it for c2 makes the kernel crash with NULL pointer dereference, since TC core doesn't initialize the chain handle. Signed-off-by: Davide Caratti --- net/sched

[PATCH net 3/4] tc-tests: test denial of 'goto chain' on 'random' traffic in gact.json

2018-10-20 Thread Davide Caratti
add test to verify if act_gact forbids 'goto chain' control actions on 'random' traffic in gact.json. Signed-off-by: Davide Caratti --- .../tc-testing/tc-tests/actions/gact.json | 24 +++ 1 file changed, 24 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc

[PATCH net 0/4] net/sched: forbid 'goto_chain' on fallback actions

2018-10-20 Thread Davide Caratti
rs try to set 'goto chain x' in the fallback action. Patch 3/4 and 4/4 add TDC selftest coverage to this new behavior. Davide Caratti (4): net/sched: act_gact: disallow 'goto chain' on fallback control action net/sched: act_police: disallow 'goto chain' on fallback control action tc-tests

Re: [PATCH net v2] net/sched: act_gact: properly init 'goto chain'

2018-10-18 Thread Davide Caratti
hello Jamal, On Thu, 2018-10-18 at 08:52 -0400, Jamal Hadi Salim wrote: > Rejection is a good solution[1]. > Would be helpful to set an ext_ack to something like > "only one goto chain is supported currently" ok, that's material for a v3, if you / Cong / others are ok with the other hunks. On

[PATCH net v2] net/sched: act_gact: properly init 'goto chain'

2018-10-18 Thread Davide Caratti
- reject 'goto action' if it is specified twice in the same gact rule Fixes: db50514f9a9c ("net: sched: add termination action to allow goto chain") Signed-off-by: Davide Caratti --- include/net/tc_act/tc_gact.h | 11 +-- net/sched/act_gact.c | 19 ++- 2 files change

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-18 Thread Davide Caratti
On Wed, 2018-10-17 at 22:35 -0700, Cong Wang wrote: > > (well, after some more thinking I looked again at that patch and yes, it > > lacked the most important thing:) > > Hmm, as I said, I am not sure if the logic is correct, if we have two > different > goto actions, we must have two pointers.

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-16 Thread Davide Caratti
On Mon, 2018-10-15 at 11:31 -0700, Cong Wang wrote: > On Sat, Oct 13, 2018 at 8:23 AM Davide Caratti wrote: > > > > On Fri, 2018-10-12 at 13:57 -0700, Cong Wang wrote: > > > Why not just validate the fallback action in each action init()? > > > For example, check

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-14 Thread Davide Caratti
On Sun, 2018-10-14 at 09:46 -0400, Jamal Hadi Salim wrote: > On 2018-10-13 11:23 a.m., Davide Caratti wrote: > > > > A (legal?) trick is to let tcf_action store the fallback action when it > > contains a 'goto chain' command, I just posted a proposal for gact. If you

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-13 Thread Davide Caratti
On Fri, 2018-10-12 at 13:57 -0700, Cong Wang wrote: > Why not just validate the fallback action in each action init()? > For example, checking tcfg_paction in tcf_gact_init(). > > I don't see the need of making it generic. hello Cong, once again thanks for looking at this. what you say is

[PATCH net] net/sched: act_gact: properly init 'goto chain'

2018-10-13 Thread Davide Caratti
goto_chain handle per action: ensure that gact never contains more than one 'goto chain' in a rule. If the fallback control action is a 'goto chain', copy it to tcf_action to ensure that goto_chain is properly initialized. Fixes: db50514f9a9c ("net: sched: add termination action to allow goto ch

[PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-12 Thread Davide Caratti
goto_chain' handle per action: extend act_api to disallow 'goto chain' specified more than once in a rule. If the fallback control action is legally configured, use it to properly initialize the chain. Fixes: db50514f9a9c ("net: sched: add termination action to allow goto chain") Signed-off-

[PATCH net v3] net/sched: cls_api: add missing validation of netlink attributes

2018-10-10 Thread Davide Caratti
1e39 ("net: sched: introduce multichain support for filters") Signed-off-by: Davide Caratti --- net/sched/cls_api.c | 13 - net/sched/sch_api.c | 8 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 0a75cb

[PATCH net v2] net/sched: cls_api: add missing validation of netlink attributes

2018-10-09 Thread Davide Caratti
on, thanks to David Ahern Fixes: 5bc1701881e39 ("net: sched: introduce multichain support for filters") Signed-off-by: Davide Caratti --- include/net/sch_generic.h | 2 ++ net/sched/cls_api.c | 11 ++- net/sched/sch_api.c | 1 + 3 files changed, 9 insert

Re: [PATCH net] net/sched: cls_api: add missing validation of netlink attributes

2018-10-09 Thread Davide Caratti
On Tue, 2018-10-09 at 08:46 -0600, David Ahern wrote: > On 10/9/18 7:10 AM, Davide Caratti wrote: > > Similarly to what has been done in 8b4c3cdd9dd8 ("net: sched: Add policy > > validation for tc attributes"), add validation for TCA_CHAIN and TCA_KIND > > netl

[PATCH net] net/sched: cls_api: add missing validation of netlink attributes

2018-10-09 Thread Davide Caratti
rs") Signed-off-by: Davide Caratti --- net/sched/cls_api.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 0a75cb2e5e7b..fb1afc0e130d 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -37,6 +37,11

[PATCH net-next 2/2] tc-testing: use a plugin to build eBPF program

2018-10-04 Thread Davide Caratti
use a TDC plugin, instead of building eBPF programs in the 'setup' stage. '-B' argument can be used to build eBPF programs in $EBPFDIR directory, in the 'pre-suite' stage. Binaries are then cleaned in 'post-suite' stage. Signed-off-by: Davide Caratti --- tools/testing/selftests/tc-testing

[PATCH net-next 0/2] TDC fixes for eBPF actions

2018-10-04 Thread Davide Caratti
Lucas and Roman reported TDC errors while testing act_bpf with TDC: - patch 1/2 fixes the reported problem (include of wrong headers). - patch 2/2 allows building eBPF test programs for TDC using a plugin. Davide Caratti (2): tc-testing: fix build of eBPF programs tc-testing: use a plugin

[PATCH net-next 1/2] tc-testing: fix build of eBPF programs

2018-10-04 Thread Davide Caratti
rely on uAPI headers in the current kernel tree, rather than requiring the correct version installed on the test system. While at it, group all sections in a single binary and test the 'section' parameter. Reported-by: Lucas Bates Signed-off-by: Davide Caratti --- .../testing/selftests/tc

Re: [PATCH iproute2-next] tc: flower: expose hardware offload count

2018-10-03 Thread Davide Caratti
On Wed, 2018-10-03 at 18:29 +0300, Vlad Buslov wrote: > Recently flower classifier was updated to expose count of devices that > filter is offloaded to. Add support to print this counter as 'in_hw_count'. > > Signed-off-by: Vlad Buslov > Acked-by: Jiri Pirko > --- > tc/f_flower.c | 10

[PATCH net] be2net: don't flip hw_features when VXLANs are added/deleted

2018-10-03 Thread Davide Caratti
n port. So, it's safe to avoid flipping the above feature on addition/deletion of VXLAN tunnels. Fixes: 630f4b70567f ("be2net: Export tunnel offloads only when a VxLAN tunnel is created") Signed-off-by: Davide Caratti --- drivers/net/ethernet/emulex/benet/be_main.c | 5 + 1 file

[PATCH net] bnxt_en: don't try to offload VLAN 'modify' action

2018-09-19 Thread Davide Caratti
bnxt offload code currently supports only 'push' and 'pop' operation: let .ndo_setup_tc() return -EOPNOTSUPP if VLAN 'modify' action is configured. Fixes: 2ae7408fedfe ("bnxt_en: bnxt: add TC flower filter offload support") Signed-off-by: Davide Caratti --- drivers/net/ethernet/bro

[PATCH net] net/sched: act_sample: fix NULL dereference in the data path

2018-09-14 Thread Davide Caratti
wrong value of 'cpustats'. Setting it to true proved to fix the reported crash. Reported-by: Matteo Croce Fixes: 65a206c01e8e ("net/sched: Change act_api and act_xxx modules to use IDR") Fixes: 5c5670fae430 ("net/sched: Introduce sample tc action") Tested-by: Matteo Croce Sig

[PATCH net-next 1/2] net/sched: act_police: use per-cpu counters

2018-09-13 Thread Davide Caratti
use per-CPU counters, instead of sharing a single set of stats with all cores. This removes the need of using spinlock when statistics are read or updated. Signed-off-by: Davide Caratti --- net/sched/act_police.c | 46 -- 1 file changed, 22 insertions

[PATCH net-next 2/2] net/sched: act_police: don't use spinlock in the data path

2018-09-13 Thread Davide Caratti
use RCU instead of spinlocks, to protect concurrent read/write on act_police configuration. This reduces the effects of contention in the data path, in case multiple readers are present. Signed-off-by: Davide Caratti --- net/sched/act_police.c | 156 - 1

[PATCH net-next 0/2] net/sched: act_police: lockless data path

2018-09-13 Thread Davide Caratti
one test results (avg. pps/thread): $c | before patch | after patch | improvement +--+--+- 1 | 3518448 | 3591240 | irrelevant 2 | 3070065 | 3383393 | 10% 4 | 1540969 | 3238385 | 110% Davide Caratti (

[PATCH net] net/sched: fix memory leak in act_tunnel_key_init()

2018-09-04 Thread Davide Caratti
or when the kernel fails to allocate 'params_new'. Ensure that tunnel_key_init() releases the tunnel metadata also in the above conditions. Addresses-Coverity-ID: 1373974 ("Resource leak") Fixes: d0f6dd8a914f4 ("net/sched: Introduce act_tunnel_key") Fixes: 0ed5269f9e41f ("

[PATCH net] net/sched: act_pedit: fix dump of extended layered op

2018-08-27 Thread Davide Caratti
g offset relative to the conventional network headers") Signed-off-by: Davide Caratti --- net/sched/act_pedit.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 107034070019..ad99a99f11f6 100644 --- a/net/sched/act_p

[PATCH net-next v2 0/2] net/sched: act_skbedit: lockless data path

2018-07-11 Thread Davide Caratti
$c | before patch | after patch | improvement +--+--+ 1 | 3917464 ± 3% | 4000458 ± 3% | irrelevant 2 | 3455367 ± 4% | 3953076 ± 1% |+14% 4 | 2496594 ± 2% | 3801123 ± 3% |+52% v2: rebased on latest net-next Davide Caratti (2):

[PATCH net-next v2 2/2] net/sched: act_skbedit: don't use spinlock in the data path

2018-07-11 Thread Davide Caratti
use RCU instead of spin_{,un}lock_bh, to protect concurrent read/write on act_skbedit configuration. This reduces the effects of contention in the data path, in case multiple readers are present. Signed-off-by: Davide Caratti --- include/net/tc_act/tc_skbedit.h | 37 --- net/sched

[PATCH net-next v2 1/2] net/sched: skbedit: use per-cpu counters

2018-07-11 Thread Davide Caratti
use per-CPU counters, instead of sharing a single set of stats with all cores: this removes the need of spinlocks when stats are read/updated. Signed-off-by: Davide Caratti --- net/sched/act_skbedit.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/sched

[PATCH net 1/2] net/sched: act_csum: fix NULL dereference when 'goto chain' is used

2018-07-06 Thread Davide Caratti
nel panic - not syncing: Fatal exception in interrupt ]--- Fixes: 9c5f69bbd75a ("net/sched: act_csum: don't use spinlock in the fast path") Signed-off-by: Davide Caratti --- include/net/tc_act/tc_csum.h | 1 - net/sched/act_csum.c | 6 +++--- 2 files changed, 3 insertions(+),

[PATCH net 2/2] net/sched: act_tunnel_key: fix NULL dereference when 'goto chain' is used

2018-07-06 Thread Davide Caratti
ion range: 0x8000-0xbfff) ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]--- Fixes: d0f6dd8a914f ("net/sched: Introduce act_tunnel_key") Signed-off-by: Davide Caratti --- include/net/tc_act/tc_tunnel_key.h | 1 - net/sched/act_tunnel_key.

[PATCH net 0/2] net/sched: fix NULL dereference in 'goto chain' control action

2018-07-06 Thread Davide Caratti
on the other TC actions (it's present even on actions where the spinlock is still used), storing the control action in the common area should be acceptable for tunnel_key and csum as well. [1] https://www.spinics.net/lists/netdev/msg472047.html Davide Caratti (2): net/sched: act_csum: fix NULL dereference

[PATCH net-next 2/2] net/sched: act_skbedit: don't use spinlock in the data path

2018-07-06 Thread Davide Caratti
use RCU instead of spin_{,un}lock_bh, to protect concurrent read/write on act_skbedit configuration. This reduces the effects of contention in the data path, in case multiple readers are present. Signed-off-by: Davide Caratti --- include/net/tc_act/tc_skbedit.h | 37 --- net/sched

[PATCH net-next 1/2] net/sched: skbedit: use per-cpu counters

2018-07-06 Thread Davide Caratti
use per-CPU counters, instead of sharing a single set of stats with all cores: this removes the need of spinlocks when stats are read/updated. Signed-off-by: Davide Caratti --- net/sched/act_skbedit.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/sched

[PATCH net-next 0/2] net/sched: act_skbedit: lockless data path

2018-07-06 Thread Davide Caratti
$c | before patch | after patch | improvement +--+--+ 1 | 3917464 ± 3% | 4000458 ± 3% | irrelevant 2 | 3455367 ± 4% | 3953076 ± 1% |+14% 4 | 2496594 ± 2% | 3801123 ± 3% |+52% Davide Caratti (2): net/sched: skbedit: use p

Re: [PATCHv2 net-next 1/2] route: add support for directed broadcast forwarding

2018-07-02 Thread Davide Caratti
oto no_route; > } > > - if (res->type == RTN_BROADCAST) > + if (res->type == RTN_BROADCAST) { > + if (IN_DEV_BFORWARD(in_dev)) > + goto make_route; > goto brd_input; > + } > > if (res->type == RTN_LOCAL) { > err = fib_validate_source(skb, saddr, daddr, tos, > @@ -2014,6 +2017,7 @@ static int ip_route_input_slow(struct sk_buff *skb, > __be32 daddr, __be32 saddr, > if (res->type != RTN_UNICAST) > goto martian_destination; > > +make_route: > err = ip_mkroute_input(skb, res, in_dev, daddr, saddr, tos, flkeys); > out: return err; > Acked-by: Davide Caratti

Re: [PATCH net-next 1/1] tc-testing: initial version of tunnel_key unit tests

2018-06-28 Thread Davide Caratti
hello Lucas, On Wed, 2018-06-27 at 14:50 -0400, Lucas Bates wrote: > On Tue, Jun 26, 2018 at 10:51 AM, Davide Caratti wrote: > > On Tue, 2018-06-26 at 09:17 -0400, Keara Leibovitz wrote: > > > Create unittests for the tc tunnel_key action. > > > > > >

Re: [PATCH v2 net-next 0/6] net sched actions: code style cleanup and fixes

2018-06-28 Thread Davide Caratti
xt >- added Reviewed-by tags > - use u8* instead of char* as per Davide Caratti suggestion > > Roman Mashak (6): > net sched actions: fix coding style in pedit action > net sched actions: fix coding style in pedit headers > net sched actions: fix sparse warning >

Re: [PATCH net-next 1/1] tc-testing: initial version of tunnel_key unit tests

2018-06-26 Thread Davide Caratti
On Tue, 2018-06-26 at 09:17 -0400, Keara Leibovitz wrote: > Create unittests for the tc tunnel_key action. > > > Signed-off-by: Keara Leibovitz > --- > .../tc-testing/tc-tests/actions/tunnel_key.json| 676 > + > 1 file changed, 676 insertions(+) > create mode 100644

Re: [PATCH v5 net-next] net:sched: add action inheritdsfield to skbedit

2018-06-21 Thread Davide Caratti
On Thu, 2018-06-21 at 15:50 +, Fu, Qiaobin wrote: > The new action inheritdsfield copies the field DS of > IPv4 and IPv6 packets into skb->priority. This enables > later classification of packets based on the DS field. > > v5: > *Update the drop counter for TC_ACT_SH

Re: [PATCH v4 net-next] net:sched: add action inheritdsfield to skbedit

2018-06-20 Thread Davide Caratti
On Wed, 2018-06-20 at 12:47 -0400, Michel Machado wrote: > On 06/20/2018 12:08 PM, Davide Caratti wrote: > > On Tue, 2018-06-12 at 15:42 +, Fu, Qiaobin wrote: > > > The new action inheritdsfield copies the field DS of > > > IPv4 and IPv6 packets into skb->prio

Re: [PATCH v4 net-next] net:sched: add action inheritdsfield to skbedit

2018-06-20 Thread Davide Caratti
On Tue, 2018-06-12 at 15:42 +, Fu, Qiaobin wrote: > The new action inheritdsfield copies the field DS of > IPv4 and IPv6 packets into skb->priority. This enables > later classification of packets based on the DS field. > > v4: > *Not allow setting flags other than the expected ones. > >

Re: [PATCH net 1/5] net sched actions: fix coding style in pedit action

2018-06-20 Thread Davide Caratti
On Tue, 2018-06-19 at 12:56 -0400, Roman Mashak wrote: > Fix coding style issues in tc pedit action detected by the > checkpatch script. > > Signed-off-by: Roman Mashak ... > --- > @@ -316,16 +318,15 @@ static int tcf_pedit(struct sk_buff *skb, const struct > tc_action *a, >

[PATCH net] net/sched: act_ife: preserve the action control in case of error

2018-06-19 Thread Davide Caratti
, to ensure it is not overwritten in the error path of tcf_ife_init(). Fixes: ef6980b6becb ("introduce IFE action") Signed-off-by: Davide Caratti --- net/sched/act_ife.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/sched/act_ife.c b/net/sched/act_i

[PATCH net] net/sched: act_ife: fix recursive lock and idr leak

2018-06-19 Thread Davide Caratti
00066c100 Fixes: 4e8c86155010 ("net sched: net sched: ife action fix late binding") Fixes: ef6980b6becb ("introduce IFE action") Signed-off-by: Davide Caratti --- net/sched/act_ife.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/net/sched/act_ife.

[PATCH net] tc-testing: ife: fix wrong teardown command in test b7b8

2018-06-11 Thread Davide Caratti
fix failures in the 'teardown' stage of test b7b8, probably a leftover of commit 7c5995b33d6e ("tc-testing: fixed copy-pasting error in ife tests") Fixes: a56e6bcd34b55 ("tc-testing: updated ife test cases") Signed-off-by: Davide Caratti --- tools/testing/selftests/tc-test

Re: WARNING in smc_unhash_sk

2018-06-11 Thread Davide Caratti
On Fri, 2018-06-08 at 09:53 +0200, Dmitry Vyukov wrote: > On Tue, Feb 27, 2018 at 1:23 PM, Davide Caratti wrote: > > On Fri, 2018-02-23 at 07:59 -0800, syzbot wrote: > > > Hello, > > > > > > syzbot hit the following crash on upstream commit > > >

[PATCH net v2] net/sched: act_simple: fix parsing of TCA_DEF_DATA

2018-06-07 Thread Davide Caratti
tlink policy.") Signed-off-by: Davide Caratti --- net/sched/act_simple.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 9618b4a83cee..98c4afe7c15b 100644 --- a/net/sched/act_simple.c +++ b/net/sched/ac

Re: [PATCH net] net/sched: act_simple: fix parsing of TCA_DEFDATA

2018-06-07 Thread Davide Caratti
On Fri, 2018-06-08 at 10:07 +0800, Hangbin Liu wrote: > On Thu, Jun 07, 2018 at 03:46:43PM +0200, Davide Caratti wrote: > > use nla_strlcpy() to avoid copying data beyond the length of TCA_DEFDATA > > s/TCA_DEFDATA/TCA_DEF_DATA/, incase someone search the commit history but &

[PATCH net] net/sched: act_simple: fix parsing of TCA_DEFDATA

2018-06-07 Thread Davide Caratti
use nla_strlcpy() to avoid copying data beyond the length of TCA_DEFDATA netlink attribute, in case it is less than SIMP_MAX_DATA and it does not end with '\0' character. Fixes: 0eff683f737b ("net/sched: potential data corruption") Signed-off-by: Davide Caratti --- net/sched/act_sim

[PATCH net-next] vrf: add CRC32c offload to device features

2018-05-24 Thread Davide Caratti
-- -m 10K the measured throughput in Mbit/s improved from 2395 ± 1% to 2720 ± 1%. [1] https://www.spinics.net/lists/netdev/msg486007.html Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/net/vrf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-16 Thread Davide Caratti
On Wed, 2018-05-16 at 13:36 -0400, Roman Mashak wrote: > Vlad Buslov writes: > > > On Wed 16 May 2018 at 14:38, Roman Mashak wrote: > > > On Wed, May 16, 2018 at 2:43 AM, Vlad Buslov wrote: > > > > > > > > I'm trying to run tdc, but

[PATCH net] net/sched: fix refcnt leak in the error path of tcf_vlan_init()

2018-05-16 Thread Davide Caratti
ing") CC: Roman Mashak <m...@mojatatu.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_vlan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 853604685965..1fb39e1f9d07 100644 --- a/net/sched/act_v

[PATCH net] tc-testing: fix tdc tests for 'bpf' action

2018-05-09 Thread Davide Caratti
, causing false positive in case the BPF JIT is enabled Fixes: 440ea4ae1828 ("tc-testing: add selftests for 'bpf' action") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json | 11 --- 1 file changed, 8 insertions

Re: [PATCH V2 net-next 6/6] ipvlan: Add support for SCTP checksum offload

2018-05-02 Thread Davide Caratti
ipvlan/ipvlan_main.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Acked-by: Davide Caratti <dcara...@redhat.com> > diff --git a/drivers/net/ipvlan/ipvlan_main.c > b/drivers/net/ipvlan/ipvlan_main.c > index 450eec2..ddb1590 100644 > --- a/drivers/net

[PATCH net-next] selftest: tc_flower: add testcase for 'ip_flags'

2018-04-16 Thread Davide Caratti
Signed-off-by: Davide Caratti <dcara...@redhat.com> --- .../testing/selftests/net/forwarding/tc_flower.sh | 70 ++ 1 file changed, 70 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/tc_flower.sh b/tools/testing/selftests/net/forwarding/tc_flower.sh

[PATCH net] net/sched: fix NULL dereference in the error path of tcf_bpf_init()

2018-04-05 Thread Davide Caratti
") Reported-by: Lucas Bates <luc...@mojatatu.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_bpf.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index 9092531d45d8..18089c0

Re: Kernel bug from adding bpf actions in tc

2018-04-05 Thread Davide Caratti
On Thu, 2018-04-05 at 11:23 -0400, Lucas Bates wrote: > Hi Davide, > > Our overnight tc test runs of net-next revealed a kernel bug on one of > the BPF tests you submitted, d959. The add action completes > successfully, but the bug occurs on the verify when tdc does a get of > the action that

Re: [PATCH net-next 5/5] macvlan/macvtap: Add support for SCTP checksum offload.

2018-04-04 Thread Davide Caratti
On Mon, 2018-04-02 at 09:40 -0400, Vladislav Yasevich wrote: > Since we now have support for software CRC32c offload, turn it on > for macvlan and macvtap devices so that guests can take advantage > of offload SCTP checksums to the host or host hardware. > > Signed-off-by: Vladislav Yasevich

[PATCH net-next] net/sched: act_vlan: declare push_vid with host byte order

2018-03-23 Thread Davide Caratti
__be16 [usertype] push_vid Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_vlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 4595391c2129..41a66effeb5f 100644 --- a/net/sched/act_vlan.c +++ b/net

[PATCH net-next] net/sched: remove tcf_idr_cleanup()

2018-03-23 Thread Davide Caratti
tcf_idr_cleanup() is no more used, so remove it. Suggested-by: Cong Wang <xiyou.wangc...@gmail.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/net/act_api.h | 1 - net/sched/act_api.c | 8 2 files changed, 9 deletions(-) diff --git a/include/net

[PATCH net-next v2] tc-testing: add selftests for 'bpf' action

2018-03-22 Thread Davide Caratti
-by: Davide Caratti <dcara...@redhat.com> --- .../selftests/tc-testing/tc-tests/actions/bpf.json | 289 + 1 file changed, 289 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json diff --git a/tools/testing/selftests/tc-testing/tc

[PATCH net v2 6/7] net/sched: fix idr leak in the error path of tcf_vlan_init()

2018-03-19 Thread Davide Caratti
# # rmmod act_vlan rmmod: ERROR: Module act_vlan is in use Fixes: 4c5b9d9642c8 ("act_vlan: VLAN action rewrite to use RCU lock/unlock and update") Fixes: 65a206c01e8e ("net/sched: Change act_api and act_xxx modules to use IDR") Acked-by: Jamal Hadi Salim <j...@mojatatu.com> Sig

[PATCH net v2 4/7] net/sched: fix idr leak in the error path of tcp_pedit_init()

2018-03-19 Thread Davide Caratti
u.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_pedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 349beaffb29e..fef08835f26d 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pe

[PATCH net v2 5/7] net/sched: fix idr leak in the error path of __tcf_ipt_init()

2018-03-19 Thread Davide Caratti
r_release() in place of tcf_idr_cleanup(). Since tcf_ipt_release() can now be called when tcfi_t is NULL, we also need to protect calls to ipt_destroy_target() to avoid NULL pointer dereference. Fixes: 65a206c01e8e ("net/sched: Change act_api and act_xxx modules to use IDR") Ack

[PATCH net v2 3/7] net/sched: fix idr leak in the error path of tcf_act_police_init()

2018-03-19 Thread Davide Caratti
@mojatatu.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_police.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 95d3c9097b25..faebf82b99f1 100644 --- a/net/sched/act_police.c +++ b/

[PATCH net v2 1/7] net/sched: fix idr leak on the error path of tcf_bpf_init()

2018-03-19 Thread Davide Caratti
dules to use IDR") Acked-by: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index b3f2c15affa7..9d2cabf1dc7e

[PATCH net v2 7/7] net/sched: fix idr leak in the error path of tcf_skbmod_init()

2018-03-19 Thread Davide Caratti
t_xxx modules to use IDR") Acked-by: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_skbmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index d09565d6433

[PATCH net v2 2/7] net/sched: fix idr leak in the error path of tcf_simp_init()

2018-03-19 Thread Davide Caratti
...@gmail.com> Acked-by: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 425eac11f6da..b1f3806

[PATCH net v2 0/7] fix idr leak in actions

2018-03-19 Thread Davide Caratti
This series fixes situations where a temporary failure to install a TC action results in the permanent impossibility to reuse the configured value of 'index'. Thanks to Cong Wang for the initial review. v2: fix build error in act_ipt.c, reported by kbuild test robot Davide Caratti (7): net

[PATCH net-next] tc-testing: add selftests for 'bpf' action

2018-03-18 Thread Davide Caratti
: Add cBPF action with duplicate index Signed-off-by: Davide Caratti <dcara...@redhat.com> --- .../selftests/tc-testing/tc-tests/actions/bpf.json | 215 + 1 file changed, 215 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json diff

[PATCH net 6/7] net/sched: fix idr leak in the error path of tcf_vlan_init()

2018-03-18 Thread Davide Caratti
# # rmmod act_vlan # rmmod: ERROR: Module act_vlan is in use Fixes: 4c5b9d9642c8 ("act_vlan: VLAN action rewrite to use RCU lock/unlock and update") Fixes: 65a206c01e8e ("net/sched: Change act_api and act_xxx modules to use IDR") Signed-off-by: Davide Caratti <dcara...@red

[PATCH net 5/7] net/sched: fix idr leak in the error path of __tcf_ipt_init()

2018-03-18 Thread Davide Caratti
r_release() in place of tcf_idr_cleanup(). Since tcf_ipt_release() can now be called when tcfi_t is NULL, we also need to protect calls to ipt_destroy_target() to avoid NULL pointer dereference. Fixes: 65a206c01e8e ("net/sched: Change act_api and act_xxx modules to use IDR") Signed-off-by

[PATCH net 0/7] fix idr leak in actions

2018-03-18 Thread Davide Caratti
This series fixes situations where a temporary failure to install a TC action results in the permanent impossibility to reuse the configured 'index'. Thanks to Cong Wang for the initial review. Davide Caratti (7): net/sched: fix idr leak on the error path of tcf_bpf_init() net/sched: fix idr

[PATCH net 3/7] net/sched: fix idr leak in the error path of tcf_act_police_init()

2018-03-18 Thread Davide Caratti
drop index 100 RTNETLINK answers: No space left on device ... Fix this in the error path of tcf_act_police_init(), calling tcf_idr_release() in place of tcf_idr_cleanup(). Fixes: 65a206c01e8e ("net/sched: Change act_api and act_xxx modules to use IDR") Signed-off-by: Davide Cara

[PATCH net 4/7] net/sched: fix idr leak in the error path of tcp_pedit_init()

2018-03-18 Thread Davide Caratti
on device We have an error talking to the kernel ... Fix this in the error path of tcf_act_pedit_init(), calling tcf_idr_release() in place of tcf_idr_cleanup(). Fixes: 65a206c01e8e ("net/sched: Change act_api and act_xxx modules to use IDR") Signed-off-by: Davide Caratti <dcara.

[PATCH net 2/7] net/sched: fix idr leak in the error path of tcf_simp_init()

2018-03-18 Thread Davide Caratti
...@gmail.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 425eac11f6da..b1f38063ada0 100644 --- a/net/sched/act_simple.c +++ b/

[PATCH net 1/7] net/sched: fix idr leak on the error path of tcf_bpf_init()

2018-03-18 Thread Davide Caratti
dules to use IDR") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index b3f2c15affa7..9d2cabf1dc7e 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act

[PATCH net 7/7] net/sched: fix idr leak in the error path of tcf_skbmod_init()

2018-03-18 Thread Davide Caratti
t_xxx modules to use IDR") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_skbmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index d09565d6433e..7b0700f52b50 100644 --- a/net/sched/act_skbmod.c

[PATCH net 5/5] net/sched: fix NULL dereference on the error path of tcf_skbmod_init()

2018-03-15 Thread Davide Caratti
leanup(), ensuring that kfree_rcu(p, ...) is called only when p is not NULL. Fixes: 86da71b57383 ("net_sched: Introduce skbmod action") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_skbmod.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ne

[PATCH net 1/5] net/sched: fix NULL dereference in the error path of tcf_vlan_init()

2018-03-15 Thread Davide Caratti
_rcu(p, ...) is called only when p is not NULL. Fixes: 4c5b9d9642c8 ("act_vlan: VLAN action rewrite to use RCU lock/unlock and update") Acked-by: Jiri Pirko <j...@mellanox.com> Acked-by: Manish Kurup <manish.ku...@verizon.com> Signed-off-by: Davide Caratti <dcara...@redhat.com

[PATCH net 3/5] net/sched: fix NULL dereference in the error path of tunnel_key_init()

2018-03-15 Thread Davide Caratti
'param' is not NULL before dereferencing it. Fixes: d0f6dd8a914f ("net/sched: Introduce act_tunnel_key") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_tunnel_key.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/sched/act_tu

[PATCH net 0/5] net/sched: fix NULL dereference in the error path of .init()

2018-03-15 Thread Davide Caratti
with several TC actions it's possible to see NULL pointer dereference, when the .init() function calls tcf_idr_alloc(), fails at some point and then calls tcf_idr_release(): this series fixes all them introducing non-NULL tests in the .cleanup() function. Davide Caratti (5): net/sched: fix NULL

[PATCH net 4/5] net/sched: fix NULL dereference in the error path of tcf_sample_init()

2018-03-15 Thread Davide Caratti
0 CR2: 001c Fix it in tcf_sample_cleanup(), ensuring that calls to psample_group_put(p) are done only when p is not NULL. Fixes: cadb9c9fdbc6 ("net/sched: act_sample: Fix error path in init") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_sa

[PATCH net 2/5] net/sched: fix NULL dereference in the error path of tcf_csum_init()

2018-03-15 Thread Davide Caratti
ee_rcu(param, ...) is called only when param is not NULL. Fixes: 9c5f69bbd75a ("net/sched: act_csum: don't use spinlock in the fast path") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_csum.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [PATCH net] net/sched: fix NULL dereference in the error path of tcf_vlan_init()

2018-03-15 Thread Davide Caratti
On Thu, 2018-03-15 at 15:29 +0100, Davide Caratti wrote: > On Thu, 2018-03-15 at 15:21 +0100, Jiri Pirko wrote: > ... > > > Acked-by: Jiri Pirko <j...@mellanox.com> > > thank you for reviewing! > > apparently, also act_tunnel_key seem and act_csum have

Re: [PATCH net] net/sched: fix NULL dereference in the error path of tcf_vlan_init()

2018-03-15 Thread Davide Caratti
On Thu, 2018-03-15 at 15:21 +0100, Jiri Pirko wrote: ... > Acked-by: Jiri Pirko thank you for reviewing! apparently, also act_tunnel_key seem and act_csum have a similar problem. I will check and eventually do a followup series this afternoon. thank you, regards -- davide

  1   2   3   >