-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel…
…/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2023-09-06 We've added 9 non-merge commits during the last 6 day(s) which contain a total of 12 files changed, 189 insertions(+), 44 deletions(-). The main changes are: 1) Fix bpf_sk_storage to address an invalid wait context lockdep report and another one to address missing omem uncharge, from Martin KaFai Lau. 2) Two BPF recursion detection related fixes, from Sebastian Andrzej Siewior. 3) Fix tailcall limit enforcement in trampolines for s390 JIT, from Ilya Leoshkevich. 4) Fix a sockmap refcount race where skbs in sk_psock_backlog can be referenced after user space side has already skb_consumed them, from John Fastabend. 5) Fix BPF CI flake/race wrt sockmap vsock write test where the transport endpoint is not connected, from Xu Kuohai. 6) Follow-up doc fix to address a cross-link warning, from Eduard Zingerman. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: selftests/bpf: Check bpf_sk_storage has uncharged sk_omem_alloc bpf: bpf_sk_storage: Fix the missing uncharge in sk_omem_alloc bpf: bpf_sk_storage: Fix invalid wait context lockdep report s390/bpf: Pass through tail call counter in trampolines bpf: Assign bpf_tramp_run_ctx::saved_run_ctx before recursion check. bpf: Invoke __bpf_prog_exit_sleepable_recur() on recursion in kern_sys_bpf(). bpf, sockmap: Fix skb refcnt race after locking changes docs/bpf: Fix "file doesn't exist" warnings in {llvm_reloc,btf}.rst selftests/bpf: Fix a CI failure caused by vsock write ==================== Link: https://lore.kernel.org/r/20230906095117.16941-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
- Loading branch information
Showing
12 changed files
with
189 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
tools/testing/selftests/bpf/prog_tests/sk_storage_omem_uncharge.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* Copyright (c) 2023 Facebook */ | ||
#include <test_progs.h> | ||
#include <bpf/libbpf.h> | ||
#include <sys/types.h> | ||
#include <sys/socket.h> | ||
#include "sk_storage_omem_uncharge.skel.h" | ||
|
||
void test_sk_storage_omem_uncharge(void) | ||
{ | ||
struct sk_storage_omem_uncharge *skel; | ||
int sk_fd = -1, map_fd, err, value; | ||
socklen_t optlen; | ||
|
||
skel = sk_storage_omem_uncharge__open_and_load(); | ||
if (!ASSERT_OK_PTR(skel, "skel open_and_load")) | ||
return; | ||
map_fd = bpf_map__fd(skel->maps.sk_storage); | ||
|
||
/* A standalone socket not binding to addr:port, | ||
* so nentns is not needed. | ||
*/ | ||
sk_fd = socket(AF_INET6, SOCK_STREAM, 0); | ||
if (!ASSERT_GE(sk_fd, 0, "socket")) | ||
goto done; | ||
|
||
optlen = sizeof(skel->bss->cookie); | ||
err = getsockopt(sk_fd, SOL_SOCKET, SO_COOKIE, &skel->bss->cookie, &optlen); | ||
if (!ASSERT_OK(err, "getsockopt(SO_COOKIE)")) | ||
goto done; | ||
|
||
value = 0; | ||
err = bpf_map_update_elem(map_fd, &sk_fd, &value, 0); | ||
if (!ASSERT_OK(err, "bpf_map_update_elem(value=0)")) | ||
goto done; | ||
|
||
value = 0xdeadbeef; | ||
err = bpf_map_update_elem(map_fd, &sk_fd, &value, 0); | ||
if (!ASSERT_OK(err, "bpf_map_update_elem(value=0xdeadbeef)")) | ||
goto done; | ||
|
||
err = sk_storage_omem_uncharge__attach(skel); | ||
if (!ASSERT_OK(err, "attach")) | ||
goto done; | ||
|
||
close(sk_fd); | ||
sk_fd = -1; | ||
|
||
ASSERT_EQ(skel->bss->cookie_found, 2, "cookie_found"); | ||
ASSERT_EQ(skel->bss->omem, 0, "omem"); | ||
|
||
done: | ||
sk_storage_omem_uncharge__destroy(skel); | ||
if (sk_fd != -1) | ||
close(sk_fd); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.