Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: bpf: Support non-linear skbs for BPF_PROG_TEST_RUN
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=998848

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: c9110e6
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=998848
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: c9110e6
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=998848
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: abc8a95
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=998848
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 929adf8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=998848
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 2d92ef7
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=998848
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: b338cf8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=998848
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 9621eb6
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=998848
version: 1

This bit of refactoring aims to simplify the next patch in this series,
in which freeing 'data' is a bit less straightforward.

Signed-off-by: Paul Chaignon <[email protected]>
This patch adds support for crafting non-linear skbs in BPF test runs
for tc programs, via a new flag BPF_F_TEST_SKB_NON_LINEAR. When this
flag is set, only the L2 header is pulled in the linear area.

This is particularly useful to test support for non-linear skbs in large
codebases such as Cilium. We've had multiple bugs in the past few years
where we were missing calls to bpf_skb_pull_data(). This support in
BPF_PROG_TEST_RUN would allow us to automatically cover this case in our
BPF tests.

In addition to the selftests introduced later in the series, this patch
was tested by setting BPF_F_TEST_SKB_NON_LINEAR for all tc selftests
programs and checking test failures were expected.

Suggested-by: Daniel Borkmann <[email protected]>
Signed-off-by: Paul Chaignon <[email protected]>
Contrary to most flags currently used in selftests, the
BPF_F_TEST_SKB_NON_LINEAR flag is not passed at program loading time,
but when calling BPF_PROG_TEST_RUN. This patch updates the test loader
to support it.

Signed-off-by: Paul Chaignon <[email protected]>
This patch adds two new selftests in the direct packet access suite, to
cover the non-linear case with BPF_F_TEST_SKB_NON_LINEAR. The first
tests the behavior of the bounds check with a non-linear skb. The second
extends the first with a call to bpf_skb_pull_data() to be able to
access the packet.

Signed-off-by: Paul Chaignon <[email protected]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=998848 expired. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants