Repository navigation
Commit 6d59b7d
bpf, s390x: do not reload skb pointers in non-skb context
The assumption of unconditionally reloading skb pointers on
BPF helper calls where bpf_helper_changes_pkt_data() holds
true is wrong. There can be different contexts where the
BPF helper would enforce a reload such as in case of XDP.
Here, we do have a struct xdp_buff instead of struct sk_buff
as context, thus this will access garbage.
JITs only ever need to deal with cached skb pointer reload
when ld_abs/ind was seen, therefore guard the reload behind
SEEN_SKB only. Tested on s390x.
Fixes: 9db7f2b ("s390/bpf: recache skb->data/hlen for skb_vlan_push/pop")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 2d17d8d commit 6d59b7d
1 file changed
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| |||
448 | 447 | | |
449 | 448 | | |
450 | 449 | | |
451 | | - | |
| 450 | + | |
452 | 451 | | |
453 | | - | |
454 | 452 | | |
455 | 453 | | |
456 | 454 | | |
| 455 | + | |
457 | 456 | | |
458 | 457 | | |
459 | 458 | | |
| |||
983 | 982 | | |
984 | 983 | | |
985 | 984 | | |
986 | | - | |
987 | | - | |
| 985 | + | |
| 986 | + | |
988 | 987 | | |
989 | 988 | | |
990 | 989 | | |
| |||
0 commit comments