[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6765aea049149_21de2208b@john.notmuch>
Date: Fri, 20 Dec 2024 09:51:28 -0800
From: John Fastabend <john.fastabend@...il.com>
To: Cong Wang <xiyou.wangcong@...il.com>,
netdev@...r.kernel.org
Cc: bpf@...r.kernel.org,
Cong Wang <cong.wang@...edance.com>,
John Fastabend <john.fastabend@...il.com>,
Daniel Borkmann <daniel@...earbox.net>
Subject: RE: [Patch bpf v3 1/4] bpf: Check negative offsets in
__bpf_skb_min_len()
Cong Wang wrote:
> From: Cong Wang <cong.wang@...edance.com>
>
> skb_network_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 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: 5293efe62df8 ("bpf: add bpf_skb_change_tail helper")
> Cc: John Fastabend <john.fastabend@...il.com>
> Cc: Daniel Borkmann <daniel@...earbox.net>
> Signed-off-by: Cong Wang <cong.wang@...edance.com>
> ---
Acked-by: John Fastabend <john.fastabend@...il.com>
Powered by blists - more mailing lists