Re: XDP invalid memory access
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: XDP invalid memory access
- From: Vincent Li <mchun.li@xxxxxxxxx>
- Date: Wed, 15 Jan 2020 14:31:39 -0800
- In-reply-to: <87ftggtl7t.fsf@toke.dk>
- References: <CAK86TEf+GY3F8resRW11DNvate5uqSsh=JAQuJHhBuL0sQpvjg@mail.gmail.com> <87ftggtl7t.fsf@toke.dk>
On Wed, Jan 15, 2020 at 2:21 PM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote:
> You have to check that you're not reading out of bounds before
> dereferencing the bytes in the TCP header...
>
I have below before the optlen
47 /* sanity check needed by the eBPF verifier */
48 if ((void *)(tcphdr + 1) > data_end)
49 return 0;
this is not enough, how do I check the out of bounds properly?
Regards,
Vincent
[Index of Archives]
[Linux Networking Development]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite Campsites]