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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0a633091-4ae0-4a89-9fe7-99336656009c@broadcom.com>
Date: Wed, 8 Jan 2025 08:53:15 -0800
From: Florian Fainelli <florian.fainelli@...adcom.com>
To: Jakub Kicinski <kuba@...nel.org>,
 Florian Fainelli <florian.fainelli@...adcom.com>
Cc: Aaron Tomlin <atomlin@...mlin.com>, ronak.doshi@...adcom.com,
 andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
 pabeni@...hat.com, bcm-kernel-feedback-list@...adcom.com,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 0/1] vmxnet3: Adjust maximum Rx ring buffer size

On 1/6/25 16:57, Jakub Kicinski wrote:
> On Mon, 6 Jan 2025 15:51:10 -0800 Florian Fainelli wrote:
>> On 1/6/25 15:47, 'Jakub Kicinski' via BCM-KERNEL-FEEDBACK-LIST,PDL wrote:
>>> On Sun,  5 Jan 2025 21:30:35 +0000 Aaron Tomlin wrote:
>>>> I managed to trigger the MAX_PAGE_ORDER warning in the context of function
>>>> __alloc_pages_noprof() with /usr/sbin/ethtool --set-ring rx 4096 rx-mini
>>>> 2048 [devname]' using the maximum supported Ring 0 and Rx ring buffer size.
>>>> Admittedly this was under the stock Linux kernel-4.18.0-477.27.1.el8_8
>>>> whereby CONFIG_CMA is not enabled. I think it does not make sense to
>>>> attempt a large memory allocation request for physically contiguous memory,
>>>> to hold the Rx Data ring that could exceed the maximum page-order supported
>>>> by the system.
>>>
>>> I think CMA should be a bit orthogonal to the warning.
>>>
>>> Off the top of my head the usual way to solve the warning is to add
>>> __GFP_NOWARN to the allocations which trigger it. And then handle
>>> the error gracefully.
>>
>> That IMHO should really be the default for any driver that calls
>> __netdev_alloc_skb() under the hood, we should not really have to
>> specify __GFP_NOWARN, rather if people want it, they should specify it.
> 
> True, although TBH I don't fully understand why this flag exists
> in the first place. Is it just supposed to be catching programming
> errors, or is it due to potential DoS implications of users triggering
> large allocations?
> 

There is some value IMHO in printing when allocations fail, where they 
came from, their gfp_t flags and page order so you can track high order 
offenders in hot paths (one of our Wi-Fi driver was notorious for doing 
that and having verbose out of memory dumps by default definitively 
helped). Once you fix those however, hogging the system while dumping 
lines and lines of information onto a slow console tends to be worse 
than the recovery from out of memory itself. One could argue that 
triggering an OOM plus dumping information can result in a DoS, so that 
should be frowned upon...
-- 
Florian


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ