linux-stable/drivers/iio
Len Baker 273a7fbb06 drivers/iio: Remove all strcpy() uses
[ Upstream commit d722f1e06f ]

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. So, remove all the uses and add
devm_kstrdup() or devm_kasprintf() instead.

Also, modify the "for" loop conditions to clarify the access to the
st->orientation.rotation buffer.

This patch is an effort to clean up the proliferation of str*()
functions in the kernel and a previous step in the path to remove
the strcpy function from the kernel entirely [1].

[1] https://github.com/KSPP/linux/issues/88

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210815174204.126593-1-len.baker@gmx.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 14:23:11 +02:00
..
accel iio: accel: mma8452: use the correct logic to get mma8452_data 2022-07-12 16:35:01 +02:00
adc iio: adc: ti-ads131e08: add missing fwnode_handle_put() in ads131e08_alloc_channels() 2022-06-29 09:03:29 +02:00
afe iio: afe: rescale: Fix boolean logic bug 2022-06-29 09:03:28 +02:00
amplifiers
buffer
cdc
chemical iio:chemical:ccs811: rearrange iio trigger get and register 2022-06-29 09:03:28 +02:00
common iio: st_sensors: Add a local lock for protecting odr 2022-06-14 18:36:20 +02:00
dac iio: dac: ad5446: Fix read_raw not returning set value 2022-05-09 09:14:28 +02:00
dummy iio: dummy: iio_simple_dummy: check the return value of kstrdup() 2022-06-14 18:36:19 +02:00
frequency
gyro iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up() 2022-06-29 09:03:28 +02:00
health
humidity iio:humidity:hts221: rearrange iio trigger get and register 2022-06-29 09:03:27 +02:00
imu drivers/iio: Remove all strcpy() uses 2022-08-17 14:23:11 +02:00
light iio: light: isl29028: Fix the warning in isl29028_remove() 2022-08-17 14:22:55 +02:00
magnetometer iio: magnetometer: yas530: Fix memchr_inv() misuse 2022-06-29 09:03:26 +02:00
multiplexer
orientation iio: hid-sensors: bind IIO channels alloc to device object 2021-07-13 18:21:53 +01:00
position iio: hid-sensors: Update header includes 2021-06-16 14:53:13 +01:00
potentiometer iio: potentiometer: Add driver support for AD5110 2021-08-15 15:38:16 +01:00
potentiostat
pressure iio: st_pressure_spi: Add missing entries SPI to device ID table 2021-11-18 19:16:50 +01:00
proximity iio: proximity: vl53l0x: Fix return value check of wait_for_completion_timeout 2022-06-14 18:36:05 +02:00
resolver
temperature iio: ltc2983: fix device probe 2021-08-15 16:58:37 +01:00
test iio/test-format: build kunit tests without structleak plugin 2021-10-06 17:53:36 -06:00
trigger iio: trigger: sysfs: fix use-after-free on remove 2022-06-29 09:03:28 +02:00
iio_core.h
iio_core_trigger.h
industrialio-buffer.c iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL 2022-02-16 12:56:37 +01:00
industrialio-configfs.c
industrialio-core.c iio: fix iio_format_avail_range() printing for none IIO_VAL_INT 2022-08-17 14:22:55 +02:00
industrialio-event.c
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c iio: trigger: Fix a scheduling whilst atomic issue seen on tsc2046 2022-01-27 11:02:57 +01:00
industrialio-triggered-event.c
inkern.c iio: inkern: make a best effort on offset calculation 2022-04-08 14:22:50 +02:00
Kconfig
Makefile
TODO