-
Notifications
You must be signed in to change notification settings - Fork 126
bpf, xdp: clean adjust_{head,meta} memory when offset < 0 #8725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Upstream branch: 8be3a12 |
f0d3032
to
bb70d29
Compare
Upstream branch: 07be1f6 |
6a85538
to
73fa201
Compare
bb70d29
to
ae89976
Compare
Upstream branch: 07be1f6 |
73fa201
to
9747b17
Compare
ae89976
to
9f09b2a
Compare
Upstream branch: 07be1f6 |
9747b17
to
091a89d
Compare
9f09b2a
to
a4f4806
Compare
Upstream branch: 0c2623c |
091a89d
to
1e8f2a9
Compare
a4f4806
to
98ef2b0
Compare
Upstream branch: 0c2623c |
1e8f2a9
to
37e04ec
Compare
98ef2b0
to
5ad46e3
Compare
Upstream branch: 3f8ad18 |
37e04ec
to
9c55b4c
Compare
5ad46e3
to
7889b7d
Compare
Upstream branch: e8b4712 |
9c55b4c
to
03349fa
Compare
7889b7d
to
8ed9c9a
Compare
Upstream branch: e8b4712 |
03349fa
to
1ef20cb
Compare
8ed9c9a
to
4aabf34
Compare
Upstream branch: 06a2236 |
1ef20cb
to
2635845
Compare
4aabf34
to
4810d72
Compare
Upstream branch: e48e99b |
2635845
to
4a83b3b
Compare
4810d72
to
39a38d0
Compare
Upstream branch: e48e99b |
4a83b3b
to
1c67c5c
Compare
39a38d0
to
f0a923d
Compare
Upstream branch: 9f867ba |
1c67c5c
to
e6dc1b3
Compare
f0a923d
to
a12d9a0
Compare
Upstream branch: 9bae8f4 |
e6dc1b3
to
27370b6
Compare
a12d9a0
to
e5bf4d2
Compare
Upstream branch: 9bae8f4 |
The device allocates an skb, it additionally allocates a prepad size (usually equal to NET_SKB_PAD or XDP_PACKET_HEADROOM) but leaves it uninitialized. The bpf_xdp_adjust_head function moves skb->data forward, which allows users to access data belonging to other programs, posing a security risk. Reported-by: [email protected] Closes: https://lore.kernel.org/all/[email protected]/T/ Signed-off-by: Jiayuan Chen <[email protected]>
We added a memset operation during the adjust operation, which may cause performance issues. Therefore, we added perf testing, and testing found that for common header length operations, memset() operation increased the performance overhead by 2ns, which is negligible for the net stack. Before memset ./test_progs -a xdp_adjust_head_perf -v run adjust head with size 6 cost 56 ns run adjust head with size 20 cost 56 ns run adjust head with size 40 cost 56 ns run adjust head with size 200 cost 56 ns After memset ./test_progs -a xdp_adjust_head_perf -v run adjust head with size 6 cost 58 ns run adjust head with size 20 cost 58 ns run adjust head with size 40 cost 58 ns run adjust head with size 200 cost 66 ns Signed-off-by: Jiayuan Chen <[email protected]>
27370b6
to
2a532cf
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=948419 expired. Closing PR. |
Pull request for series with
subject: bpf, xdp: clean adjust_{head,meta} memory when offset < 0
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=948419