mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND] i2c: atr: annotate i2c_atr_adap_desc->aliases with __counted_by_ptr
@ 2026-06-11 21:55 Thorsten Blum
  2026-06-16 22:18 ` Andi Shyti
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-06-11 21:55 UTC (permalink / raw)
  To: Tomi Valkeinen, Luca Ceresoli, Kees Cook, Gustavo A. R. Silva
  Cc: Thorsten Blum, linux-i2c, linux-kernel, linux-hardening

Add the __counted_by_ptr() compiler attribute to ->aliases to improve
bounds checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 include/linux/i2c-atr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/i2c-atr.h b/include/linux/i2c-atr.h
index 2bb54dc87c8e..b52a7b9ec536 100644
--- a/include/linux/i2c-atr.h
+++ b/include/linux/i2c-atr.h
@@ -71,7 +71,7 @@ struct i2c_atr_adap_desc {
 	struct device *parent;
 	struct fwnode_handle *bus_handle;
 	size_t num_aliases;
-	u16 *aliases;
+	u16 *aliases __counted_by_ptr(num_aliases);
 };
 
 /**

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

* Re: [PATCH RESEND] i2c: atr: annotate i2c_atr_adap_desc->aliases with __counted_by_ptr
  2026-06-11 21:55 [PATCH RESEND] i2c: atr: annotate i2c_atr_adap_desc->aliases with __counted_by_ptr Thorsten Blum
@ 2026-06-16 22:18 ` Andi Shyti
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Shyti @ 2026-06-16 22:18 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Tomi Valkeinen, Luca Ceresoli, Kees Cook, Gustavo A. R. Silva,
	linux-i2c, linux-kernel, linux-hardening

Hi Thorsten,

On Thu, Jun 11, 2026 at 11:55:02PM +0200, Thorsten Blum wrote:
> Add the __counted_by_ptr() compiler attribute to ->aliases to improve
> bounds checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.
> 
> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

merged in i2c/i2c-host.

Thanks,
Andi

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

end of thread, other threads:[~2026-06-16 22:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-11 21:55 [PATCH RESEND] i2c: atr: annotate i2c_atr_adap_desc->aliases with __counted_by_ptr Thorsten Blum
2026-06-16 22:18 ` Andi Shyti

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®