summaryrefslogtreecommitdiff
path: root/drivers/iio/accel
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2020-07-22 18:50:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-23 09:46:10 +0300
commit9015a170dedfbc3aa263cc0ef9d095bcc3b6d0b4 (patch)
treedfa2d3c08fd8d67186c1256a452eb15d1f3a5839 /drivers/iio/accel
parent475dcc33c060c131680b1ec94aa18dbd4f5783c1 (diff)
downloadlinux-9015a170dedfbc3aa263cc0ef9d095bcc3b6d0b4.tar.xz
iio:light:ltr501 Fix timestamp alignment issue.
commit 2684d5003490df5398aeafe2592ba9d4a4653998 upstream. 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 an array of smaller elements on the stack. Here we use a structure on the stack. The driver already did an explicit memset so no data leak was possible. Forced alignment of ts is not strictly necessary but probably makes the code slightly less fragile. Note there has been some rework in this driver of the years, so no way this will apply cleanly all the way back. Fixes: 2690be905123 ("iio: Add Lite-On ltr501 ambient light / proximity sensor driver") Reported-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/accel')
0 files changed, 0 insertions, 0 deletions