[PATCH 0/5] Rate limited printing for Rust
From: Alice Ryhl
Date: Tue Jun 23 2026 - 11:38:24 EST
To avoid DoS on the kernel log, the Rust Binder driver is being switched
to rate limited printing. But before we can do that, we must first
implement rate limited printing for Rust. Thus, do that.
However, it turns out that before we can implement rate limited
printing, we must first implement the ability declare a raw_spinlock_t
in a global variable. Thus, do that too.
The core Rust part of the series applies on top of 7.1-rc6, but the
Binder patches require some other Binder changes. I'll be resending a
more useful and easier to apply series after the merge window.
Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
---
Alice Ryhl (5):
rust: sync: move lockdep types to rust/kernel/sync/lockdep.rs
rust: sync: add const constructor for raw_spinlock_t
rust: add pr_*_ratelimit! macros for printing
rust_binder: consolidate transaction failure prints
rust_binder: use pr_*_ratelimited! for printing
drivers/android/binder/allocation.rs | 4 +-
drivers/android/binder/context.rs | 6 +-
drivers/android/binder/error.rs | 4 -
drivers/android/binder/freeze.rs | 22 ++--
drivers/android/binder/node.rs | 8 +-
drivers/android/binder/page_range.rs | 12 +-
drivers/android/binder/process.rs | 36 +++---
drivers/android/binder/thread.rs | 133 ++++++++++++----------
drivers/android/binder/transaction.rs | 25 +----
include/linux/spinlock_types_raw.h | 4 +
rust/bindings/lib.rs | 24 ++++
rust/helpers/helpers.c | 1 +
rust/helpers/ratelimit.c | 14 +++
rust/kernel/error.rs | 2 +-
rust/kernel/lib.rs | 1 +
rust/kernel/prelude.rs | 8 ++
rust/kernel/ratelimit.rs | 202 ++++++++++++++++++++++++++++++++++
rust/kernel/sync.rs | 135 +----------------------
rust/kernel/sync/lock/spinlock.rs | 29 +++++
rust/kernel/sync/lockdep.rs | 161 +++++++++++++++++++++++++++
20 files changed, 574 insertions(+), 257 deletions(-)
---
base-commit: 242689558c681ab2df283c54ed7b9dee8db0904d
change-id: 20260619-pr-ratelimited-6e20fa89bd5b
Best regards,
--
Alice Ryhl <aliceryhl@xxxxxxxxxx>