mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regmap: Annotate regmap_access_table members with __counted_by_ptr()
@ 2026-11-02 11:30 Thorsten Blum
  2026-11-02 11:43 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-11-02 11:30 UTC (permalink / raw)
  To: Mark Brown, Kees Cook, Gustavo A. R. Silva
  Cc: Thorsten Blum, linux-kernel, linux-hardening

Add __counted_by_ptr() to regmap_access_table::yes_ranges and
regmap_access_table::no_ranges to improve access bounds checking via
CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.

Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 include/linux/regmap.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index c8aebd148e08..a72f17ab6264 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -248,9 +248,9 @@ struct regmap_range {
  * check function will return true. "no_ranges" are searched first.
  */
 struct regmap_access_table {
-	const struct regmap_range *yes_ranges;
+	const struct regmap_range *yes_ranges __counted_by_ptr(n_yes_ranges);
 	unsigned int n_yes_ranges;
-	const struct regmap_range *no_ranges;
+	const struct regmap_range *no_ranges __counted_by_ptr(n_no_ranges);
 	unsigned int n_no_ranges;
 };
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-02 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 11:30 [PATCH] regmap: Annotate regmap_access_table members with __counted_by_ptr() Thorsten Blum
2026-11-02 11:43 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®