mbox series

[bpf,v4,0/2] bpf: fix recursive lock and add test

Message ID 20241118030910.36230-1-mrpre@163.com (mailing list archive)
Headers show
Series bpf: fix recursive lock and add test | expand

Message

Jiayuan Chen Nov. 18, 2024, 3:09 a.m. UTC
1. fix recursive lock when ebpf prog return SK_PASS.
2. add selftest to reproduce recursive lock.

Note that the test code can reproduce the 'dead-lock' and if just
the selftest merged without first patch, the test case will
definitely fail, because the issue of deadlock is inevitable.

---
v2->v4: fix line length reported by patchwork and remove unused code.
        (max_line_length is set to 80 in patchwork but default is 100 in kernel tree)
v1->v2: 1.inspired by martin.lau to add selftest to reproduce the issue.
        2. follow the community rules for patch.
        v1: https://lore.kernel.org/bpf/55fc6114-7e64-4b65-86d2-92cfd1e9e92f@linux.dev/T/#u
---

Jiayuan Chen (2):
  bpf: fix recursive lock when verdict program return SK_PASS
  selftests/bpf: Add some tests with sockmap SK_PASS

 net/core/skmsg.c                              |  4 +-
 .../selftests/bpf/prog_tests/sockmap_basic.c  | 54 +++++++++++++++++++
 2 files changed, 56 insertions(+), 2 deletions(-)

Comments

Martin KaFai Lau Nov. 18, 2024, 9:39 p.m. UTC | #1
On 11/17/24 7:09 PM, Jiayuan Chen wrote:
> 1. fix recursive lock when ebpf prog return SK_PASS.
> 2. add selftest to reproduce recursive lock.
> 
> Note that the test code can reproduce the 'dead-lock' and if just
> the selftest merged without first patch, the test case will
> definitely fail, because the issue of deadlock is inevitable.

Acked-by: Martin KaFai Lau <martin.lau@kernel.org>

Jakub, please help to land it to the net tree. Thanks!
patchwork-bot+netdevbpf@kernel.org Nov. 19, 2024, 4 a.m. UTC | #2
Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 18 Nov 2024 11:09:08 +0800 you wrote:
> 1. fix recursive lock when ebpf prog return SK_PASS.
> 2. add selftest to reproduce recursive lock.
> 
> Note that the test code can reproduce the 'dead-lock' and if just
> the selftest merged without first patch, the test case will
> definitely fail, because the issue of deadlock is inevitable.
> 
> [...]

Here is the summary with links:
  - [bpf,v4,1/2] bpf: fix recursive lock when verdict program return SK_PASS
    https://git.kernel.org/netdev/net/c/8ca2a1eeadf0
  - [bpf,v4,2/2] selftests/bpf: Add some tests with sockmap SK_PASS
    https://git.kernel.org/netdev/net/c/0c4d5cb9a1c3

You are awesome, thank you!