Re: Regression for ip6-in-ip4 IPsec tunnel in 4.14.16

2018-02-07 Thread Mike Maloney
return -EINVAL; maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen - sizeof(struct frag_hdr); (opt ? opt->opt_nflen : 0); But then we also have to convince ourselves that maxfraglen can never be <= 0. I'd have to think about that. I am not sure if others have thoughts on supporting MTUs configured below the min in the spec. Thanks. -- Mike Maloney

[PATCH net] ipv6: fix udpv6 sendmsg crash caused by too small MTU

2018-01-10 Thread Mike Maloney
From: Mike Maloney The logic in __ip6_append_data() assumes that the MTU is at least large enough for the headers. A device's MTU may be adjusted after being added while sendmsg() is processing data, resulting in __ip6_append_data() seeing any MTU. For an mtu smaller than the size o

Re: [PATCH net] ipv6: fix udpv6 sendmsg crash caused by too small MTU

2018-01-10 Thread Mike Maloney
D'oh - resending with fixes. Thanks Eric. On Wed, Jan 10, 2018 at 12:21 PM, Eric Dumazet wrote: > On Wed, 2018-01-10 at 12:10 -0500, Mike Maloney wrote: >> From: Mike Maloney >> >> The logic in __ip6_append_data() assumes that the MTU is at least large >> eno

[PATCH net] ipv6: fix udpv6 sendmsg crash caused by too small MTU

2018-01-10 Thread Mike Maloney
From: Mike Maloney The logic in __ip6_append_data() assumes that the MTU is at least large enough for the headers. A device's MTU may be adjusted after being added while sendmsg() is processing data, resulting in __ip6_append_data() seeing any MTU. For an mtu smaller than the size o

Re: [PATCH net] ipv6: fix possible mem leaks in ipv6_make_skb()

2018-01-10 Thread Mike Maloney
Acked-by: Mike Maloney Thanks Eric! On Wed, Jan 10, 2018 at 6:45 AM, Eric Dumazet wrote: > From: Eric Dumazet > > ip6_setup_cork() might return an error, while memory allocations have > been done and must be rolled back. > > Fixes: 6422398c2ab0 ("ipv6: introduce ipv6_

Re: [PATCH net] tcp: refresh tcp_mstamp from timers callbacks

2017-12-13 Thread Mike Maloney
Acked-by: Mike Maloney Thanks for the quick fix! On Tue, Dec 12, 2017 at 9:42 PM, Soheil Hassas Yeganeh wrote: > On Tue, Dec 12, 2017 at 9:26 PM, Neal Cardwell wrote: >> On Tue, Dec 12, 2017 at 9:22 PM, Eric Dumazet wrote: >>> From: Eric Dumazet >>> >>>

[PATCH net] packet: fix crash in fanout_demux_rollover()

2017-11-28 Thread Mike Maloney
From: Mike Maloney syzkaller found a race condition fanout_demux_rollover() while removing a packet socket from a fanout group. po->rollover is read and operated on during packet_rcv_fanout(), via fanout_demux_rollover(), but the pointer is currently cleared before the synchronization

[PATCH v2 net-next 2/2] selftests/net: Add a test to validate behavior of rx timestamps

2017-08-22 Thread Mike Maloney
From: Mike Maloney Validate the behavior of the combination of various timestamp socket options, and ensure consistency across ip, udp, and tcp. Signed-off-by: Mike Maloney --- .../selftests/networking/timestamping/.gitignore | 1 + .../selftests/networking/timestamping/Makefile | 4

[PATCH v2 net-next 1/2] tcp: Extend SOF_TIMESTAMPING_RX_SOFTWARE to TCP recvmsg

2017-08-22 Thread Mike Maloney
From: Mike Maloney When SOF_TIMESTAMPING_RX_SOFTWARE is enabled for tcp sockets, return the timestamp corresponding to the highest sequence number data returned. Previously the skb->tstamp is overwritten when a TCP packet is placed in the out of order queue. While the packet is in the

[PATCH v2 net-next 0/2] Add software rx timestamp for TCP.

2017-08-22 Thread Mike Maloney
From: Mike Maloney Add software rx timestamps for TCP, and a test to ensure consistency of behavior between IP, UDP, and TCP implementation. Changes since v1: -Initialize tss->ts[1] to 0 if caller requested any timestamps. -Fix test case to validate that tss->ts[1] is zero. -Fix te

[PATCH net-next 2/2] selftests/net: Add a test to validate behavior of rx timestamps

2017-08-22 Thread Mike Maloney
From: Mike Maloney Validate the behavior of the combination of various timestamp socket options, and ensure consistency across ip, udp, and tcp. Signed-off-by: Mike Maloney --- .../selftests/networking/timestamping/.gitignore | 1 + .../selftests/networking/timestamping/Makefile | 4

[PATCH net-next 1/2] tcp: Extend SOF_TIMESTAMPING_RX_SOFTWARE to TCP recvmsg

2017-08-22 Thread Mike Maloney
From: Mike Maloney When SOF_TIMESTAMPING_RX_SOFTWARE is enabled for tcp sockets, return the timestamp corresponding to the highest sequence number data returned. Previously the skb->tstamp is overwritten when a TCP packet is placed in the out of order queue. While the packet is in the

[PATCH net-next 0/2] tcp: Add software rx timestamp for TCP.

2017-08-22 Thread Mike Maloney
From: Mike Maloney Add software rx timestamps for TCP, and a test to ensure consistency of behavior between IP, UDP, and TCP implementations. Mike Maloney (2): tcp: Extend SOF_TIMESTAMPING_RX_SOFTWARE to TCP recvmsg selftests/net: Add a test to validate behavior of rx timestamps include

[PATCH net-next] selftests/net: Fix broken test case in psock_fanout

2017-04-24 Thread Mike Maloney
From: Mike Maloney The error return falue form sock_fanout_open is -1, not zero. One test case was checking for 0 instead of -1. Tested: Built and tested in clean client. Signed-off-by: Mike Maloney --- tools/testing/selftests/net/psock_fanout.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH netnext 0/3] packet: Add option to create new fanout group with unique id.

2017-04-20 Thread Mike Maloney
From: Mike Maloney Fanout uses a per net global namespace. A process that intends to create a new fanout group can accidentally join an existing group. It is not possible to detect this. Add a socket option to specify on the first call to setsockopt(..., PACKET_FANOUT, ...) to ensure that a new

[PATCH netnext 3/3] selftests/net: add tests for PACKET_FANOUT_FLAG_UNIQUEID

2017-04-20 Thread Mike Maloney
From: Mike Maloney Create two groups with PACKET_FANOUT_FLAG_UNIQUEID, add a socket to one. Ensure that the groups can only be joined if all options are consistent with the original except for this flag. Tested: ran tools/testing/selftests/net/psock_fanout 10 times, all pass. Signed-off-by

[PATCH netnext 1/3] selftests/net: cleanup unused parameter in psock_fanout

2017-04-20 Thread Mike Maloney
From: Mike Maloney sock_fanout_open no longer sets the size of packet_socket ring, so stop passing the parameter. Tested: Built and ran the test, it passed. Signed-off-by: Mike Maloney Acked-by: Willem de Bruijn --- tools/testing/selftests/net/psock_fanout.c | 18 +- 1 file

Re: [PATCH net] selftests/net: Fixes psock_fanout CBPF test case

2017-04-18 Thread Mike Maloney
On Tue, Apr 18, 2017 at 11:26 AM, Sowmini Varadhan wrote: > On (04/18/17 11:14), Mike Maloney wrote: >> Change 'psock_fanout' to use SOCK_RAW so that the CBPF program used with >> SO_ATTACH_FILTER can examine the entire frame. Create a new CBPF >> program for us

[PATCH net] selftests/net: Fixes psock_fanout CBPF test case

2017-04-18 Thread Mike Maloney
From: Mike Maloney 'psock_fanout' has been failing since commit 4d7b9dc1f36a9 ("tools: psock_lib: harden socket filter used by psock tests"). That commit changed the CBPF filter to examine the full ethernet frame, and was tested on 'psock_tpacket' which uses SOC