Re: [PATCH 1/3] bpf: add helper to check for a valid SYN cookie

2019-02-28 Thread Martin Lau
On Thu, Feb 28, 2019 at 03:11:09PM +, Lorenz Bauer wrote: > I've started working on this, and I've hit a snag with the reference > tracking behaviour > of bpf_tcp_sock. From what I can tell, the assumption is that a > PTR_TO_TCP_SOCK > doesn't need reference tracking, because its either skb->

Re: [PATCH 1/3] bpf: add helper to check for a valid SYN cookie

2019-02-28 Thread Lorenz Bauer
On Tue, 26 Feb 2019 at 05:38, Martin Lau wrote: > > On Mon, Feb 25, 2019 at 06:26:42PM +, Lorenz Bauer wrote: > > On Sat, 23 Feb 2019 at 00:44, Martin Lau wrote: > > > > > > On Fri, Feb 22, 2019 at 09:50:55AM +, Lorenz Bauer wrote: > > > > Using bpf_sk_lookup_tcp it's possible to ascertai

Re: [PATCH 1/3] bpf: add helper to check for a valid SYN cookie

2019-02-25 Thread Martin Lau
On Mon, Feb 25, 2019 at 06:26:42PM +, Lorenz Bauer wrote: > On Sat, 23 Feb 2019 at 00:44, Martin Lau wrote: > > > > On Fri, Feb 22, 2019 at 09:50:55AM +, Lorenz Bauer wrote: > > > Using bpf_sk_lookup_tcp it's possible to ascertain whether a packet > > > belongs > > > to a known connection

Re: [PATCH 1/3] bpf: add helper to check for a valid SYN cookie

2019-02-25 Thread Lorenz Bauer
On Sat, 23 Feb 2019 at 00:44, Martin Lau wrote: > > On Fri, Feb 22, 2019 at 09:50:55AM +, Lorenz Bauer wrote: > > Using bpf_sk_lookup_tcp it's possible to ascertain whether a packet belongs > > to a known connection. However, there is one corner case: no sockets are > > created if SYN cookies

Re: [PATCH 1/3] bpf: add helper to check for a valid SYN cookie

2019-02-24 Thread kbuild test robot
Hi Lorenz, Thank you for the patch! Yet something to improve: [auto build test ERROR on bpf-next/master] [also build test ERROR on next-20190222] [cannot apply to v5.0-rc4] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github

Re: [PATCH 1/3] bpf: add helper to check for a valid SYN cookie

2019-02-24 Thread kbuild test robot
Hi Lorenz, Thank you for the patch! Yet something to improve: [auto build test ERROR on bpf-next/master] [also build test ERROR on next-20190222] [cannot apply to v5.0-rc4] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github

Re: [PATCH 1/3] bpf: add helper to check for a valid SYN cookie

2019-02-22 Thread Martin Lau
On Fri, Feb 22, 2019 at 09:50:55AM +, Lorenz Bauer wrote: > Using bpf_sk_lookup_tcp it's possible to ascertain whether a packet belongs > to a known connection. However, there is one corner case: no sockets are > created if SYN cookies are active. This means that the final ACK in the > 3WHS is

[PATCH 1/3] bpf: add helper to check for a valid SYN cookie

2019-02-22 Thread Lorenz Bauer
Using bpf_sk_lookup_tcp it's possible to ascertain whether a packet belongs to a known connection. However, there is one corner case: no sockets are created if SYN cookies are active. This means that the final ACK in the 3WHS is misclassified. Using the helper, we can look up the listening socket