linux-next/include/linux/iio
Matteo Martelli 22ccb0a1c5 iio: consumers: ensure read buffers for labels and ext_info are page aligned
Attributes of iio providers are exposed via sysfs. Typically, providers
pass attribute values to the iio core, which handles formatting and
printing to sysfs. However, some attributes, such as labels or extended
info, are directly formatted and printed to sysfs by provider drivers
using sysfs_emit() and sysfs_emit_at(). These helpers assume the read
buffer, allocated by sysfs fop, is page-aligned. When these attributes
are accessed by consumer drivers, the read buffer is allocated by the
consumer and may not be page-aligned, leading to failures in the
provider's callback that utilizes sysfs_emit*.

Add a check to ensure that read buffers for labels and external info
attributes are page-aligned. Update the prototype documentation as well.

Signed-off-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20241202-iio-kmalloc-align-v1-1-aa9568c03937@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-12-11 19:20:49 +00:00
..
accel iio: accel: kxcjk1013: Support orientation matrix 2020-01-18 14:26:13 +00:00
adc iio: adc: ad_sigma_delta: Store information about reset sequence length 2024-12-11 19:20:48 +00:00
afe iio: afe: rescale: add offset support 2022-02-27 13:38:10 +00:00
common iio: invensense: fix timestamp glitches when switching frequency 2024-05-03 11:48:56 +01:00
dac dt-bindings:iio:dac: update microchip,mcp4725.yaml reference 2021-04-07 08:36:38 +01:00
frequency iio: adf4350: Convert to use GPIO descriptor 2019-12-15 11:42:16 +00:00
gyro iio: gyro: itg3200_core: do not use internal iio_dev lock 2022-11-23 19:43:58 +00:00
imu iio: imu: adis: Remove documented not used elements 2024-12-07 17:49:11 +00:00
timer treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
backend.h iio: backend: extend features 2024-11-01 14:54:48 +00:00
buffer_impl.h iio: core: Add new DMABUF interface infrastructure 2024-06-30 11:29:17 +01:00
buffer-dma.h iio: buffer-dma: Enable support for DMABUFs 2024-06-30 11:29:24 +01:00
buffer-dmaengine.h iio: buffer-dmaengine: Support specifying buffer direction 2024-04-20 15:41:14 +01:00
buffer.h iio: Add output buffer support 2021-10-19 08:30:44 +01:00
configfs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
consumer.h iio: consumers: ensure read buffers for labels and ext_info are page aligned 2024-12-11 19:20:49 +00:00
driver.h iio: adc: Constify struct iio_map 2024-09-30 09:21:02 +01:00
events.h iio: events: make IIO_EVENT_CODE macro private 2024-11-03 20:33:45 +00:00
hw-consumer.h iio: buffer: drop devm_iio_hw_consumer_free() API call 2020-04-19 16:56:37 +01:00
iio-gts-helper.h iio: fix doc for iio_gts_find_sel_by_int_time 2023-05-13 17:54:57 +01:00
iio-opaque.h iio: core: fix doc reference to iio_push_to_buffers_with_ts_unaligned 2024-12-07 17:52:44 +00:00
iio.h iio: Move __private marking before struct element priv in struct iio_dev 2024-11-09 10:42:13 +00:00
kfifo_buf.h iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
machine.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sw_device.h iio: Remove unused declarations 2023-09-12 10:42:03 +01:00
sw_trigger.h iio: Remove unused declarations 2023-09-12 10:42:03 +01:00
sysfs.h iio: Add IIO_STATIC_CONST_DEVICE_ATTR 2022-11-23 19:44:03 +00:00
trigger_consumer.h iio: Add __printf() attributes to various allocation functions 2020-09-21 18:54:18 +01:00
trigger.h iio: trigger: Add simple trigger_validation helper 2023-05-23 21:20:17 +01:00
triggered_buffer.h iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
triggered_event.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
types.h iio: core: introduce trough info element for minimum values 2023-12-11 19:37:10 +00:00