linux-stable/drivers/iio/adc
Matti Vaittinen 54246b9034 iio: at91-sama5d2_adc: Fix unsafe buffer attributes
The iio_triggered_buffer_setup_ext() was changed by
commit 15097c7a1a ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
to silently expect that all attributes given in buffer_attrs array are
device-attributes. This expectation was not forced by the API - and some
drivers did register attributes created by IIO_CONST_ATTR().

The added attribute "wrapping" does not copy the pointer to stored
string constant and when the sysfs file is read the kernel will access
to invalid location.

Change the IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order
to prevent the invalid memory access.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Fixes: 15097c7a1a ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/be69775aa302159f088b8b91894e6ec449bca65b.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-10-17 08:51:26 +01:00
..
ab8500-gpadc.c iio: adc: ab8500-gpadc: convert to device properties 2022-08-15 22:29:59 +01:00
ad799x.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
ad7091r-base.c iio:adc:ad7091r: Move exports into IIO_AD7091R namespace. 2022-02-18 11:42:26 +00:00
ad7091r-base.h
ad7091r5.c iio:adc:ad7091r: Move exports into IIO_AD7091R namespace. 2022-02-18 11:42:26 +00:00
ad7124.c iio: adc: ad7124: Benefit from devm_clk_get_enabled() to simplify 2022-08-15 22:30:02 +01:00
ad7192.c iio: Replace strtobool() with kstrtobool() 2022-04-28 19:22:54 +01:00
ad7266.c iio: adc: ad7266: Fix alignment for DMA safety 2022-06-14 11:53:12 +01:00
ad7280a.c iio: adc: ad7280a: Fix alignment for DMA safety 2022-06-14 11:53:12 +01:00
ad7291.c
ad7292.c iio: ad7292: Prevent regulator double disable 2022-08-21 18:24:16 +01:00
ad7298.c iio: adc: ad7298: Fix alignment for DMA safety 2022-06-14 11:53:12 +01:00
ad7476.c iio: adc: ad7476: Fix alignment for DMA safety 2022-06-14 11:53:12 +01:00
ad7606.c iio: adc: ad7606: explicitly add proper header files 2022-06-14 11:53:19 +01:00
ad7606.h iio: adc: ad7606: Fix alignment for DMA safety 2022-06-14 11:53:12 +01:00
ad7606_par.c iio: adc: ad7606_par: explicitly add proper header files 2022-06-14 11:53:19 +01:00
ad7606_spi.c iio:adc:ad76060: Move exports into IIO_AD7606 namespace. 2022-02-18 11:42:26 +00:00
ad7766.c iio: adc: ad7766: Fix alignment for DMA safety 2022-06-14 11:53:12 +01:00
ad7768-1.c iio: adc: ad7768-1: Benefit from devm_clk_get_enabled() to simplify 2022-08-15 22:30:02 +01:00
ad7780.c iio:adc:ad_sigma_delta: Move exports into IIO_AD_SIGMA_DELTA namespace 2022-02-18 11:42:26 +00:00
ad7791.c iio:adc:ad_sigma_delta: Move exports into IIO_AD_SIGMA_DELTA namespace 2022-02-18 11:42:26 +00:00
ad7793.c iio:adc:ad_sigma_delta: Move exports into IIO_AD_SIGMA_DELTA namespace 2022-02-18 11:42:26 +00:00
ad7887.c iio: adc: ad7887: Fix alignment for DMA safety 2022-06-14 11:53:13 +01:00
ad7923.c iio: adc: ad7923: support extended range 2022-09-21 18:42:55 +01:00
ad7949.c iio: adc: ad7949: Fix error message 2022-07-16 18:50:24 +01:00
ad9467.c iio: adc: ad9467: Benefit from devm_clk_get_enabled() to simplify 2022-08-15 22:30:02 +01:00
ad_sigma_delta.c iio: adc: ad_sigma_delta: Add sequencer support 2022-04-04 09:11:25 +01:00
adi-axi-adc.c IIO new device support, features and minor fixes for 5.20 2022-07-14 15:04:49 +02:00
aspeed_adc.c iio: adc: aspeed: Fix refcount leak in aspeed_adc_set_trim_data 2022-06-19 17:22:48 +01:00
at91-sama5d2_adc.c iio: at91-sama5d2_adc: Fix unsafe buffer attributes 2022-10-17 08:51:26 +01:00
at91_adc.c iio:adc:at91-adc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc 2022-02-18 11:43:11 +00:00
axp20x_adc.c 1st set of IIO new device support, features and cleanup for 5.17 2021-12-22 12:33:01 +01:00
axp288_adc.c iio: adc: axp288: Override TS pin bias current for some models 2022-05-07 15:23:39 +01:00
bcm_iproc_adc.c
berlin2-adc.c iio: adc: berlin2-adc: explicitly add proper header files 2022-06-14 11:53:20 +01:00
cc10001_adc.c
cpcap-adc.c iio: adc: cpcap-adc: remove redundant assignment to variable cal_data_diff 2022-02-07 20:40:39 +00:00
da9150-gpadc.c
dln2-adc.c iio: dln2: Check return value of devm_iio_trigger_register() 2021-11-17 17:52:35 +00:00
envelope-detector.c iio:adc:envelope-detector: Switch from of headers to mod_devicetable.h 2021-12-12 17:13:11 +00:00
ep93xx_adc.c
exynos_adc.c iio:adc:exynos_adc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() 2022-02-18 11:43:11 +00:00
fsl-imx25-gcq.c
hi8435.c iio: adc: hi8435: Fix alignment for DMA safety 2022-06-14 11:53:13 +01:00
hx711.c
imx7d_adc.c iio: adc: imx7d_adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() 2022-07-18 18:48:17 +01:00
imx8qxp-adc.c iio: adc: imx8qxp-adc: propagate regulator_get_voltage error 2022-08-15 22:29:57 +01:00
ina2xx-adc.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
ingenic-adc.c iio: adc: ingenic-adc: Benefit from devm_clk_get_prepared() to simplify 2022-08-15 22:30:02 +01:00
intel_mrfld_adc.c iio: adc: intel_mrfld_adc: explicitly add proper header files 2022-06-15 22:07:09 +01:00
Kconfig iio: adc: mcp3911: add support for buffers 2022-09-21 21:15:10 +01:00
lp8788_adc.c
lpc18xx_adc.c iio: adc: lpc18xx: Benefit from devm_clk_get_enabled() to simplify 2022-08-15 22:30:02 +01:00
lpc32xx_adc.c
ltc2471.c
ltc2485.c
ltc2496.c drivers: iio: adc: ltc2497: Rename the LTC2499 iio device 2022-09-21 18:42:54 +01:00
ltc2497-core.c drivers: iio: adc: ltc2497: Rename the LTC2499 iio device 2022-09-21 18:42:54 +01:00
ltc2497.c Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
ltc2497.h drivers: iio: adc: ltc2497: Rename the LTC2499 iio device 2022-09-21 18:42:54 +01:00
Makefile iio: adc: add max11205 adc driver 2022-09-05 18:08:34 +01:00
max1027.c iio: adc: max1027: unlock on error path in max1027_read_single_value() 2022-07-19 09:30:05 +01:00
max1118.c iio: adc: max1118: Fix alignment for DMA safety 2022-06-14 11:53:13 +01:00
max1241.c iio: adc: max1241: Fix alignment for DMA safety 2022-06-14 11:53:13 +01:00
max1363.c iio: adc: max1363: Drop provision to provide an IIO channel map via platform data 2022-09-05 18:08:42 +01:00
max9611.c iio: max9611: Use sysfs_emit() 2022-01-23 18:03:36 +00:00
max11100.c iio: adc: max11100: Fix alignment for DMA safety 2022-06-14 11:53:13 +01:00
max11205.c iio: adc: add max11205 adc driver 2022-09-05 18:08:34 +01:00
mcp320x.c iio: adc: mcp320x: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
mcp3422.c
mcp3911.c iio: adc: mcp3911: mask out device ID in debug prints 2022-10-17 08:51:26 +01:00
men_z188_adc.c iio: adc: men_z188_adc: Fix a resource leak in an error handling path 2022-01-30 13:51:24 +00:00
meson_saradc.c iio: adc: meson_saradc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() 2022-07-18 18:48:17 +01:00
mp2629_adc.c iio: adc: mp2629_adc: explicitly add proper header files 2022-06-14 11:53:20 +01:00
mt6360-adc.c iio: adc: mt6360: Drop an incorrect __maybe_unused marking. 2022-08-15 22:30:02 +01:00
mt6577_auxadc.c iio: adc: mt6577_auxadc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() 2022-07-18 18:48:17 +01:00
mxs-lradc-adc.c
nau7802.c iio: adc: nau7802: Make use of device properties 2022-06-14 11:53:09 +01:00
npcm_adc.c iio: adc: npcm: Add NPCM8XX support 2022-07-18 18:29:29 +01:00
palmas_gpadc.c iio: palmas: shut up warning about calibration mismatch (due to noise) 2022-04-04 09:11:25 +01:00
qcom-pm8xxx-xoadc.c iio: adc: qcom-pm8xxx-xoadc: convert to device properties 2022-08-15 22:29:59 +01:00
qcom-spmi-adc5.c iio: adc: qcom-spmi-adc5: add ADC5_VREF_VADC to rev2 ADC5 2022-08-19 18:27:59 +01:00
qcom-spmi-iadc.c
qcom-spmi-rradc.c iio: adc: qcom-spmi-rradc: Fix spelling mistake "coherrency" -> "coherency" 2022-07-01 11:19:08 +01:00
qcom-spmi-vadc.c iio: adc: qcom-spmi-vadc: convert to device properties 2022-08-15 22:30:00 +01:00
qcom-vadc-common.c iio: adc: qcom-vadc-common: add reverse scaling for PMIC5 Gen2 ADC_TM 2022-05-19 12:11:51 +02:00
rcar-gyroadc.c iio:adc:rcar: Switch from CONFIG_PM guards to pm_ptr() etc 2022-02-21 19:33:03 +00:00
rn5t618-adc.c iio: adc: rn5t618: Re-use generic struct u16_fract 2022-01-30 12:21:25 +00:00
rockchip_saradc.c iio:adc:rockchip: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc 2022-02-18 11:43:12 +00:00
rtq6056.c iio: adc: Add rtq6056 support 2022-08-15 22:29:57 +01:00
rzg2l_adc.c IIO new device support, features and minor fixes for 5.20 2022-07-14 15:04:49 +02:00
sc27xx_adc.c iio: adc: sc27xx_adc: Re-use generic struct u32_fract 2022-06-15 22:07:10 +01:00
sd_adc_modulator.c
spear_adc.c
stm32-adc-core.c iio: adc: stm32-adc: add id registers support 2022-09-21 18:42:55 +01:00
stm32-adc-core.h iio: adc: stm32-adc: add id registers support 2022-09-21 18:42:55 +01:00
stm32-adc.c iio: adc: stm32-adc: fix channel sampling time init 2022-10-17 08:51:26 +01:00
stm32-dfsdm-adc.c iio: adc: stm32-dfsdm: Avoid dereferencing ->currentmode 2022-04-10 16:15:02 +01:00
stm32-dfsdm-core.c iio:adc:stm32*: Use pm[_sleep]_ptr() etc to avoid need to make pm __maybe_unused 2022-02-21 19:33:04 +00:00
stm32-dfsdm.h
stmpe-adc.c iio: adc: stmpe-adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() 2022-07-18 18:48:17 +01:00
sun4i-gpadc-iio.c iio/drivers/sun4i_gpadc: Switch to new of thermal API 2022-08-17 14:09:39 +02:00
ti-adc081c.c iio: adc: ti-adc081c: Partial revert of removal of ACPI IDs 2021-12-21 15:13:29 +00:00
ti-adc084s021.c iio: adc: ti-adc084s021: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
ti-adc108s102.c iio: adc: ti-adc108s102: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
ti-adc128s052.c iio: adc: ti-adc128s052: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
ti-adc161s626.c iio: adc: ti-adc161s626: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
ti-adc0832.c iio: adc: ti-adc0832: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
ti-adc12138.c iio: adc: ti-adc12138: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
ti-ads124s08.c iio: adc: ti-ads124s08: Drop unused parameter to ads124s_read() 2022-07-18 18:43:42 +01:00
ti-ads131e08.c iio: adc: ti-ads131e08: Benefit from devm_clk_get_enabled() to simplify 2022-08-15 22:30:02 +01:00
ti-ads1015.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
ti-ads7950.c iio: adc: ti-ads7950: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
ti-ads8344.c iio: adc: ti-ads8344: Fix alignment for DMA safety 2022-06-14 11:53:15 +01:00
ti-ads8688.c iio: adc: ti-ads8688: Fix alignment for DMA safety 2022-06-14 11:53:15 +01:00
ti-tlc4541.c iio: adc: ti-tlc4541: Fix alignment for DMA safety 2022-06-14 11:53:15 +01:00
ti-tsc2046.c iio: adc: tsc2046: silent spi_device_id warning 2022-09-04 14:55:03 +01:00
ti_am335x_adc.c iio: adc: ti-am335x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() 2022-07-18 18:48:17 +01:00
twl4030-madc.c iio: adc: twl4030-madc: Re-use generic struct s16_fract 2022-01-30 12:21:25 +00:00
twl6030-gpadc.c iio: adc: Add check for devm_request_threaded_irq 2022-02-26 18:43:59 +00:00
vf610_adc.c iio: adc: vf610_adc: Make use of device properties 2022-06-14 11:53:08 +01:00
viperboard_adc.c
xilinx-ams.c iio: adc: xilinx-ams: Benefit from devm_clk_get_enabled() to simplify 2022-08-15 22:30:02 +01:00
xilinx-xadc-core.c iio: adc: xilinx-xadc: Benefit from devm_clk_get_enabled() to simplify 2022-08-15 22:30:02 +01:00
xilinx-xadc-events.c
xilinx-xadc.h