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-next>] [day] [month] [year] [list]
Message-ID: <c4547cbd-d38b-4b50-92b1-0f3f717a7979@paulmck-laptop>
Date: Sun, 25 May 2025 21:49:53 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: torvalds@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, kernel-team@...a.com, pmladek@...e.com,
	akpm@...ux-foundation.org, john.ogness@...utronix.de
Subject: [GIT PULL] Rate-limit changes for v6.16

Hello, Linus,

When the v6.15 merge window opens, please pull this rate-limit update from:

  git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git tags/ratelimit.2025.05.25a
  # HEAD: ba575cea29fd82a0e6836fefcd51db36f1ff8a92: ratelimit: Drop redundant accesses to burst (2025-05-08 16:13:27 -0700)

These have been subject to -next testing for more than a month, have had
five LKML postings, have been featured on LWN, and with one exception
have a full set of acks.  That exception is this:

48e864ae8657 ("random: Avoid open-coded use of ratelimit_state structure's ->missed field")

The change from this series is function-preserving and is incidental to
the random subsystem, but is necessary to the series, which is in turn
needed to avoid silent and false-positive drops of rate-limited printk()s.

----------------------------------------------------------------
lib/ratelimit: Reduce false-positive and silent misses

Changes
-------

* Reduce open-coded use of ratelimit_state structure fields.
* Convert the ->missed field to atomic_t.
* Count misses that are due to lock contention.
* Eliminate jiffies=0 special case.
* Reduce ___ratelimit() false-positive rate limiting (Petr Mladek).
* Allow zero ->burst to hard-disable rate limiting.
* Optimize away atomic operations when a miss is guaranteed.
* Warn if ->interval or ->burst are negative (Petr Mladek).
* Simplify the resulting code.

A smoke test and stress test have been created, but they are not yet ready
for mainline.  With luck, we will offer them for the v6.17 merge window.

----------------------------------------------------------------
Paul E. McKenney (17):
      ratelimit: Create functions to handle ratelimit_state internals
      random: Avoid open-coded use of ratelimit_state structure's ->missed field
      drm/i915: Avoid open-coded use of ratelimit_state structure's ->missed field
      drm/amd/pm: Avoid open-coded use of ratelimit_state structure's internals
      ratelimit: Convert the ->missed field to atomic_t
      ratelimit: Count misses due to lock contention
      ratelimit: Avoid jiffies=0 special case
      ratelimit: Allow zero ->burst to disable ratelimiting
      ratelimit: Force re-initialization when rate-limiting re-enabled
      ratelimit: Don't flush misses counter if RATELIMIT_MSG_ON_RELEASE
      ratelimit: Avoid atomic decrement if already rate-limited
      ratelimit: Avoid atomic decrement under lock if already rate-limited
      ratelimit: Simplify common-case exit path
      ratelimit: Use nolock_ret label to save a couple of lines of code
      ratelimit: Use nolock_ret label to collapse lock-failure code
      ratelimit: Use nolock_ret restructuring to collapse common case code
      ratelimit: Drop redundant accesses to burst

Petr Mladek (2):
      ratelimit: Reduce ___ratelimit() false-positive rate limiting
      ratelimit: Warn if ->interval or ->burst are negative

 drivers/char/random.c              |  9 +++--
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 11 +-----
 drivers/gpu/drm/i915/i915_perf.c   |  8 ++--
 include/linux/ratelimit.h          | 37 ++++++++++++++++---
 include/linux/ratelimit_types.h    |  5 ++-
 lib/ratelimit.c                    | 75 ++++++++++++++++++++++++++------------
 6 files changed, 98 insertions(+), 47 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ