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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250226180729.332e9940@kernel.org>
Date: Wed, 26 Feb 2025 18:07:29 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Taehee Yoo <ap420073@...il.com>
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 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.

> 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..

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

> 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
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ