aboutsummaryrefslogtreecommitdiff
path: root/scripts/const_structs.checkpatch
diff options
context:
space:
mode:
authorJonathan Cameron <[email protected]>2020-07-22 16:50:41 +0100
committerJonathan Cameron <[email protected]>2020-09-21 20:01:50 +0100
commit10ab7cfd5522f0041028556dac864a003e158556 (patch)
tree0336f7df13f5e303004d6a2ef8eebc8c07f1fa97 /scripts/const_structs.checkpatch
parentf71e41e23e129640f620b65fc362a6da02580310 (diff)
iio:gyro:itg3200: Fix timestamp alignment and prevent data leak.
One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses a 16 byte array of smaller elements on the stack. This is fixed by using an explicit c structure. As there are no holes in the structure, there is no possiblity of data leakage in this case. The explicit alignment of ts is not strictly necessary but potentially makes the code slightly less fragile. It also removes the possibility of this being cut and paste into another driver where the alignment isn't already true. Fixes: 36e0371e7764 ("iio:itg3200: Use iio_push_to_buffers_with_timestamp()") Reported-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions