lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 13 Jun 2018 10:10:21 -0700
From:   Alexander Duyck <alexander.duyck@...il.com>
To:     John Fastabend <john.fastabend@...il.com>
Cc:     Daniel Borkmann <daniel@...earbox.net>,
        Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
        Netdev <netdev@...r.kernel.org>,
        Björn Töpel <bjorn.topel@...el.com>,
        intel-wired-lan <intel-wired-lan@...ts.osuosl.org>,
        keith.busch@...ux.intel.com, makita.toshiaki@....ntt.co.jp
Subject: Re: [Intel-wired-lan] [PATCH net/jkirsher] bpf, xdp, i40e: fix
 i40e_build_skb skb reserve and truesize

On Wed, Jun 13, 2018 at 9:26 AM, John Fastabend
<john.fastabend@...il.com> wrote:
> On 06/13/2018 02:04 AM, Daniel Borkmann wrote:
>> Using skb_reserve(skb, I40E_SKB_PAD + (xdp->data - xdp->data_hard_start))
>> is clearly wrong since I40E_SKB_PAD already points to the offset where
>> the original xdp->data was sitting since xdp->data_hard_start is defined
>> as xdp->data - i40e_rx_offset(rx_ring) where latter offsets to I40E_SKB_PAD
>> when build skb is used.
>>
>> However, also before cc5b114dcf98 ("bpf, i40e: add meta data support")
>> this seems broken since bpf_xdp_adjust_head() helper could have been used
>> to alter headroom and enlarge / shrink the frame and with that the assumption
>> that the xdp->data remains unchanged does not hold and would push a bogus
>> packet to upper stack.
>>
>> ixgbe got this right in 924708081629 ("ixgbe: add XDP support for pass and
>> drop actions"). In any case, fix it by removing the I40E_SKB_PAD from both
>> skb_reserve() and truesize calculation.
>>
>> Fixes: cc5b114dcf98 ("bpf, i40e: add meta data support")
>> Fixes: 0c8493d90b6b ("i40e: add XDP support for pass and drop actions")
>> Reported-by: Keith Busch <keith.busch@...ux.intel.com>
>> Reported-by: Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
>> Signed-off-by: Daniel Borkmann <daniel@...earbox.net>
>> Cc: Björn Töpel <bjorn.topel@...el.com>
>> Cc: John Fastabend <john.fastabend@...il.com>
>> ---
>>  drivers/net/ethernet/intel/i40e/i40e_txrx.c | 7 +++----
>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>
>
> Thanks! I missed this during review.
>
> Acked-by: John Fastabend <john.fastabend@...il.com>

Looks good to me. Thanks for taking care of this.

Acked-by: Alexander Duyck <alexander.h.duyck@...el.com>

Powered by blists - more mailing lists