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: <de14f60e-b1f0-432c-80b4-a2f0453e0fe2@amd.com>
Date: Fri, 25 Jul 2025 11:11:44 +0100
From: Edward Cree <ecree@....com>
To: Paolo Abeni <pabeni@...hat.com>, Chenyuan Yang <chenyuan0y@...il.com>,
 ecree.xilinx@...il.com, andrew+netdev@...n.ch, davem@...emloft.net,
 edumazet@...gle.com, kuba@...nel.org, ast@...nel.org, daniel@...earbox.net,
 hawk@...nel.org, john.fastabend@...il.com, sdf@...ichev.me,
 lorenzo@...nel.org
Cc: netdev@...r.kernel.org, linux-net-drivers@....com, bpf@...r.kernel.org,
 zzjas98@...il.com
Subject: Re: [PATCH] sfc: handle NULL returned by xdp_convert_buff_to_frame()

On 7/24/25 10:57, Paolo Abeni wrote:
> On 7/23/25 2:32 AM, Chenyuan Yang wrote:
>> The xdp_convert_buff_to_frame() function can return NULL when there is
>> insufficient headroom in the buffer to store the xdp_frame structure
>> or when the driver didn't reserve enough tailroom for skb_shared_info.
> 
> AFAIC the sfc driver reserves both enough headroom and tailroom, but
> this is after ebpf run, which in turn could consume enough headroom to
> cause a failure, so I think this makes sense.

Your reasoning seems plausible to me.
However, I think the error path ought to more closely follow the existing
 error cases in logging a ratelimited message and calling the tracepoint.
I think the cleanest way to do this would be:
	if (unlikely(!xdpf))
		err = -ENOBUFS;
	else
		err = efx_xdp_tx_buffers(efx, 1, &xdpf, true);
 so that it can make use of the existing failure path.
Adding the check to efx_xdp_tx_buffers() is also an option.

-ed

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ