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: <25d0268f-ab13-4e73-888d-ff75acf8b551@akamai.com>
Date: Tue, 16 Sep 2025 09:38:35 -0400
From: Jason Baron <jbaron@...mai.com>
To: Eric Dumazet <edumazet@...gle.com>
CC: <davem@...emloft.net>, <kuba@...nel.org>, <pabeni@...hat.com>,
        <netdev@...r.kernel.org>, Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net] net: allow alloc_skb_with_frags() to use
 MAX_SKB_FRAGS



On 9/16/25 1:59 AM, Eric Dumazet wrote:
> !-------------------------------------------------------------------|
>    This Message Is From an External Sender
>    This message came from outside your organization.
> |-------------------------------------------------------------------!
> 
> On Mon, Sep 15, 2025 at 8:49 PM Jason Baron <jbaron@...mai.com> wrote:
>>
>> Currently, alloc_skb_with_frags() will only fill (MAX_SKB_FRAGS - 1)
>> slots. I think it should use all MAX_SKB_FRAGS slots, as callers of
>> alloc_skb_with_frags() will size their allocation of frags based
>> on MAX_SKB_FRAGS.
> 
> Hi Jason
> 
> Interesting !
> 
> Could you give some details here, have you found this for af_unix users ?
> 
> They would still fail if no high order pages are available, for
> allocations bigger than 64K ?
> 

Hi Eric,

So we have an oot patch that sets 'order' to 0 upon entry into 
alloc_skb_with_frags(), which effectively tests/simulates high 
fragmentation. And yes, as you guessed, in this case we saw that 
sendmsg() on unix sockets will fail every time for large allocations - 
data_len will want 68K or 17 pages, but alloc_skb_with_frags() can only 
do 64K in this case or 16 pages.

>>
>> Signed-off-by: Jason Baron <jbaron@...mai.com>
>> ---
>>   net/core/skbuff.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
>> index 23b776cd9879..df942aca0617 100644
>> --- a/net/core/skbuff.c
>> +++ b/net/core/skbuff.c
>> @@ -6669,7 +6669,7 @@ struct sk_buff *alloc_skb_with_frags(unsigned long header_len,
>>                  return NULL;
>>
>>          while (data_len) {
>> -               if (nr_frags == MAX_SKB_FRAGS - 1)
>> +               if (nr_frags == MAX_SKB_FRAGS)
>>                          goto failure;
>>                  while (order && PAGE_ALIGN(data_len) < (PAGE_SIZE << order))
>>                          order--;
>> --
>> 2.25.1
>>
> 
> We require a Fixes: tag for patches targeting net tree.
> 
> I suspect this would be
> 
> Fixes: 09c2c90705bb ("net: allow alloc_skb_with_frags() to allocate
> bigger packets")
> 

Happy to re-spin here with this, if there is interest in the patch.

Thanks,

-Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ