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: <aA-Xb89sgQd5ZaGO@pathway.suse.cz>
Date: Mon, 28 Apr 2025 16:57:51 +0200
From: Petr Mladek <pmladek@...e.com>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: linux-kernel@...r.kernel.org, kernel-team@...a.com,
	Andrew Morton <akpm@...ux-foundation.org>,
	Kuniyuki Iwashima <kuniyu@...zon.com>,
	Mateusz Guzik <mjguzik@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	John Ogness <john.ogness@...utronix.de>,
	Sergey Senozhatsky <senozhatsky@...omium.org>,
	Jon Pan-Doh <pandoh@...gle.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Karolina Stolarek <karolina.stolarek@...cle.com>,
	Bert Karwatzki <spasswolf@....de>,
	"Aithal, Srikanth" <sraithal@....com>,
	Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH v3 10/20] ratelimit: Allow zero ->burst to disable
 ratelimiting

On Thu 2025-04-24 17:28:16, Paul E. McKenney wrote:
> If ->interval is zero, then rate-limiting will be disabled.
> Alternatively, if interval is greater than zero and ->burst is zero,
> then rate-limiting will be applied unconditionally.
> 
> Therefore, make this classification be lockless.
> 
> Note that although negative ->interval and ->burst happen to be treated
> as if they were zero, this is an accident of the current implementation.
> The semantics of negative values for these fields is subject to change
> without notice.  Especially given that Bert Karwatzki determined that
> current calls to ___ratelimit() currently never have negative values
> for these fields.
>
> This commit replaces an earlier buggy versions.

If there was another revision then it would be nice to explicitly
describe also the reason why both zero ->interval and ->burst never
rate-limits. It is the state when the structure is zeroed. Some
existing code relied in this behavior.

If I get it correctly then this is the difference between this and
the previous version of this patch. And the previous version
caused regressions described by the Links...

> Link: https://lore.kernel.org/all/fbe93a52-365e-47fe-93a4-44a44547d601@paulmck-laptop/
> Link: https://lore.kernel.org/all/20250423115409.3425-1-spasswolf@web.de/
> Reported-by: Bert Karwatzki <spasswolf@....de>
> Reported-by: "Aithal, Srikanth" <sraithal@....com>
> Closes: https://lore.kernel.org/all/20250423115409.3425-1-spasswolf@web.de/
> Reported-by: Mark Brown <broonie@...nel.org>
> Closes: https://lore.kernel.org/all/257c3b91-e30f-48be-9788-d27a4445a416@sirena.org.uk/
> Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
> Tested-by: "Aithal, Srikanth" <sraithal@....com>

Otherwise, it looks good to me:

Reviewed-by: Petr Mladek <pmladek@...e.com>

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ