bpf: Unshare cloned skb before devmap egress XDP program#8007
bpf: Unshare cloned skb before devmap egress XDP program#8007kernel-patches-daemon-bpf-rc[bot] wants to merge 1 commit into
Conversation
|
Upstream branch: b9452b5 |
5fcaaa9 to
bae1e1e
Compare
|
Upstream branch: dd0f968 |
fb15f48 to
c5e2ad9
Compare
bae1e1e to
26e71a9
Compare
|
Upstream branch: f1a660b |
c5e2ad9 to
58ce5a9
Compare
26e71a9 to
01743a4
Compare
|
Upstream branch: 68f4e48 |
58ce5a9 to
000742a
Compare
01743a4 to
58d8cc8
Compare
|
Upstream branch: c15261b |
000742a to
7b75796
Compare
58d8cc8 to
4d4751c
Compare
|
Upstream branch: 140fa23 |
7b75796 to
dde199a
Compare
4d4751c to
dcffd40
Compare
|
Upstream branch: 2e8ad1f |
1 similar comment
|
Upstream branch: 2e8ad1f |
dde199a to
3f67341
Compare
dcffd40 to
8b7f742
Compare
|
Upstream branch: 30dee2c |
dev_map_redirect_clone() uses skb_clone() when redirecting a generic XDP skb to multiple devmap destinations. The cloned skb can share packet data with other clones. If the destination devmap entry has an egress XDP program, that program can modify packet data. Such modifications can then be observed by other clones sharing the same packet data. This can be reproduced by strengthening xdp_veth_egress to configure a different source MAC for each egress device and checking that store_mac_1/2 observe the MAC configured for their own egress devices. Without the fix, the SKB_MODE subtest observes store_mac_1 receiving the MAC configured for the next egress device. Fix this by unsharing the cloned skb before running the devmap egress XDP program. Limit the extra copy to destinations with an attached egress program. Tested with: ./test_progs -t xdp_veth_egress ./test_progs -t xdp_veth ./test_progs -t xdp Fixes: e624d4e ("xdp: Extend xdp_redirect_map with broadcast support") Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
3f67341 to
c3f43b6
Compare
Pull request for series with
subject: bpf: Unshare cloned skb before devmap egress XDP program
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1108462