Re: [PATCH net 2/2] net/sched: sch_frag: fix stack OOB read while fragmenting IPv4 packets

2021-04-20 Thread Davide Caratti
hello Cong, thanks for looking at this! On Mon, 2021-04-19 at 11:46 -0700, Cong Wang wrote: > On Mon, Apr 19, 2021 at 8:24 AM Davide Caratti wrote: > > diff --git a/net/sched/sch_frag.c b/net/sched/sch_frag.c > > index e1e77d3fb6c0..8c06381391d6 100644 > > --- a/net/sched

[PATCH net 2/2] net/sched: sch_frag: fix stack OOB read while fragmenting IPv4 packets

2021-04-19 Thread Davide Caratti
IPv6 few lines below. Fixes: c129412f74e9 ("net/sched: sch_frag: add generic packet fragment support.") Cc: # 5.11 Reported-by: Shuang Li Signed-off-by: Davide Caratti --- net/sched/sch_frag.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/sched/

[PATCH net 1/2] openvswitch: fix stack OOB read while fragmenting IPv4 packets

2021-04-19 Thread Davide Caratti
v4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmt") Cc: Signed-off-by: Davide Caratti --- net/openvswitch/actions.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index 92a0b67b2728..77d9

[PATCH net 0/2] fix stack OOB read while fragmenting IPv4 packets

2021-04-19 Thread Davide Caratti
- patch 1/2 fixes openvswitch IPv4 fragmentation, that does a stack OOB read after commit d52e5a7e7ca4 ("ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmt") - patch 2/2 fixes the same issue in TC 'sch_frag' code Davide Caratti (2): openvswitch: f

Re: [PATCH net] net/sched: sch_frag: fix OOB read while processing IPv4 fragments

2021-04-19 Thread Davide Caratti
On Fri, 2021-04-16 at 22:29 +0200, Davide Caratti wrote: [...] > > for IPv4 packets, sch_fragment() uses a temporary struct dst_entry. Then, > in the following call graph: > >   ip_fragment() ^^ the above line is a typo, > ip_do_fragment() >

[PATCH net] net/sched: sch_frag: fix OOB read while processing IPv4 fragments

2021-04-16 Thread Davide Caratti
on. Fixes: c129412f74e9 ("net/sched: sch_frag: add generic packet fragment support.") Reported-by: Shuang Li Signed-off-by: Davide Caratti --- net/sched/sch_frag.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/sched/sch_frag.c b/net/sched/sch_frag.

Re: [PATCH] net: sched: Fix potential infinite loop

2021-04-07 Thread Davide Caratti
hello Colin, and thanks for your patch! On Wed, 2021-04-07 at 17:38 +0100, Colin King wrote: > From: Colin Ian King > > The for-loop iterates with a u16 loop counter idx and compares this > with the loop upper limit of q->flows_cnt that is a u32 type. the value of 'flows_cnt' has 65535 as an up

[PATCH net] mptcp: fix ADD_ADDR HMAC in case port is specified

2021-03-15 Thread Davide Caratti
. Fixes: 22fb85ffaefb ("mptcp: add port support for ADD_ADDR suboption writing") Reviewed-by: Mat Martineau Acked-by: Geliang Tang Signed-off-by: Davide Caratti --- net/mptcp/options.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/net/mptcp

Re: 答复: [PATCH] net/sched: act_pedit: fix a NULL pointer deref in tcf_pedit_init

2021-03-09 Thread Davide Caratti
On Tue, 2021-03-09 at 11:24 +, zhudi (J) wrote: > > > > hello, thanks for the patch! > > > > On Tue, 2021-03-09 at 11:47 +0800, zhudi wrote: > > > From: Di Zhu > > > > > > when we use syzkaller to fuzz-test our kernel, one NULL pointer > > dereference > > > BUG happened: > > > > > > Write

Re: [PATCH] net/sched: act_pedit: fix a NULL pointer deref in tcf_pedit_init

2021-03-09 Thread Davide Caratti
hello, thanks for the patch! On Tue, 2021-03-09 at 11:47 +0800, zhudi wrote: > From: Di Zhu > > when we use syzkaller to fuzz-test our kernel, one NULL pointer dereference > BUG happened: > > Write of size 96 at addr 0010 by task syz-executor.0/22376 > ==

[PATCH net] mptcp: fix length of ADD_ADDR with port sub-option

2021-03-08 Thread Davide Caratti
port for ADD_ADDR suboption writing") CC: sta...@vger.kernel.org # 5.11+ Reviewed-by: Mat Martineau Acked-and-tested-by: Geliang Tang Signed-off-by: Davide Caratti --- net/mptcp/protocol.h | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/net/mptcp/protocol.h

Re: linux-next: manual merge of the net-next tree with the net tree

2021-02-15 Thread Davide Caratti
On Mon, 2021-02-15 at 12:01 +0100, Guillaume Nault wrote: > Before these commits, ALL_TESTS listed the tests in the order they were > implemented in the rest of the file. So I'd rather continue following > this implicit rule, if at all possible. Also it makes sense to keep > grouping all match_ip_*

[PATCH net] flow_dissector: fix TTL and TOS dissection on IPv4 fragments

2021-02-12 Thread Davide Caratti
ad ("net/flow_dissector: add support for dissection of misc ip header fields") Reported-by: Shuang Li Signed-off-by: Davide Caratti --- net/core/flow_dissector.c | 6 +-- .../selftests/net/forwarding/tc_flower.sh | 38 ++- 2 files changed, 40 in

[PATCH net-next v3] mptcp: fix length of MP_PRIO suboption

2021-02-01 Thread Davide Caratti
ks to Geliang Tang. Fixes: 067065422fcd ("mptcp: add the outgoing MP_PRIO support") Reviewed-by: Mat Martineau Reviewed-by: Matthieu Baerts Signed-off-by: Davide Caratti --- net/mptcp/options.c | 5 +++-- net/mptcp/protocol.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff

[PATCH net] net: mptcp: cap forward allocation to 1M

2020-12-21 Thread Davide Caratti
'amount'. Cap forward allocation to 1 megabyte: higher values are not really useful. Suggested-by: Paolo Abeni Fixes: e93da92896bc ("mptcp: implement wmem reservation") Signed-off-by: Davide Caratti --- net/mptcp/protocol.c | 5 - 1 file changed, 4 insertions(+), 1 deleti

[PATCH net] net/sched: sch_taprio: ensure to reset/destroy all child qdiscs

2020-12-17 Thread Davide Caratti
ULL item. Fixes: 44d4775ca518 ("net/sched: sch_taprio: reset child qdiscs before freeing them") Fixes: 5a781ccbd19e ("tc: Add support for configuring the taprio scheduler") Suggested-by: Jakub Kicinski Signed-off-by: Davide Caratti --- net/sched/sch_taprio.c | 7 --- 1 file

Re: [PATCH net] net/sched: sch_taprio: reset child qdiscs before freeing them

2020-12-17 Thread Davide Caratti
On Thu, 2020-12-17 at 12:45 -0800, Jakub Kicinski wrote: > Right, but that's init, look at taprio_graft(). The child qdiscs can be > replaced at any time. And the replacement can be NULL otherwise why > would graft check "if (new)" good point, you are right. I'll send a follow-up patch right now.

Re: [PATCH net] net/sched: sch_taprio: reset child qdiscs before freeing them

2020-12-17 Thread Davide Caratti
hello Jakub, and thanks for checking! On Thu, 2020-12-17 at 11:05 -0800, Jakub Kicinski wrote: > On Wed, 16 Dec 2020 19:33:29 +0100 Davide Caratti wrote: > > + if (q->qdiscs) { > > + for (i = 0; i < dev->num_tx_queues && q->qdiscs[i]; i++) > >

[PATCH net] net/sched: sch_taprio: reset child qdiscs before freeing them

2020-12-16 Thread Davide Caratti
nk: https://syzkaller.appspot.com/bug?id=f362872379bf8f0017fb667c1ab158f2d1e764ae Reported-by: syzbot+8971da381fb5a31f5...@syzkaller.appspotmail.com Signed-off-by: Davide Caratti --- net/sched/sch_taprio.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/net/sched/sch_tapr

Re: general protection fault in taprio_dequeue_soft

2020-12-16 Thread Davide Caratti
On Tue, 2020-12-15 at 01:44 -0800, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:7f376f19 Merge tag 'mtd/fixes-for-5.10-rc8' of git://git.k.. > git tree: net > console output: https://syzkaller.appspot.com/x/log.txt?x=1384228750 > kernel config: ht

Re: [PATCH net] net: sched: Fix dump of MPLS_OPT_LSE_LABEL attribute in cls_flower

2020-12-10 Thread Davide Caratti
valid label 0, should be 256 >    ... > > Fixes: 61aec25a6db5 ("cls_flower: Support filtering on multiple MPLS Label > Stack Entries") > Signed-off-by: Guillaume Nault Reviewed-by: Davide Caratti

[PATCH net] net/sched: fq_pie: initialize timer earlier in fq_pie_init()

2020-12-03 Thread Davide Caratti
/0xa9 fix it moving timer_setup() before any failure, like it was done on 'red' with former commit 608b4adab178 ("net_sched: initialize timer earlier in red_init()"). Fixes: ec97ecf1ebe4 ("net: sched: add Flow Queue PIE packet scheduler") Signed-off-by: Davide Carat

[PATCH net] net: skbuff: ensure LSE is pullable before decrementing the MPLS ttl

2020-12-03 Thread Davide Caratti
celo Ricardo Leitner Signed-off-by: Davide Caratti --- net/core/skbuff.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 06c526e0d810..e578544b2cc7 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -5786,6 +5786,9 @@ int skb_mpls_dec_ttl

[PATCH net] net: openvswitch: ensure LSE is pullable before reading it

2020-12-03 Thread Davide Caratti
and use in OvS") Signed-off-by: Davide Caratti --- net/openvswitch/actions.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index 5829a020b81c..c3a664871cb5 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c @@ -19

[PATCH net v2] net/sched: act_mpls: ensure LSE is pullable before reading it

2020-12-03 Thread Davide Caratti
akub Kicinski Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC") Signed-off-by: Davide Caratti --- net/sched/act_mpls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c index 5c7456e5b5cf..d1486ea496a2 100644 --- a/net/sc

[PATCH net-next] selftests: tc-testing: enable CONFIG_NET_SCH_RED as a module

2020-11-26 Thread Davide Caratti
a proper kernel configuration for running kselftest can be obtained with: $ yes | make kselftest-merge enable compile support for the 'red' qdisc: otherwise, tdc kselftest fail when trying to run tdc test items contained in red.json. Signed-off-by: Davide Caratti --- tools/testing

Re: [PATCH net] net/sched: act_mpls: ensure LSE is pullable before reading it

2020-11-18 Thread Davide Caratti
On Wed, 2020-11-18 at 13:47 -0300, Marcelo Ricardo Leitner wrote: > On Wed, Nov 18, 2020 at 05:36:52PM +0100, Davide Caratti wrote: > > Hi, > > >   case TCA_MPLS_ACT_MODIFY: > > + if (!pskb_may_pull(skb, > > + skb_networ

[PATCH net] net/sched: act_mpls: ensure LSE is pullable before reading it

2020-11-18 Thread Davide Caratti
when 'act_mpls' is used to mangle the LSE, the current value is read from the packet with mpls_hdr(): ensure that the label is contained in the skb "linear" area. Found by code inspection. Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")

Re: [PATCH v3 net-next 2/2] net/sched: act_frag: add implict packet fragment support.

2020-11-05 Thread Davide Caratti
hello wenxu! On Thu, 2020-11-05 at 18:41 +0800, we...@ucloud.cn wrote: > From: wenxu > > Currently kernel tc subsystem can do conntrack in act_ct. But when several > fragment packets go through the act_ct, function tcf_ct_handle_fragments > will defrag the packets to a big one. But the last acti

[PATCH net] mptcp: token: fix unititialized variable

2020-11-02 Thread Davide Caratti
gcc complains about use of uninitialized 'num'. Fix it by doing the first assignment of 'num' when the variable is declared. Fixes: 96d890daad05 ("mptcp: add msk interations helper") Signed-off-by: Davide Caratti --- net/mptcp/token.c | 2 +- 1 file changed, 1 ins

[RFC PATCH net-next] net: use a dedicated tracepoint for kfree_skb_list()

2020-10-23 Thread Davide Caratti
t", it also becomes possible to reconstruct the skb list from its members. Signed-off-by: Davide Caratti --- include/trace/events/skb.h | 19 +++ net/core/skbuff.c | 6 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/include/trace/events/s

[PATCH net] net/sched: act_tunnel_key: fix OOB write in case of IPv6 ERSPAN tunnels

2020-10-20 Thread Davide Caratti
etadata with tunnel_key_copy_opts(). Fix the arguments of __ipv6_tun_set_dst(), so that 'md_size' contains the size previously computed by tunnel_key_get_opts_len(), like it's done for IPv4 tunnels. Fixes: 0ed5269f9e41 ("net/sched: add tunnel option support to act_tunnel_key") Reported

[PATCH net] net: mptcp: make DACK4/DACK8 usage consistent among all subflows

2020-10-06 Thread Davide Caratti
_64bit_ack' variable to make it a property of MPTCP sockets, not TCP subflows. Fixes: a0c1d0eafd1e ("mptcp: Use 32-bit DATA_ACK when possible") Acked-by: Paolo Abeni Signed-off-by: Davide Caratti --- net/mptcp/options.c | 2 +- net/mptcp/protocol.h | 2 +- net/mptcp/subflow.c |

Re: [PATCH net] net/core: check length before updating Ethertype in skb_mpls_{push,pop}

2020-10-04 Thread Davide Caratti
Ethernet header though. > > net/core/skbuff.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Acked-by: Davide Caratti thanks! -- davide

Re: [Patch net] net_sched: remove a redundant goto chain check

2020-09-28 Thread Davide Caratti
tcf_idr_insert() in > tcf_action_init_1()") > Reported-by: Vlad Buslov > Suggested-by: Davide Caratti > Cc: Jamal Hadi Salim > Cc: Jiri Pirko > Signed-off-by: Cong Wang > --- > net/sched/act_api.c | 14 -- > 1 file changed, 14 deletions(-) > &

Re: [Patch net 1/2] net_sched: defer tcf_idr_insert() in tcf_action_init_1()

2020-09-28 Thread Davide Caratti
hello, On Fri, 2020-09-25 at 22:45 +0300, Vlad Buslov wrote: > On Fri 25 Sep 2020 at 22:22, Cong Wang wrote: > > On Fri, Sep 25, 2020 at 8:24 AM Vlad Buslov wrote: > > > > + if (TC_ACT_EXT_CMP(a->tcfa_action, TC_ACT_GOTO_CHAIN) && > > > > + !rcu_access_pointer(a->goto_chain)) { > > >

[PATCH net-next] ip6gre: avoid tx_error when sending MLD/DAD on external tunnels

2020-09-27 Thread Davide Caratti
> '.[0].stats64.tx | {"errors": .errors, "dropped": .dropped}' > ip link del dev gre6-test0 > done Reported-by: Jianlin Shi Signed-off-by: Davide Caratti --- net/ipv6/ip6_gre.c | 33 ++--- 1 file changed, 22 insertions(+), 11 del

[PATCH net-next] selftests: mptcp: fix typo in mptcp_connect usage

2020-09-02 Thread Davide Caratti
in mptcp_connect, 's' selects IPPROTO_MPTCP / IPPROTO_TCP as the value of 'protocol' in socket(), and 'm' switches between different send / receive modes. Fix die_usage(): swap 'm' and 's' and add missing 'sendfile' mode. Signed-of

[PATCH net-next] mptcp: silence warning in subflow_data_ready()

2020-07-15 Thread Davide Caratti
("mptcp: fix race in subflow_data_ready()") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/47 Signed-off-by: Davide Caratti --- net/mptcp/subflow.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 9f7f3772

Re: [PATCH net-next v3 1/4] net/sched: Add skb->hash field editing via act_skbedit

2020-07-13 Thread Davide Caratti
On Sun, 2020-07-12 at 00:28 +0300, Ariel Levkovich wrote: > Extend act_skbedit api to allow writing into skb->hash > field. > [...] > Usage example: > > $ tc filter add dev ens1f0_0 ingress \ > prio 1 chain 0 proto ip \ > flower ip_proto tcp \ > action skbedit hash asym_l4 basis 5 \ > action got

[PATCH net] bnxt_en: fix NULL dereference in case SR-IOV configuration fails

2020-07-10 Thread Davide Caratti
ys_sendmsg+0x204/0x280 ___sys_sendmsg+0x88/0xd0 __sys_sendmsg+0x5e/0xa0 do_syscall_64+0x47/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: c0c050c58d840 ("bnxt_en: New Broadcom ethernet driver.") Reported-by: Fei Liu CC: Jonathan Toppins CC: Michael Chan Signed-off-by: Davide Ca

[PATCH net-next] mptcp: fix race in subflow_data_ready()

2020-07-06 Thread Davide Caratti
om/multipath-tcp/mptcp_net-next/issues/39 Reported-by: Christoph Paasch Fixes: e1ff9e82e2ea ("net: mptcp: improve fallback to TCP") Suggested-by: Paolo Abeni Signed-off-by: Davide Caratti --- net/mptcp/subflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net

Re: [PATCH net] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Davide Caratti
hello Toke, thanks for answering! On Fri, 2020-07-03 at 14:05 +0200, Toke Høiland-Jørgensen wrote: > while (proto == htons(ETH_P_8021Q) || proto == htons(ETH_P_8021AD)) { maybe this line be shortened, since if_vlan.h has [1]: while (eth_type_vlan(proto)) { ... } If I read well, the b

[PATCH net-next 1/6] net: mptcp: improve fallback to TCP

2020-06-29 Thread Davide Caratti
sues/22 Co-developed-by: Paolo Abeni Signed-off-by: Paolo Abeni Signed-off-by: Davide Caratti --- net/mptcp/options.c | 9 +++- net/mptcp/protocol.c | 98 net/mptcp/protocol.h | 33 +++ net/mptcp/subflow.c | 47 + 4 fil

[PATCH net-next 4/6] mptcp: create first subflow at msk creation time

2020-06-29 Thread Davide Caratti
From: Paolo Abeni This cleans the code a bit and makes the behavior more consistent. Signed-off-by: Paolo Abeni Signed-off-by: Davide Caratti --- net/mptcp/protocol.c | 53 +--- 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/net/mptcp

[PATCH net-next 6/6] mptcp: close poll() races

2020-06-29 Thread Davide Caratti
d-off-by: Davide Caratti --- net/mptcp/protocol.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index f2b2bd37e371..28ec26d97f96 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1841,6 +1

[PATCH net-next 0/6] MPTCP: improve fallback to TCP

2020-06-29 Thread Davide Caratti
re needed after the fallback rework - patch 6 fixes a race condition between close() and poll(). The problem was theoretically present before the rework, but it became almost systematic after patch 1 Davide Caratti (2): net: mptcp: improve fallback to TCP mptcp: fallback in case of simult

[PATCH net-next 2/6] mptcp: fallback in case of simultaneous connect

2020-06-29 Thread Davide Caratti
path-tcp/mptcp_net-next/issues/35 Reported-by: Christoph Paasch Suggested-by: Paolo Abeni Signed-off-by: Davide Caratti --- net/mptcp/protocol.h | 10 ++ net/mptcp/subflow.c | 10 ++ 2 files changed, 20 insertions(+) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index

[PATCH net-next 3/6] mptcp: check for plain TCP sock at accept time

2020-06-29 Thread Davide Caratti
From: Paolo Abeni This cleanup the code a bit and avoid corrupted states on weird syscall sequence (accept(), connect()). Signed-off-by: Paolo Abeni Signed-off-by: Davide Caratti --- net/mptcp/protocol.c | 69 +--- 1 file changed, 7 insertions(+), 62

[PATCH net-next 5/6] mptcp: __mptcp_tcp_fallback() returns a struct sock

2020-06-29 Thread Davide Caratti
first subflow sock and cope correctly even with incoming connections. Signed-off-by: Paolo Abeni Signed-off-by: Davide Caratti --- net/mptcp/protocol.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index

Re: [Cake] [PATCH net-next 1/5] sch_cake: fix IP protocol handling in the presence of VLAN tags

2020-06-26 Thread Davide Caratti
hi Toke, thanks for answering. On Fri, 2020-06-26 at 14:52 +0200, Toke Høiland-Jørgensen wrote: > Davide Caratti writes: [...] > > > > > I guess I can trying going through them all and figuring out if > > > there's a more generic solution. > > &g

Re: [PATCH net-next 1/5] sch_cake: fix IP protocol handling in the presence of VLAN tags

2020-06-26 Thread Davide Caratti
hello, my 2 cents: On Thu, 2020-06-25 at 21:53 +0200, Toke Høiland-Jørgensen wrote: > I think it depends a little on the use case; some callers actually care > about the VLAN tags themselves and handle that specially (e.g., > act_csum). I remember taht something similar was discussed about 1 yea

Re: [PATCH net-next 1/3] net/sched: Introduce action hash

2020-06-19 Thread Davide Caratti
hello Ariel, thanks for the patch, On Fri, 2020-06-19 at 01:15 +0300, Ariel Levkovich wrote: > Allow setting a hash value to a packet for a future match. > > The action will determine the packet's hash result according to > the selected hash type. > The first option is to select a basic asymmet

Re: [PATCH net-next 1/3] net/sched: Introduce action hash

2020-06-19 Thread Davide Caratti
hello Ariel, (I'm doing a resend because I suspect that my original reply was dropped somewhere). Thanks for your patch! some comments/questions below: On Fri, 2020-06-19 at 01:15 +0300, Ariel Levkovich wrote: > Allow setting a hash value to a packet for a future match. > > The action will dete

Re: [PATCHv2 net] tc-testing: update geneve options match in tunnel_key unit tests

2020-06-19 Thread Davide Caratti
ibility for both old and new > iproute2, let's accept both "geneve_opt" and "geneve_opts". > > Suggested-by: Davide Caratti > Signed-off-by: Hangbin Liu > --- > .../tc-testing/tc-tests/actions/tunnel_key.json| 14 +++--- > 1 file

Re: [PATCH iproute2] tc: m_tunnel_key: fix geneve opt output

2020-06-18 Thread Davide Caratti
On Thu, 2020-06-18 at 18:44 +0800, Hangbin Liu wrote: > Commit f72c3ad00f3b changed the geneve option output from "geneve_opt" > to "geneve_opts", which may break the program compatibility. Reset > it back to geneve_opt. > > Fixes: f72c3ad00f3b ("tc: m_tunnel_key: add options support for vxlan") >

Re: [PATCH net] tc-testing: fix geneve options match in tunnel_key unit tests

2020-06-18 Thread Davide Caratti
On Thu, 2020-06-18 at 16:37 +0800, Hangbin Liu wrote: > tc action print "geneve_opts" instead of "geneve_opt". > Fix the typo, or we will unable to match correct action output. > hello Hangbin, > Fixes: cba54f9cf4ec ("tc-testing: add geneve options in tunnel_key unit > tests") this Fixes: tag

[PATCH net v3 2/2] net/sched: act_gate: fix configuration of the periodic timer

2020-06-16 Thread Davide Caratti
or path of tcf_gate_init() (thanks to Vladimir Oltean) v2: avoid 'goto' in gate_setup_timer (thanks to Cong Wang) CC: Ivan Vecera Fixes: a01c245438c5 ("net/sched: fix a couple of splats in the error path of tfc_gate_init()") Fixes: a51c328df310 ("net: qos: introduce

[PATCH net v3 0/2] two fixes for 'act_gate' control plane

2020-06-16 Thread Davide Caratti
gate'. changes since v2: - fix undefined behavior in patch 1/2 - improve comment in patch 2/2 changes since v1: coding style fixes in patch 1/2 and 2/2 Davide Caratti (2): net/sched: act_gate: fix NULL dereference in tcf_gate_init() net/sched: act_gate: fix configuration of the

[PATCH net v3 1/2] net/sched: act_gate: fix NULL dereference in tcf_gate_init()

2020-06-16 Thread Davide Caratti
ttribute. v3: fix uninitialized 'cycletime' (thanks to Vladimir Oltean) v2: remove useless 'return;' at the end of void gate_get_start_time() Fixes: a51c328df310 ("net: qos: introduce a gate control flow action") CC: Ivan Vecera Signed-off-by: Davide Caratti --- net/s

Re: [PATCH net v2 2/2] net/sched: act_gate: fix configuration of the periodic timer

2020-06-16 Thread Davide Caratti
On Tue, 2020-06-16 at 17:23 +0300, Vladimir Oltean wrote: > > (but again, this would be a fix for 'entries' - not for 'hitimer', so I > > plan to work on it as a separate patch, that fits better 'net-next' rather > > than 'net'). > > Targeting net-next would mean that the net tree would still keep

Re: [PATCH net v2 2/2] net/sched: act_gate: fix configuration of the periodic timer

2020-06-16 Thread Davide Caratti
On Tue, 2020-06-16 at 13:38 +0300, Vladimir Oltean wrote: > Hi Davide, > > On Tue, 16 Jun 2020 at 13:13, Davide Caratti wrote: > > hello Vladimir, > > > > thanks a lot for reviewing this. > > > > On Tue, 2020-06-16 at 00:55 +0300, Vladimir Oltean wro

Re: [PATCH net v2 2/2] net/sched: act_gate: fix configuration of the periodic timer

2020-06-16 Thread Davide Caratti
hello Vladimir, thanks a lot for reviewing this. On Tue, 2020-06-16 at 00:55 +0300, Vladimir Oltean wrote: [...] > > diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c > > index 6775ccf355b0..3c529a4bcca5 100644 > > --- a/net/sched/act_gate.c > > +++ b/net/sched/act_gate.c > > @@ -272,6 +

[PATCH net v2 1/2] net/sched: act_gate: fix NULL dereference in tcf_gate_init()

2020-06-15 Thread Davide Caratti
ibute. v2: remove useless 'return;' at the end of void gate_get_start_time() Fixes: a51c328df310 ("net: qos: introduce a gate control flow action") CC: Ivan Vecera Signed-off-by: Davide Caratti --- net/sched/act_gate.c | 36 +--- 1 file cha

[PATCH net v2 2/2] net/sched: act_gate: fix configuration of the periodic timer

2020-06-15 Thread Davide Caratti
te_setup_timer (thanks to Cong Wang) CC: Ivan Vecera Fixes: a01c245438c5 ("net/sched: fix a couple of splats in the error path of tfc_gate_init()") Fixes: a51c328df310 ("net: qos: introduce a gate control flow action") Signed-off-by: Davide Caratti --- net/sched/act_gate.c

[PATCH net v2 0/2] two fixes for 'act_gate' control plane

2020-06-15 Thread Davide Caratti
'act_gate'. changes since v1: coding style fixes in patch 1/2 and 2/2 Davide Caratti (2): net/sched: act_gate: fix NULL dereference in tcf_gate_init() net/sched: act_gate: fix configuration of the periodic timer net/sched/act_gate.c | 124 +++

[PATCH net 2/2] net/sched: act_gate: fix configuration of the periodic timer

2020-06-10 Thread Davide Caratti
5 ("net/sched: fix a couple of splats in the error path of tfc_gate_init()") Fixes: a51c328df310 ("net: qos: introduce a gate control flow action") Signed-off-by: Davide Caratti --- net/sched/act_gate.c | 93 +++- 1 file changed, 58 i

[PATCH net 0/2] two fixes for 'act_gate' control plane

2020-06-10 Thread Davide Caratti
- patch 1/2 attempts to fix the error path of tcf_gate_init() when users try to configure 'act_gate' rules with wrong parameters. - patch 2/2 is a follow-up of a recent fix for NULL dereference in the error path of tcf_gate_init() further work will introduce a tdc test for 'act

[PATCH net 1/2] net/sched: act_gate: fix NULL dereference in tcf_gate_init()

2020-06-10 Thread Davide Caratti
attribute. Fixes: a51c328df310 ("net: qos: introduce a gate control flow action") CC: Ivan Vecera Signed-off-by: Davide Caratti --- net/sched/act_gate.c | 37 ++--- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/net/sched/act_gate.c b/net/sch

Re: [PATCH net-next] net/sched: fix a couple of splats in the error path of tfc_gate_init()

2020-06-01 Thread Davide Caratti
On Mon, 2020-06-01 at 11:37 -0700, David Miller wrote: > From: Davide Caratti > Date: Fri, 29 May 2020 00:05:32 +0200 > > > trying to configure TC 'act_gate' rules with invalid control actions, the > > following splat can be observed: > > > >

[PATCH net-next v2] net/sched: fix a couple of splats in the error path of tcf_gate_init()

2020-05-29 Thread Davide Caratti
educe usage of to_gate() Fixes: a51c328df310 ("net: qos: introduce a gate control flow action") CC: Ivan Vecera Signed-off-by: Davide Caratti --- net/sched/act_gate.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/sched/act_gate.c b/net/sched/ac

Re: [PATCH net-next] net/sched: fix a couple of splats in the error path of tfc_gate_init()

2020-05-29 Thread Davide Caratti
hi Po Liu, On Fri, 2020-05-29 at 02:43 +, Po Liu wrote: > Can you share the test step? sure, an invalid value of the control action is sufficient: # tc action add action gate index 2 clockid CLOCK_TAI goto chain 42 > Clockid by default is set with CLOCK_TAI. not in the error path of tcf_g

[PATCH net-next] net/sched: fix a couple of splats in the error path of tfc_gate_init()

2020-05-28 Thread Davide Caratti
t;net: qos: introduce a gate control flow action") CC: Ivan Vecera Signed-off-by: Davide Caratti --- net/sched/act_gate.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c index 35fc48795541c..9c628591f452c 100644

[PATCH net] net/sched: fix infinite loop in sch_fq_pie

2020-05-26 Thread Davide Caratti
ra Fixes: ec97ecf1ebe4 ("net: sched: add Flow Queue PIE packet scheduler") Signed-off-by: Davide Caratti --- net/sched/sch_fq_pie.c| 4 ++-- .../tc-testing/tc-tests/qdiscs/fq_pie.json| 21 +++ 2 files changed, 23 insertions(+), 2 deletions(-

Re: [v4,iproute2-next 1/2] iproute2-next:tc:action: add a gate control action

2020-05-06 Thread Davide Caratti
On Wed, 2020-05-06 at 16:40 +0800, Po Liu wrote: > Introduce a ingress frame gate control flow action. [...] hello Po Liu, [...] > +create_entry: > + e = create_gate_entry(gate_state, interval, > + ipv, maxoctets); > +

[PATCH iproute2-next v2] tc: full JSON support for 'bpf' filter

2020-04-30 Thread Davide Caratti
er.o:[tc-ingress]", "direct-action": true, "not_in_hw": true, "prog": { "id": 101, "tag": "a04f5eef06a7f555", "jited": 1 } } } ] v2: - use print_nl(), thanks to Andrea Claudi -

[PATCH iproute2-next] tc: full JSON support for 'bpf' filter

2020-04-28 Thread Davide Caratti
er.o:[tc-ingress]", "direct-action": true, "not_in_hw": true, "prog": { "id": 101, "tag": "a04f5eef06a7f555", "jited": 1 } } } ] Signed-off-by: Davide Caratti --- tc/f_bpf.c | 29 +++

[PATCH net-next] net/sched: act_police: re-use tcf_tm_dump()

2019-10-19 Thread Davide Caratti
Use tcf_tm_dump(), instead of an open coded variant (no functional change in this patch). Signed-off-by: Davide Caratti --- net/sched/act_police.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 89c04c52af3d

[PATCH net v2 2/2] net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions

2019-10-12 Thread Davide Caratti
_pop(), reported by kbuild test robot CC: Lorenzo Bianconi Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC") Reviewed-by: Simon Horman Acked-by: John Hurley Signed-off-by: Davide Caratti --- include/linux/skbuff.h| 5 +++-- net/core/skbuff.c

[PATCH net v2 0/2] net/sched: fix wrong behavior of MPLS push/pop action

2019-10-12 Thread Davide Caratti
corruption of the L2 header that occurs when 'push' or 'pop' actions are configured in TC egress path. v2: - change commit message in patch 1/2 to better describe that the patch impacts only TC, thanks to Simon Horman - fix missing documentation of 'mac_len'

[PATCH net v2 1/2] net: avoid errors when trying to pop MLPS header on non-MPLS packets

2019-10-12 Thread Davide Caratti
2a2ea50870ba ("net: sched: add mpls manipulation actions to TC") Reviewed-by: Simon Horman Acked-by: John Hurley Signed-off-by: Davide Caratti --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 52913361

[PATCH net 2/2] net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions

2019-10-10 Thread Davide Caratti
ta plane, computing 'mac_len' as the difference between the network header and the mac header (when not at TC ingress), and use it in MPLS 'push'/'pop' core functions. CC: Lorenzo Bianconi Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC") Signed

[PATCH net 1/2] net: avoid errors when trying to pop MLPS header on non-MPLS packets

2019-10-10 Thread Davide Caratti
lation actions to TC") Signed-off-by: Davide Caratti --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 529133611ea2..cd59ccd6da57 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -5536,7 +5536,7 @@ int sk

[PATCH net 0/2] net/sched: fix wrong behavior of MPLS push/pop action

2019-10-10 Thread Davide Caratti
corruption of the L2 header that occurs when 'push' or 'pop' actions are configured in TC egress path. Davide Caratti (2): net: avoid errors when trying to pop MLPS header on non-MPLS packets net/sched: fix corrupted L2 header with MPLS 'push' and 'pop'

Re: [PATCH] ss: allow dumping kTLS info

2019-10-07 Thread Davide Caratti
On Mon, 2019-10-07 at 12:16 +0200, Davide Caratti wrote: > now that INET_DIAG_INFO requests can dump TCP ULP information, extend 'ss' > to allow diagnosing kTLS when it is attached to a TCP socket. While at it, > import kTLS uAPI definitions from the latest net-next tree. >

[PATCH] ss: allow dumping kTLS info

2019-10-07 Thread Davide Caratti
b Kicinski Signed-off-by: Davide Caratti --- include/uapi/linux/tls.h | 127 +++ misc/ss.c| 89 +++ 2 files changed, 216 insertions(+) create mode 100644 include/uapi/linux/tls.h diff --git a/include/uapi/linux/tls.h b/in

[PATCH net] net/sched: act_sample: don't push mac header on ip6gre ingress

2019-09-17 Thread Davide Caratti
p action sample \ > group 100 rate 1 # psample -v -g 100 dumps everything, including outer header and mac, when $d is a gre tunnel over ipv6. Fix this adding a missing label for ARPHRD_IP6GRE devices. Fixes: 5c5670fae430 ("net/sched: Introduce sample tc action") Signed-off-by: Da

Re: [PATCH net] tcp: ulp: fix possible crash in tcp_diag_get_aux_size()

2019-09-06 Thread Davide Caratti
On Thu, 2019-09-05 at 13:20 -0700, Eric Dumazet wrote: > tcp_diag_get_aux_size() can be called with sockets in any state. > > icsk_ulp_ops is only present for full sockets. > > For SYN_RECV or TIME_WAIT ones we would access garbage. > hello Eric, thanks for fixing this!

Re: [PATCH net-next v3] net: openvswitch: Set OvS recirc_id from tc chain index

2019-09-04 Thread Davide Caratti
On Tue, 2019-09-03 at 16:23 +0300, Paul Blakey wrote: > Offloaded OvS datapath rules are translated one to one to tc rules, > for example the following simplified OvS rule: > > recirc_id(0),in_port(dev1),eth_type(0x0800),ct_state(-trk) > actions:ct(),recirc(2) > > Will be translated to the follo

[PATCH net] tc-testing: don't hardcode 'ip' in nsPlugin.py

2019-08-30 Thread Davide Caratti
alue we have in tdc_config.py. # ./tdc.py -e 2638 -- ns/SubPlugin.__init__ Test 2638: Add matchall and try to get it All test results: 1..1 ok 1 2638 - Add matchall and try to get it Fixes: 489ce2f42514 ("tc-testing: Restore original behaviour for namespaces in tdc") Reported-by: H

[PATCH net-next v3 1/3] net/tls: use RCU protection on icsk->icsk_ulp_data

2019-08-30 Thread Davide Caratti
From: Jakub Kicinski We need to make sure context does not get freed while diag code is interrogating it. Free struct tls_context with kfree_rcu(). We add the __rcu annotation directly in icsk, and cast it away in the datapath accessor. Presumably all ULPs will do a similar thing. Signed-off-by

[PATCH net-next v3 2/3] tcp: ulp: add functions to dump ulp-specific information

2019-08-30 Thread Davide Caratti
an be made available by the ULP through optional functions. Users having CAP_NET_ADMIN privileges will then be able to retrieve this information through inet_diag_handler, if they specify INET_DIAG_INFO in the request. Signed-off-by: Davide Caratti --- include/net/tcp.h | 3 ++ in

[PATCH net-next v3 3/3] net: tls: export protocol version, cipher, tx_conf/rx_conf to socket diag

2019-08-30 Thread Davide Caratti
When an application configures kernel TLS on top of a TCP socket, it's now possible for inet_diag_handler() to collect information regarding the protocol version, the cipher type and TX / RX configuration, in case INET_DIAG_INFO is requested. Signed-off-by: Davide Caratti --- include/net/

[PATCH net-next v3 0/3] net: tls: add socket diag

2019-08-30 Thread Davide Caratti
x_size()), thanks to Boris Pismenny - constify first argument of get_info() and get_size() - use RCU to access access ulp_ops, like it's done for ca_ops - add patch 1/3, from Jakub Kicinski Davide Caratti (2): tcp: ulp: add functions to dump ulp-specific information net: tls: export protocol

Re: [PATCH net-next v2 3/3] net: tls: export protocol version, cipher, tx_conf/rx_conf to socket diag

2019-08-30 Thread Davide Caratti
On Thu, 2019-08-29 at 14:56 -0700, Jakub Kicinski wrote: > On Thu, 29 Aug 2019 18:48:04 +0200, Davide Caratti wrote: [...] > > @@ -431,6 +431,25 @@ static inline bool is_tx_ready(struct > > tls_sw_context_tx *ctx) > > return READ_ONCE(rec->tx_ready); > >

[PATCH net-next v2 2/3] tcp: ulp: add functions to dump ulp-specific information

2019-08-29 Thread Davide Caratti
an be made available by the ULP through optional functions. Users having CAP_NET_ADMIN privileges will then be able to retrieve this information through inet_diag_handler, if they specify INET_DIAG_INFO in the request. Signed-off-by: Davide Caratti --- include/net/tcp.h | 3 ++ in

[PATCH net-next v2 1/3] net/tls: use RCU protection on icsk->icsk_ulp_data

2019-08-29 Thread Davide Caratti
From: Jakub Kicinski We need to make sure context does not get freed while diag code is interrogating it. Free struct tls_context with kfree_rcu(). We add the __rcu annotation directly in icsk, and cast it away in the datapath accessor. Presumably all ULPs will do a similar thing. Signed-off-by

[PATCH net-next v2 3/3] net: tls: export protocol version, cipher, tx_conf/rx_conf to socket diag

2019-08-29 Thread Davide Caratti
When an application configures kernel TLS on top of a TCP socket, it's now possible for inet_diag_handler() to collect information regarding the protocol version, the cipher type and TX / RX configuration, in case INET_DIAG_INFO is requested. Signed-off-by: Davide Caratti --- include/net/

[PATCH net-next v2 0/3] net: tls: add socket diag

2019-08-29 Thread Davide Caratti
, like it's done for ca_ops - add patch 1/3, from Jakub Kicinski Davide Caratti (2): tcp: ulp: add functions to dump ulp-specific information net: tls: export protocol version, cipher, tx_conf/rx_conf to socket diag Jakub Kicinski (1): net/tls: use RCU protection on icsk->

[PATCH net] net/sched: pfifo_fast: fix wrong dereference in pfifo_fast_enqueue

2019-08-27 Thread Davide Caratti
t;) CC: Paolo Abeni CC: Stefano Brivio Reported-by: Li Shuang Signed-off-by: Davide Caratti --- net/sched/sch_generic.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 099797e5409d..137db1cbde85 100644 --- a/

  1   2   3   4   5   >