_psock_stop().
>
> Reported-by: syzbot+7b6548ae483d6f4c6...@syzkaller.appspotmail.com
> Fixes: 799aa7f98d53 ("skmsg: Avoid lock_sock() in sk_psock_backlog()")
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Bauer
> Signed-off-by: Cong Wang
> ---
Acked-by: Jakub Sitnicki
gt; without bothering sk_psock().
>
> Reported-and-tested-by: syzbot+320a3bc8d80f478c3...@syzkaller.appspotmail.com
> Fixes: 8a59f9d1e3d4 ("sock: Introduce sk->sk_prot->psock_update_sk_prot()")
> Cc: John Fastabend
> Cc: Eric Dumazet
> Cc: Daniel Borkmann
> Cc: Jaku
duce a new ops sk->sk_prot->psock_update_sk_prot(), so each
> protocol can implement its own way to replace the struct proto.
> This also helps get rid of symbol dependencies on CONFIG_INET.
>
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnic
e us from adding a ->sendmsg_locked
> for each protocol.
>
> To reuse the code, pass function pointers to __skb_send_sock()
> and build skb_send_sock() and skb_send_sock_locked() on top.
>
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Ba
On Sat, Mar 13, 2021 at 06:32 PM CET, Cong Wang wrote:
> On Fri, Mar 12, 2021 at 4:02 AM Jakub Sitnicki wrote:
>>
>> On Wed, Mar 10, 2021 at 06:32 AM CET, Cong Wang wrote:
>> > diff --git a/net/core/sock_map.c b/net/core/sock_map.c
>> > index dd53a7771d7e..26ba47
On Fri, Mar 12, 2021 at 09:08 PM CET, Alexander Lobakin wrote:
> flow_dissector_key_icmp::id is of type u16 (CPU byteorder),
> ICMP header has its ID field in network byteorder obviously.
> Sparse says:
>
> net/core/flow_dissector.c:178:43: warning: restricted __be16 degrades to
> integer
>
> Conv
e.
>
> We do purge these queues when psock refcnt reaches 0 but
> here we want to purge them explicitly in sock_map_close().
>
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Bauer
> Signed-off-by: Cong Wang
> ---
> include
e us from adding a ->sendmsg_locked
> for each protocol.
>
> To reuse the code, pass function pointers to __skb_send_sock()
> and build skb_send_sock() and skb_send_sock_locked() on top.
>
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Bau
sg() is still special because of peeking,
> it still has to use lock_sock.
>
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Bauer
> Signed-off-by: Cong Wang
> ---
One nit below.
Acked-by: Jakub Sitnicki
> include/linux/skmsg.h | 46 +++
t; Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Bauer
> Signed-off-by: Cong Wang
> ---
Acked-by: Jakub Sitnicki
On Tue, 23 Feb 2021 10:49:34 -0800
Cong Wang wrote:
> From: Cong Wang
>
> It is not defined or used anywhere.
>
> Cc: Daniel Borkmann
> Cc: Lorenz Bauer
> Cc: John Fastabend
> Cc: Jakub Sitnicki
> Signed-off-by: Cong Wang
> ---
Acked-by: Jakub Sitnicki
On Tue, Feb 23, 2021 at 07:04 PM CET, Cong Wang wrote:
> On Tue, Feb 23, 2021 at 9:53 AM Jakub Sitnicki wrote:
>> Based on what I've seen around, mask for sanitizing tagged pointers is
>> usually derived from the flag(s). For instance:
>>
>> #define SKB_DST_NOREF
On Mon, Feb 22, 2021 at 08:27 PM CET, Cong Wang wrote:
> On Mon, Feb 22, 2021 at 4:20 AM Jakub Sitnicki wrote:
>>
>> On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote:
>> > From: Cong Wang
>> >
>> > Currently TCP_SKB_CB() is hard-coded in skmsg cod
On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote:
> From: Cong Wang
>
> This patchset is the first series of patches separated out from
> the original large patchset, to make reviews easier. This patchset
> does not add any new feature or change any functionality but merely
> cleans up the ex
On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote:
> From: Cong Wang
>
> It is now nearly identical to bpf_prog_run_pin_on_cpu() and
> it has an unused parameter 'psock', so we can just get rid
> of it and call bpf_prog_run_pin_on_cpu() directly.
>
> Cc: Jakub
On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote:
> From: Cong Wang
>
> It is only used within skmsg.c so can become static.
>
> Cc: Jakub Sitnicki
> Cc: Daniel Borkmann
> Cc: Lorenz Bauer
> Cc: John Fastabend
> Signed-off-by: Cong Wang
> ---
Acked-by: Jakub Sitnicki
On Sat, Feb 20, 2021 at 06:29 AM CET, Cong Wang wrote:
> From: Cong Wang
>
> It is only used within sock_map.c so can become static.
>
> Suggested-by: Jakub Sitnicki
> Cc: Daniel Borkmann
> Cc: Lorenz Bauer
> Cc: John Fastabend
> Signed-off-by: Cong Wang
> ---
t; general use later.
>
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Reviewed-by: Lorenz Bauer
> Acked-by: John Fastabend
> Signed-off-by: Cong Wang
> ---
skb_parser also appears in:
tools/testing/selftests/bpf/test_sockmap.c:int txmsg_omit_skb_p
an be reused because skb dst is
> no longer needed after ->sk_data_ready() so we can just drop it.
>
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Bauer
> Acked-by: John Fastabend
> Signed-off-by: Cong Wang
> ---
LGTM. I have some questions (below) tha
ap code simply depend on CONFIG_BPF_SYSCALL
> and CONFIG_INET, the latter is still needed at this point because
> of TCP/UDP proto update. And leave CONFIG_NET_SOCK_MSG untouched,
> as it is used by non-sockmap cases.
>
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Reviewed-by: Lorenz Bauer
On Fri, Feb 19, 2021 at 07:46 PM CET, Cong Wang wrote:
> On Fri, Feb 19, 2021 at 10:25 AM Jakub Sitnicki wrote:
>>
>> On Tue, Feb 16, 2021 at 07:42 AM CET, Cong Wang wrote:
>> > From: Cong Wang
>> >
>> > As suggested by John, clean up sockmap relat
ap code simply depend on CONFIG_BPF_SYSCALL.
> And leave CONFIG_NET_SOCK_MSG untouched, as it is used by
> non-sockmap cases.
>
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Reviewed-by: Lorenz Bauer
> Acked-by: John Fastabend
> Signed-off-by: Cong Wang
> ---
Sorry for the delay. T
d of ->data_end. This is similar to skb_shinfo(skb) computation
> in bpf_convert_shinfo_access().
>
> Suggested-by: Jakub Sitnicki
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Lorenz Bauer
> Signed-off-by: Cong Wang
> ---
Acked-by: Jakub Sitnicki
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Bauer
> Signed-off-by: Cong Wang
> ---
Acked-by: Jakub Sitnicki
before/after a brief use.
>
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Bauer
> Signed-off-by: Cong Wang
> ---
> include/linux/skbuff.h | 4
> include/linux/skmsg.h | 45 ++
> include/net/
On Wed, Feb 03, 2021 at 05:16 AM CET, Cong Wang wrote:
> From: Cong Wang
>
> Add two test cases to ensure redirection between two
> AF_UNIX sockets or two UDP sockets work.
>
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Bauer
ARSER to BPF_SOCK_MAP, so
> that sock_map.c hopefully would be protocol-independent.
>
> Also, improve its Kconfig description to avoid confusion.
>
> Cc: John Fastabend
> Cc: Daniel Borkmann
> Cc: Jakub Sitnicki
> Cc: Lorenz Bauer
> Signed-off-by: Cong Wang
> --
On Wed, Feb 03, 2021 at 05:16 AM CET, Cong Wang wrote:
> From: Cong Wang
>
> struct sk_psock_parser is embedded in sk_psock, it is
> unnecessary as skb verdict also uses ->saved_data_ready.
> We can simply fold these fields into sk_psock.
>
> Cc: John Fastabend
> Cc: D
On Wed, Jan 20, 2021 at 10:06 PM CET, Alexei Starovoitov wrote:
> cc-ing the right folks
>
> On Wed, Jan 20, 2021 at 12:30 PM Shanti Lombard née Bouchez-Mongardé
> wrote:
>>
>> Hello,
>>
>> I believe this is my first time here, so please excuse me for mistakes.
>> Also, please Cc me on answers.
>>
re receiving on the same sock skb->sk is already assigned,
> + * skip memory accounting and owner transition seeing it already set
> + * correctly.
> + */
> + if (unlikely(skb->sk == sk))
> + return sk_psock_skb_ingress_self(psock, skb);
> msg = sk_psock_create_ingress_msg(sk, skb);
> if (!msg)
> return -EAGAIN;
Reviewed-by: Jakub Sitnicki
ts to self
> bpf, sockmap: Avoid failures from skb_to_sgvec when skb has frag_list
Patch 5 potentially can be simplified. Otherwise LGTM. For the series:
Reviewed-by: Jakub Sitnicki
On Fri, Nov 13, 2020 at 12:27 AM CET, John Fastabend wrote:
> If the skb_verdict_prog redirects an skb knowingly to itself, fix your
> BPF program this is not optimal and an abuse of the API please use
> SK_PASS. That said there may be cases, such as socket load balancing,
> where picking the socke
_flow_keys(keys, BPF_OK);
> }
>
> return parse_ipv6_proto(skb, fragh->nexthdr);
Reviewed-by: Jakub Sitnicki
holds.
>
> Hm, staring at rfc8200, it says that the first fragment packet must include
> the upper-layer header (e.g. tcp, udp). The patch here should probably add a
> comment wrt to the rfc.
You're right, it clearly says so. Nevermind my worries about malformed
packets then. Change LGTM:
Reviewed-by: Jakub Sitnicki
On Wed, Nov 11, 2020 at 05:48 AM CET, Andrii Nakryiko wrote:
> On Tue, Nov 10, 2020 at 9:12 AM Santucci Pierpaolo
> wrote:
>>
>> From second fragment on, IPV6FR program must stop the dissection of IPV6
>> fragmented packet. This is the same approach used for IPV4 fragmentation.
>>
>
> Jakub, can y
On Sun, Oct 11, 2020 at 07:10 AM CEST, John Fastabend wrote:
> Here we add three new tests for sockmap to test having a verdict program
> without setting the parser program.
>
> The first test covers the most simply case,
>
>sender proxy_recv proxy_send recv
> |
On Thu, Oct 15, 2020 at 06:43 AM CEST, John Fastabend wrote:
[...]
> Jakub, any opinions on if we should just throw an error if users try to
> add a sock to a map with a parser but no verdict? At the moment we fall
> through and add the socket, but it wont do any receive parsing/verdict.
> At the
On Mon, Oct 12, 2020 at 07:09 PM CEST, Alex Dewar wrote:
> If bpf_prog_inc_not_zero() fails for skb_parser, then bpf_prog_put() is
> called unconditionally on skb_verdict, even though it may be NULL. Fix
> and tidy up error path.
>
> Addresses-Coverity-ID: 1497799: Null pointer dereferences (FORWAR
er dereferences (FORWARD_NULL)
> Fixes: 743df8b7749f ("bpf, sockmap: Check skb_verdict and skb_parser programs
> explicitly")
> Signed-off-by: Alex Dewar
> ---
Acked-by: Jakub Sitnicki
el codebase uses both __acquires(rcu) and __acquires(RCU).
> I couldn't find any guidance which one is preferred, so I used
> what is easier to type out.
>
> Fixes: 0365351524d7 ("net: Allow iterating sockmap and sockhash")
> Reported-by: kernel test robot
> Signed-off-by: Lorenz Bauer
> ---
Acked-by: Jakub Sitnicki
On Mon, Oct 12, 2020 at 05:33 PM CEST, John Fastabend wrote:
> Jakub Sitnicki wrote:
[...]
>> On Fri, Oct 09, 2020 at 08:36 PM CEST, John Fastabend wrote:
>> > When we receive an skb and the ingress skb verdict program returns
>> > SK_PASS we currently set the ing
On Mon, Oct 12, 2020 at 07:19 PM CEST, John Fastabend wrote:
> Jakub Sitnicki wrote:
>> On Fri, Oct 09, 2020 at 08:37 PM CEST, John Fastabend wrote:
>> > In the sk_skb redirect case we didn't handle the case where we overrun
>> > the sk_rmem_alloc entry on ingr
On Fri, Oct 09, 2020 at 08:37 PM CEST, John Fastabend wrote:
> In the sk_skb redirect case we didn't handle the case where we overrun
> the sk_rmem_alloc entry on ingress redirect or sk_wmem_alloc on egress.
> Because we didn't have anything implemented we simply dropped the skb.
> This meant data
Hey John,
Exiting to see this work :-)
On Fri, Oct 09, 2020 at 08:36 PM CEST, John Fastabend wrote:
> When we receive an skb and the ingress skb verdict program returns
> SK_PASS we currently set the ingress flag and put it on the workqueue
> so it can be turned into a sk_msg and put on the sk_ms
On Sat, Sep 26, 2020 at 06:27 AM CEST, John Fastabend wrote:
> This implements a new helper skb_adjust_room() so users can push/pop
> extra bytes from a BPF_SK_SKB_STREAM_VERDICT program.
>
> Some protocols may include headers and other information that we may
> not want to include when doing a red
On Fri, Aug 21, 2020 at 12:18 AM CEST, Alexei Starovoitov wrote:
> On Thu, Aug 20, 2020 at 3:29 AM Jakub Sitnicki wrote:
>> On Tue, Aug 18, 2020 at 08:19 PM CEST, Alexei Starovoitov wrote:
[...]
>> > Long term we should probably stop doing *_kern style of ctx passing
&
Describe the purpose of BPF sk_lookup program, how it can be attached, when
it gets invoked, and what information gets passed to it. Point the reader
to examples and further documentation.
Signed-off-by: Jakub Sitnicki
---
Documentation/bpf/index.rst | 1 +
Documentation/bpf
On Tue, Aug 18, 2020 at 08:19 PM CEST, Alexei Starovoitov wrote:
> On Tue, Aug 18, 2020 at 8:49 AM Jakub Sitnicki wrote:
>> : rcu_read_lock();
>> : run_array =
>> rcu_dereference(net->bpf.run_array[NETNS_BPF_
I got around to re-running flood benchmarks. Mainly to confirm that
introduction of static key had the desired effect - users not attaching
BPF sk_lookup programs won't notice a performance hit in Linux v5.9.
But also to check for any unexpected bottlenecks when BPF sk_lookup
program is attached,
On Mon, Aug 10, 2020 at 06:14 PM CEST, Stanislav Fomichev wrote:
> On Sat, Aug 8, 2020 at 11:46 AM Jakub Sitnicki wrote:
>>
>> On Sat, Aug 08, 2020 at 12:38 AM CEST, Stanislav Fomichev wrote:
>> > I'm getting some garbage in bytes 8 and 9 when doing conver
memset(v6, 0, sizeof(*v6));
... because right now IPv4 address is left as sin6_flowinfo. I can
follow up with that change, unless you'd like to roll a v2.
Fixes: 0ab5539f8584 ("selftests/bpf: Tests for BPF_SK_LOOKUP attach point")
Reviewed-by: Jakub Sitnicki
On Wed, Jul 29, 2020 at 10:57 AM CEST, Jakub Sitnicki wrote:
> On Tue, Jul 28, 2020 at 10:13 PM CEST, Andrii Nakryiko wrote:
>
> [...]
>
>> We are getting this failure in Travis CI when syncing libbpf [0]:
>>
>> ```
>> ip: either "l
ip' command, that doesn't
understand this flag.
Fixes: 0ab5539f8584 ("selftests/bpf: Tests for BPF_SK_LOOKUP attach point")
Reported-by: Andrii Nakryiko
Signed-off-by: Jakub Sitnicki
---
tools/testing/selftests/bpf/prog_tests/sk_lookup.c | 4 ++--
1 file changed, 2 insertions(+
On Wed, Jul 29, 2020 at 07:48 PM CEST, Andrii Nakryiko wrote:
> On Wed, Jul 29, 2020 at 7:29 AM Jakub Sitnicki wrote:
>>
>> On Wed, Jul 29, 2020 at 06:09 AM CEST, Andrii Nakryiko wrote:
[...]
>> > +/*
>> > + * Trigger synchronize_cpu() in kernel.
>>
>
On Wed, Jul 29, 2020 at 06:09 AM CEST, Andrii Nakryiko wrote:
> Add test validating that all inner maps are released properly after skeleton
> is destroyed. To ensure determinism, trigger kernel-side synchronize_rcu()
> before checking map existence by their IDs.
>
> Acked-by: Song Liu
> Signed-of
Hi Andrii,
On Tue, Jul 28, 2020 at 10:13 PM CEST, Andrii Nakryiko wrote:
[...]
> We are getting this failure in Travis CI when syncing libbpf [0]:
>
> ```
> ip: either "local" is duplicate, or "nodad" is garbage
>
> switch_netns:PASS:unshare 0 nsec
>
> switch_netns:FAIL:system failed
>
> (/home/
Hi Daniel,
On Tue, Jul 28, 2020 at 10:47 PM CEST, Daniel Borkmann wrote:
[...]
> Jakub, I'm actually seeing a slightly different one on my test machine with
> sk_lookup:
>
> # ./test_progs -t sk_lookup
> #14 cgroup_skb_sk_lookup:OK
> #73/1 query lookup prog:OK
> #73/2 TCP IPv4 redir port:OK
> #
On Tue, Jul 28, 2020 at 06:37 PM CEST, Martin KaFai Lau wrote:
> On Tue, Jul 28, 2020 at 05:46:29PM +0200, Jakub Sitnicki wrote:
>> On Tue, Jul 28, 2020 at 03:20 AM CEST, Martin KaFai Lau wrote:
>> > On Sun, Jul 26, 2020 at 02:02:28PM +0200, Jakub Sitnicki wrote:
>> >&
On Tue, Jul 28, 2020 at 03:20 AM CEST, Martin KaFai Lau wrote:
> On Sun, Jul 26, 2020 at 02:02:28PM +0200, Jakub Sitnicki wrote:
>> When BPF sk lookup invokes reuseport handling for the selected socket, it
>> should ignore the fact that reuseport group can contain connected UDP
&
On Thu, Jul 23, 2020 at 11:56 PM CEST, Yonghong Song wrote:
> On 7/23/20 2:59 AM, Jakub Sitnicki wrote:
>> For narrow loads from context that are:
>>
>>1) as big in size as the target field, and
>>2) at an offset beyond the target field,
>>
>> the ve
("Merge
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
Cc: David S. Miller
Reported-by: Alexei Starovoitov
Signed-off-by: Jakub Sitnicki
---
net/ipv4/udp.c | 2 +-
net/ipv6/udp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/udp.c b/net/
; if (half[1] != 0)
4: (b4) w1 = 0
5: (b4) w0 = 1
; if (half[1] != 0)
6: (16) if w1 == 0x0 goto pc+1
7: (b4) w0 = 0
; }
8: (95) exit
Fixes: f96da09473b5 ("bpf: simplify narrower ctx access")
Suggested-by: Yonghong Song
Signed-off-by: Jakub Sitnicki
---
ke
.
Signed-off-by: Jakub Sitnicki
---
.../selftests/bpf/prog_tests/narrow_load.c| 84 +++
.../selftests/bpf/progs/test_narrow_load.c| 43 ++
2 files changed, 127 insertions(+)
create mode 100644 tools/testing/selftests/bpf/prog_tests/narrow_load.c
create mode 100644
of target field.
Cc: Yonghong Song
[v1] https://lore.kernel.org/bpf/20200710173123.427983-1-ja...@cloudflare.com/
Jakub Sitnicki (2):
bpf: Load zeros for narrow loads beyond target field
selftests/bpf: Add test for narrow loads from context at an offset
kernel/bpf/verifier.c
ot;)
Fixes: 6d4201b1386b ("udp6: Run SK_LOOKUP BPF program on socket lookup")
Signed-off-by: Jakub Sitnicki
---
net/ipv4/udp.c | 5 +
net/ipv6/udp.c | 5 +
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index b5231ab350e0..487740d0088c 1
always be used as result in such case.
Signed-off-by: Jakub Sitnicki
---
.../selftests/bpf/prog_tests/sk_lookup.c | 54 ++-
1 file changed, 53 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sk_lookup.c
b/tools/testing/selftests/bpf/prog_tests
ing when it comes to what got fixed where and why.
Thanks,
-jkbs
Cc: Kuniyuki Iwashima
Cc: Willem de Bruijn
[0] https://lore.kernel.org/linux-next/20200722132143.700a5...@canb.auug.org.au/
Jakub Sitnicki (2):
udp: Don't discard reuseport selection when group has connections
selftests/bp
On Wed, Jul 22, 2020 at 05:05 PM CEST, Willem de Bruijn wrote:
> On Wed, Jul 22, 2020 at 11:02 AM Jakub Sitnicki wrote:
>>
>> On Wed, Jul 22, 2020 at 04:42 PM CEST, Kuniyuki Iwashima wrote:
>> > Can I submit a patch to net tree that rewrites udp[46]_lib_lookup2()
On Wed, Jul 22, 2020 at 04:42 PM CEST, Kuniyuki Iwashima wrote:
> Can I submit a patch to net tree that rewrites udp[46]_lib_lookup2() to
> use only 'result' ?
Feel free. That should make the conflict resolution even easier later
on.
Thanks,
-jkbs
On Wed, Jul 22, 2020 at 05:21 AM CEST, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the bpf-next tree got conflicts in:
>
> net/ipv4/udp.c
> net/ipv6/udp.c
>
> between commit:
>
> efc6b6f6c311 ("udp: Improve load balancing for SO_REUSEPORT.")
>
> from the net tree and com
cks+0x28/0x1c3
>
> [ 370.014461] =
>
> Fixes: 9216477449f3 ("bpf: cpumap: Add the possibility to attach an eBPF
> program to cpumap")
> Reported-by: Jakub Sitnicki
> Signed-off-by: Lorenzo Bianconi
> ---
Tested-by: Jakub Sitnicki
Reviewed-by: Jakub Sitnicki
On Mon, Jul 20, 2020 at 05:45 PM CEST, David Ahern wrote:
> On 7/20/20 3:14 AM, Jakub Sitnicki wrote:
>> I realize it's a code move, but fd == 0 is a valid descriptor number.
>
> this follows the decision made for devmap entries in that fd == 0 is NOT
> a valid program fd.
On Mon, Jul 20, 2020 at 09:37 PM CEST, Alexei Starovoitov wrote:
> On Mon, Jul 20, 2020 at 11:49 AM Stephen Rothwell
> wrote:
>>
>> Hi all,
>>
>> On Mon, 20 Jul 2020 08:51:54 -0700 Randy Dunlap
>> wrote:
>> >
>> > on i386 or x86_64:
>> >
>> > # CONFIG_INET is not set
>> > # CONFIG_NET_NS is not
: Run SK_LOOKUP BPF program on socket lookup")
Reported-by: Randy Dunlap
Reported-by: Stephen Rothwell
Signed-off-by: Jakub Sitnicki
---
kernel/bpf/net_namespace.c | 4
1 file changed, 4 insertions(+)
diff --git a/kernel/bpf/net_namespace.c b/kernel/bpf/net_namespace.c
index 4e1bcaa2c3c
cks+0x28/0x1c3
>
> [ 370.014461] =
>
> Fixes: 9216477449f3 ("bpf: cpumap: Add the possibility to attach an eBPF
> program to cpumap")
> Reported-by: Jakub Sitnicki
> Signed-off-by: Lorenzo Bianconi
> ---
> kernel
On Fri, 17 Jul 2020 13:01:36 +0200
Lorenzo Bianconi wrote:
> [...]
>
> > This started showing up with when running ./test_progs from recent
> > bpf-next (bfdfa51702de). Any chance it is related?
> >
> > [ 2950.440613] =
> >
> > [ 3073.281578] INFO: t
Following ipv4 stack changes, run a BPF program attached to netns before
looking up a listening socket. Program can return a listening socket to use
as result of socket lookup, fail the lookup, or take no action.
Suggested-by: Marek Majkowski
Signed-off-by: Jakub Sitnicki
---
Notes:
v5
Same as for udp4, let BPF program override the socket lookup result, by
selecting a receiving socket of its choice or failing the lookup, if no
connected UDP socket matched packet 4-tuple.
Suggested-by: Marek Majkowski
Acked-by: Andrii Nakryiko
Signed-off-by: Jakub Sitnicki
---
Notes:
v4
Prepare for calling into reuseport from __udp6_lib_lookup as well.
Acked-by: Andrii Nakryiko
Signed-off-by: Jakub Sitnicki
---
net/ipv6/udp.c | 37 ++---
1 file changed, 26 insertions(+), 11 deletions(-)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index
potentially overrides the lookup result, only
if a 4-tuple match was not found.
Suggested-by: Marek Majkowski
Acked-by: Andrii Nakryiko
Signed-off-by: Jakub Sitnicki
---
Notes:
v4:
- Adapt to change in bpf_sk_lookup_run_v4 return value semantics.
v3:
- Use a static_key to minimize
Prepare for calling into reuseport from __inet_lookup_listener as well.
Acked-by: Andrii Nakryiko
Signed-off-by: Jakub Sitnicki
---
net/ipv4/inet_hashtables.c | 29 -
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/net/ipv4/inet_hashtables.c b/net
kowski
Signed-off-by: Jakub Sitnicki
---
Notes:
v5:
- Enforce that return value is either SK_PASS or SK_DROP. (Andrii)
- Use a case {} block avoid a conditional variable declaration. (Andrii)
- Enable bpf_perf_event_output from the start. (Andrii)
v4:
- Reintroduce narro
9-1-ja...@cloudflare.com/
[v3] https://lore.kernel.org/bpf/20200702092416.11961-1-ja...@cloudflare.com/
[v4] https://lore.kernel.org/bpf/20200713174654.642628-1-ja...@cloudflare.com/
Jakub Sitnicki (15):
bpf, netns: Handle multiple link attachments
bpf: Introduce SK_LOOKUP program type with a d
continues to htable-based lookup.
Suggested-by: Marek Majkowski
Signed-off-by: Jakub Sitnicki
---
Notes:
v5:
- Move variable initialization out of critical section. (Andrii)
- Simplify prog runners now that only SK_DROP/PASS can be returned.
v4:
- Reduce BPF sk_lookup prog
Prepare for calling into reuseport from __udp4_lib_lookup as well.
Acked-by: Andrii Nakryiko
Signed-off-by: Jakub Sitnicki
---
net/ipv4/udp.c | 34 --
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index
ended.
Acked-by: Andrii Nakryiko
Signed-off-by: Jakub Sitnicki
---
Notes:
v4:
- Document prog_array {delete_safe,update}_at() behavior. (Andrii)
- Return -EINVAL/-ENOENT on failure in {delete_safe,update}_at(). (Andrii)
- Return -ENOENT on index out of range in link_index(). (A
Prepare for calling into reuseport from inet6_lookup_listener as well.
Acked-by: Andrii Nakryiko
Signed-off-by: Jakub Sitnicki
---
net/ipv6/inet6_hashtables.c | 31 ++-
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/net/ipv6/inet6_hashtables.c b/net
Newly added program, context type and helper is used by tests in a
subsequent patch. Synchronize the header file.
Acked-by: Andrii Nakryiko
Signed-off-by: Jakub Sitnicki
---
Notes:
v4:
- Update after changes to bpf.h in earlier patch.
v3:
- Update after changes to bpf.h in
PPED, 0 FAILED
Signed-off-by: Jakub Sitnicki
---
Notes:
v5:
- Rename progs/test_sk_lookup_kern.c to progs/test_sk_lookup.c. (Andrii)
- Adapt tests for BPF skeleton name change after above rename.
- Remove tests for narrow loads at an offset wider in size than target
fiel
Exercise verifier access checks for bpf_sk_lookup context fields.
Signed-off-by: Jakub Sitnicki
---
Notes:
v5:
- Return an allowed value (SK_DROP) in all tests.
v4:
- Bring back tests for narrow loads.
v3:
- Consolidate ACCEPT tests into one.
- Deduplicate
Make libbpf aware of the newly added program type, and assign it a
section name.
Acked-by: Andrii Nakryiko
Signed-off-by: Jakub Sitnicki
---
Notes:
v4:
- Add trailing slash to section prefix ("sk_lookup/"). (Andrii)
v3:
- Move new libbpf symbols to version 0.1.0.
Make bpftool show human-friendly identifiers for newly introduced program
and attach type, BPF_PROG_TYPE_SK_LOOKUP and BPF_SK_LOOKUP, respectively.
Also, add the new prog type bash-completion, man page and help message.
Signed-off-by: Jakub Sitnicki
---
Notes:
v5:
- Update prog type
On Fri, 17 Jul 2020 12:00:13 +0200
Jakub Sitnicki wrote:
> On Tue, 14 Jul 2020 15:56:33 +0200
> Lorenzo Bianconi wrote:
>
> > Similar to what David Ahern proposed in [1] for DEVMAPs, introduce the
> > capability to attach and run a XDP program to CPUMAP entries.
>
On Tue, 14 Jul 2020 15:56:33 +0200
Lorenzo Bianconi wrote:
> Similar to what David Ahern proposed in [1] for DEVMAPs, introduce the
> capability to attach and run a XDP program to CPUMAP entries.
> The idea behind this feature is to add the possibility to define on which CPU
> run the eBPF progra
On Thu, Jul 16, 2020 at 04:23 AM CEST, Andrii Nakryiko wrote:
> On Mon, Jul 13, 2020 at 10:47 AM Jakub Sitnicki wrote:
>>
>> Run a BPF program before looking up a listening socket on the receive path.
>> Program selects a listening socket to yield as result of socket
On Thu, Jul 16, 2020 at 03:41 AM CEST, Andrii Nakryiko wrote:
> On Mon, Jul 13, 2020 at 10:47 AM Jakub Sitnicki wrote:
>>
>> Add a new program type BPF_PROG_TYPE_SK_LOOKUP with a dedicated attach type
>> BPF_SK_LOOKUP. The new program kind is to be invoked by the transport
On Wed, Jul 15, 2020 at 10:59 PM CEST, Yonghong Song wrote:
> On 7/15/20 12:26 PM, Jakub Sitnicki wrote:
>> On Wed, Jul 15, 2020 at 08:44 AM CEST, Yonghong Song wrote:
>>> On 7/10/20 10:31 AM, Jakub Sitnicki wrote:
[...]
>>>> The "size < target_size" ch
On Wed, Jul 15, 2020 at 08:44 AM CEST, Yonghong Song wrote:
> On 7/10/20 10:31 AM, Jakub Sitnicki wrote:
>> When size of load from context is the same as target field size, but less
>> than context field size, the verifier does not emit the shift and mask
>> instructions
Prepare for calling into reuseport from inet6_lookup_listener as well.
Signed-off-by: Jakub Sitnicki
---
net/ipv6/inet6_hashtables.c | 31 ++-
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
Exercise verifier access checks for bpf_sk_lookup context fields.
Signed-off-by: Jakub Sitnicki
---
Notes:
v4:
- Bring back tests for narrow loads.
v3:
- Consolidate ACCEPT tests into one.
- Deduplicate REJECT tests and arrange them into logical groups.
- Add tests
1 - 100 of 414 matches
Mail list logo