[lvc-project] [PATCH] xen-netfront: handle NULL returned by xdp_convert_buff_to_frame()

Jürgen Groß jgross at suse.com
Thu Apr 17 10:12:01 MSK 2025


On 17.04.25 09:00, Alexey wrote:
> 
> On 17.04.2025 03:58, Jakub Kicinski wrote:
>> On Mon, 14 Apr 2025 18:34:01 +0000 Alexey Nepomnyashih wrote:
>>>           get_page(pdata);
>> Please notice this get_page() here.
>>
>>>           xdpf = xdp_convert_buff_to_frame(xdp);
>>> +        if (unlikely(!xdpf)) {
>>> +            trace_xdp_exception(queue->info->netdev, prog, act);
>>> +            break;
>>> +        }
> Do you mean that it would be better to move the get_page(pdata) call lower,
> after checking for NULL in xdpf, so that the reference count is only increased
> after a successful conversion?

I think the error handling here is generally broken (or at least very
questionable).

I suspect that in case of at least some errors the get_page() is leaking
even without this new patch.

In case I'm wrong a comment reasoning why there is no leak should be
added.


Juergen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xB0DE9DD628BF132F.asc
Type: application/pgp-keys
Size: 3683 bytes
Desc: OpenPGP public key
URL: <http://linuxtesting.org/pipermail/lvc-project/attachments/20250417/4f9c2e18/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://linuxtesting.org/pipermail/lvc-project/attachments/20250417/4f9c2e18/attachment.pgp>


More information about the lvc-project mailing list