summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorBill Wendling <morbo@google.com>2026-09-23 19:24:50 +0000
committerJonathan Cameron <jonathan.cameron@oss.qualcomm.com>2026-09-28 17:07:33 +0100
commitaa26008e57ac28346032d82a92946ca6bf44d4ef (patch)
treed07154093122d899fc0bcb63f6d9212a77074368 /tools/perf/scripts/python/stackcollapse.py
parent1182148719cffb5ea7a4610dac34deac9a70cf89 (diff)
downloadlinux-next-aa26008e57ac28346032d82a92946ca6bf44d4ef.tar.gz
linux-next-aa26008e57ac28346032d82a92946ca6bf44d4ef.zip
iio: gts-helper: add __counted_by_ptr to struct iio_gts
The compiler attribute __counted_by_ptr can be used by KASAN and UBSAN to detect out-of-bounds accesses to pointer fields in structs where a corresponding element count field is available. In "struct iio_gts", there are multiple pointer fields associated with an element count. This patch annotates these pointer fields with "__counted_by_ptr" to improve runtime safety: - 'hwgain_table': counted by 'num_hwgain' - 'itime_table': counted by 'num_itime' - 'per_time_avail_scale_tables': counted by 'num_itime' - 'avail_all_scales_table': counted by 'num_avail_all_scales' - 'avail_time_tables': counted by 'num_avail_time_tables' To ensure that the count is set correctly before any pointer is accessed or assigned, we update "iio_init_iio_gts()" to set the counts prior to assigning the pointers. Cc: codemender-patching+linux@google.com Assisted-by: LLM Signed-off-by: Bill Wendling <morbo@google.com> Acked-by: Matti Vaittinen <mazziesaccount@gmail.com> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions