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  linux-hardening  linux-cve-announce  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]
Message-ID: <CAMArcTWTV1FBi1vob7M8=vBQrn8LaVf1PB_193EffzmTAwVqWw@mail.gmail.com>
Date: Thu, 27 Feb 2025 14:00:05 +0900
From: Taehee Yoo <ap420073@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, pabeni@...hat.com, edumazet@...gle.com, 
	michael.chan@...adcom.com, pavan.chebbi@...adcom.com, andrew+netdev@...n.ch, 
	netdev@...r.kernel.org, gospo@...adcom.com, somnath.kotur@...adcom.com, 
	dw@...idwei.uk, horms@...nel.org
Subject: Re: [PATCH net 1/3] eth: bnxt: fix truesize for mb-xdp-pass case

On Thu, Feb 27, 2025 at 11:07 AM Jakub Kicinski <kuba@...nel.org> wrote:
>

Hi Jakub,
Thanks a lot for your review!

> On Wed, 26 Feb 2025 06:18:35 +0000 Taehee Yoo wrote:
> > When mb-xdp is set and return is XDP_PASS, packet is converted from
> > xdp_buff to sk_buff with xdp_update_skb_shared_info() in
> > bnxt_xdp_build_skb().
> > bnxt_xdp_build_skb() passes incorrect truesize argument to
> > xdp_update_skb_shared_info().
> > truesize is calculated as BNXT_RX_PAGE_SIZE * sinfo->nr_frags but
> > sinfo->nr_frags should not be used because sinfo->nr_frags is not yet
> > updated.
>
> "not yet updated" sounds misleading the problem is that calling
> build_skb() wipes the shared info back to 0, but it was initialized.

I checked again after this review, and you're right.
sinfo->nr_frags was wiped in the napi_build_skb() in the
bnxt_rx_multi_page_skb(), this is called before bnxt_xdp_build_skb().
So, this patch is wrong.
Thanks a lot!

>
> > so it should use num_frags instead.
>
> num_frags may be stale, tho. The program can trim the skb effectively
> discarding the fragments. Maybe we should fix that also..

I didn't think it through, Thanks!

>
> Could you follow up and switch to xdp_build_skb_from_buff() in net-next?
> It does all the right things already.

Okay, I will try to switch to xdp_build_skb_from_buff() in net-next.

>
> > How to reproduce:
> > <Node A>
> > ip link set $interface1 xdp obj xdp_pass.o
> > ip link set $interface1 mtu 9000 up
> > ip a a 10.0.0.1/24 dev $interface1
> > <Node B>
> > ip link set $interfac2 mtu 9000 up
> > ip a a 10.0.0.2/24 dev $interface2
> > ping 10.0.0.1 -s 65000
>
> Would you be willing to turn this into a selftest?
> The xdp program I added for HDS recently is a PASS so we can reuse it.
> 29b036be1b0bfcf

Of course, I will add selftest case for this.

Thanks a lot!
Taehee Yoo

> --
> pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ