Skip to contentSkip to conversation

regmap: Annotate regmap_access_table members with __counted_by_ptr()

PATCH In review Thorsten Blum 2 participants 2 messages Nov 2 Register map abstraction

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regmap: Annotate regmap_access_table members with __counted_by_ptr()

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.

---
 include/linux/regmap.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/regmap.h +2 -2
index c8aebd148e08..a72f17ab6264 100644
@@ -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;
 };
 
maintainer
#1 lore raw
Quoted 1 line · Thorsten Blum

regmap: Annotate regmap_access_table members with __counted_by_ptr()

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-7.5

Thanks!

[1/1] regmap: Annotate regmap_access_table members with __counted_by_ptr()
https://git.kernel.org/broonie/regmap/c/acebd8e4f16f

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark