-
Notifications
You must be signed in to change notification settings - Fork 6
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
bpf: check negative offsets in __bpf_skb_min_len() #4621
Conversation
Upstream branch: 44d0469 |
5299cd6
to
2656c44
Compare
Upstream branch: 44d0469 |
08b7cff
to
fc84627
Compare
2656c44
to
f2157d7
Compare
Upstream branch: fb86c42 |
fc84627
to
ae88c6d
Compare
f2157d7
to
e691a86
Compare
Upstream branch: fb86c42 |
ae88c6d
to
6775e5c
Compare
e691a86
to
6a7f1b4
Compare
Upstream branch: 9f8e716 |
6775e5c
to
ad44120
Compare
6a7f1b4
to
3fd60a8
Compare
Upstream branch: 9f8e716 |
ad44120
to
8d0f960
Compare
3fd60a8
to
4a6dea2
Compare
Upstream branch: adc2186 |
8d0f960
to
77e9225
Compare
4a6dea2
to
3be981a
Compare
Upstream branch: adc2186 |
77e9225
to
ab0626b
Compare
3be981a
to
243c5cf
Compare
Upstream branch: adc2186 |
efd0e24
to
7a3e834
Compare
Upstream branch: 20a39ea |
2650875
to
449b7df
Compare
7a3e834
to
a704d36
Compare
Upstream branch: ef3ba8c |
449b7df
to
48a1eb5
Compare
a704d36
to
b19cdf2
Compare
Upstream branch: 6b64128 |
48a1eb5
to
ca1295d
Compare
b19cdf2
to
ac77fa8
Compare
Upstream branch: 6b64128 |
ca1295d
to
d8a766e
Compare
ac77fa8
to
75271bb
Compare
Upstream branch: 3448ad2 |
d8a766e
to
500adbd
Compare
75271bb
to
6735c58
Compare
Upstream branch: 3448ad2 |
500adbd
to
ac08469
Compare
6735c58
to
e9d46d9
Compare
skb_transport_offset() and skb_transport_offset() can be negative when they are called after we pull the transport header, for example, when we use eBPF sockmap (aka at the point of ->sk_data_ready()). __bpf_skb_min_len() uses an unsigned int to get these offsets, this leads to a very large number which then causes bpf_skb_change_tail() failed unexpectedly. Fix this by using a signed int to get these offsets and ensure the minimum is at least zero. Fixes: 5293efe ("bpf: add bpf_skb_change_tail helper") Cc: John Fastabend <[email protected]> Cc: Daniel Borkmann <[email protected]> Signed-off-by: Cong Wang <[email protected]>
As requested by Daniel, we need to add a selftest to cover bpf_skb_change_tail() cases in skb_verdict. Here we test trimming, growing and error cases, and validate its expected return values. Cc: John Fastabend <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Zijian Zhang <[email protected]> Signed-off-by: Cong Wang <[email protected]>
Upstream branch: 3448ad2 |
ac08469
to
bbfea27
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=907189 expired. Closing PR. |
Pull request for series with
subject: bpf: check negative offsets in __bpf_skb_min_len()
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=907189