kernel-fxtec-pro1x/drivers/iio/adc
Jonathan Cameron 62d46fa157 iio:adc:ti-adc081c Fix alignment and data leak issues
commit 54f82df2ba86e2a8e9cbf4036d192366e3905c89 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.
As Lars also noted this anti pattern can involve a leak of data to
userspace and that indeed can happen here.  We close both issues by
moving to a suitable structure in the iio_priv().

This data is allocated with kzalloc so no data can leak apart
from previous readings.

The eplicit alignment of ts is necessary to ensure correct padding
on x86_32 where s64 is only aligned to 4 bytes.

Fixes: 08e05d1fce ("ti-adc081c: Initial triggered buffer support")
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>
2020-09-17 13:45:27 +02:00
..
ad799x.c iio: adc: ad799x: fix probe error handling 2019-10-17 13:45:12 -07:00
ad7266.c
ad7291.c
ad7298.c
ad7476.c
ad7766.c
ad7791.c
ad7793.c iio:ad7797: Use correct attribute_group 2020-05-02 17:25:49 +02:00
ad7887.c
ad7923.c
ad_sigma_delta.c
aspeed_adc.c
at91-sama5d2_adc.c iio: adc: at91-sama5d2_adc: fix differential channels in triggered mode 2020-03-25 08:06:10 +01:00
at91_adc.c
axp20x_adc.c
axp288_adc.c iio: adc: axp288: Override TS pin bias current for some models 2019-10-17 13:45:13 -07:00
bcm_iproc_adc.c
berlin2-adc.c
cc10001_adc.c
cpcap-adc.c
da9150-gpadc.c
dln2-adc.c iio: dln2-adc: fix iio_triggered_buffer_postenable() position 2019-12-31 16:35:33 +01:00
envelope-detector.c
ep93xx_adc.c
exynos_adc.c iio: adc: exynos-adc: Use proper number of channels for Exynos4x12 2019-09-16 08:22:06 +02:00
fsl-imx25-gcq.c
hi8435.c
hx711.c iio: adc: hx711: fix bug in sampling of data 2019-10-17 13:45:12 -07:00
imx7d_adc.c
ina2xx-adc.c iio:adc:ina2xx Fix timestamp alignment issue. 2020-09-17 13:45:27 +02:00
Kconfig
lp8788_adc.c
lpc18xx_adc.c
lpc32xx_adc.c
ltc2471.c
ltc2485.c
ltc2497.c
Makefile
max1027.c iio: adc: max1027: Reset the device at probe time 2019-12-31 16:35:17 +01:00
max1118.c iio:adc:max1118 Fix alignment of timestamp and data leak issues 2020-09-17 13:45:27 +02:00
max1363.c
max9611.c iio: adc: max9611: Fix too short conversion time delay 2020-01-09 10:18:55 +01:00
max11100.c
mcp320x.c
mcp3422.c iio: adc: mcp3422: fix locking on error path 2020-09-17 13:45:26 +02:00
men_z188_adc.c
meson_saradc.c iio: adc: meson_saradc: Fix memory allocation order 2019-11-06 13:05:39 +01:00
mt6577_auxadc.c
mxs-lradc-adc.c
nau7802.c
palmas_gpadc.c
qcom-pm8xxx-xoadc.c
qcom-spmi-iadc.c
qcom-spmi-vadc.c
qcom-vadc-common.c
qcom-vadc-common.h
rcar-gyroadc.c iio: adc: gyroadc: fix uninitialized return code 2019-09-16 08:22:22 +02:00
rockchip_saradc.c
sc27xx_adc.c
sd_adc_modulator.c
spear_adc.c
stm32-adc-core.c iio: adc: stm32-adc: fix a race when using several adcs with dma and irq 2019-10-17 13:45:23 -07:00
stm32-adc-core.h iio: adc: stm32-adc: fix a race when using several adcs with dma and irq 2019-10-17 13:45:23 -07:00
stm32-adc.c iio: adc: stm32-adc: fix device used to request dma 2020-05-27 17:37:44 +02:00
stm32-dfsdm-adc.c iio: adc: stm32-dfsdm: fix device used to request dma 2020-05-27 17:37:45 +02:00
stm32-dfsdm-core.c
stm32-dfsdm.h
stx104.c
sun4i-gpadc-iio.c
ti-adc081c.c iio:adc:ti-adc081c Fix alignment and data leak issues 2020-09-17 13:45:27 +02:00
ti-adc084s021.c iio:adc:ti-adc084s021 Fix alignment and data leak issues. 2020-09-17 13:45:27 +02:00
ti-adc108s102.c
ti-adc128s052.c
ti-adc161s626.c
ti-adc0832.c
ti-adc12138.c
ti-ads1015.c iio: adc: ti-ads1015: fix conversion when CONFIG_PM is not set 2020-09-17 13:45:26 +02:00
ti-ads7950.c
ti-ads8688.c
ti-tlc4541.c
ti_am335x_adc.c
twl4030-madc.c
twl6030-gpadc.c
vf610_adc.c
viperboard_adc.c
xilinx-xadc-core.c iio: xilinx-xadc: Make sure not exceed maximum samplerate 2020-04-29 16:31:26 +02:00
xilinx-xadc-events.c
xilinx-xadc.h