i2c: atr: annotate i2c_atr_adap_desc->aliases with __counted_by_ptr
Subsystems (2)
PATCH RESEND 1/1 i2c: atr: annotate i2c_atr_adap_desc->aliases with __counted_by_ptr
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 <[email protected]>
Signed-off-by Thorsten Blum <[email protected]>
--- include/linux/i2c-atr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/i2c-atr.h +1 -1
@@ -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); };/**
Andi Shyti
maintainerHi Thorsten,
Quoted 5 lines · Thorsten Blum
Add the
__counted_by_ptr()compiler attribute to ->aliases to improve bounds checking viaCONFIG_UBSAN_BOUNDSandCONFIG_FORTIFY_SOURCE.Reviewed-by Luca Ceresoli <[email protected]>Signed-off-by Thorsten Blum <[email protected]>
merged in i2c/i2c-host.
Thanks,
Andi