<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/drivers/iio/common, branch rust-6.8</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://git.kobert.dev/pm24.git/atom?h=rust-6.8</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom?h=rust-6.8'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2023-10-05T17:06:45Z</updated>
<entry>
<title>iio: cros_ec: fix an use-after-free in cros_ec_sensors_push_data()</title>
<updated>2023-10-05T17:06:45Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-08-29T03:06:22Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=7771c8c80d62ad065637ef74ed2962983f6c5f6d'/>
<id>urn:sha1:7771c8c80d62ad065637ef74ed2962983f6c5f6d</id>
<content type='text'>
cros_ec_sensors_push_data() reads `indio_dev-&gt;active_scan_mask` and
calls iio_push_to_buffers_with_timestamp() without making sure the
`indio_dev` stays in buffer mode.  There is a race if `indio_dev` exits
buffer mode right before cros_ec_sensors_push_data() accesses them.

An use-after-free on `indio_dev-&gt;active_scan_mask` was observed.  The
call trace:
[...]
 _find_next_bit
 cros_ec_sensors_push_data
 cros_ec_sensorhub_event
 blocking_notifier_call_chain
 cros_ec_irq_thread

It was caused by a race condition: one thread just freed
`active_scan_mask` at [1]; while another thread tried to access the
memory at [2].

Fix it by calling iio_device_claim_buffer_mode() to ensure the
`indio_dev` can't exit buffer mode during cros_ec_sensors_push_data().

[1]: https://elixir.bootlin.com/linux/v6.5/source/drivers/iio/industrialio-buffer.c#L1189
[2]: https://elixir.bootlin.com/linux/v6.5/source/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c#L198

Cc: stable@vger.kernel.org
Fixes: aa984f1ba4a4 ("iio: cros_ec: Register to cros_ec_sensorhub when EC supports FIFO")
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Link: https://lore.kernel.org/r/20230829030622.1571852-1-tzungbi@kernel.org
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>Merge 6.5-rc6 into char-misc-next</title>
<updated>2023-08-13T20:14:51Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2023-08-13T20:14:51Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=e75850b4573a092078d5ff1493d3d9ee16b98821'/>
<id>urn:sha1:e75850b4573a092078d5ff1493d3d9ee16b98821</id>
<content type='text'>
We need the char/misc fixes in here as well to build on top of.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: cros_ec: Fix the allocation size for cros_ec_command</title>
<updated>2023-07-29T11:21:21Z</updated>
<author>
<name>Yiyuan Guo</name>
<email>yguoaz@gmail.com</email>
</author>
<published>2023-06-30T14:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=8a4629055ef55177b5b63dab1ecce676bd8cccdd'/>
<id>urn:sha1:8a4629055ef55177b5b63dab1ecce676bd8cccdd</id>
<content type='text'>
The struct cros_ec_command contains several integer fields and a
trailing array. An allocation size neglecting the integer fields can
lead to buffer overrun.

Reviewed-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Signed-off-by: Yiyuan Guo &lt;yguoaz@gmail.com&gt;
Fixes: 974e6f02e27e ("iio: cros_ec_sensors_core: Add common functions for the ChromeOS EC Sensor Hub.")
Link: https://lore.kernel.org/r/20230630143719.1513906-1-yguoaz@gmail.com
Cc: &lt;Stable@vger.kerenl.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: make invensense timestamp module generic</title>
<updated>2023-07-20T18:21:28Z</updated>
<author>
<name>Jean-Baptiste Maneyrol</name>
<email>jean-baptiste.maneyrol@tdk.com</email>
</author>
<published>2023-06-06T16:21:46Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=0ecc363ccea71eda6a2cceade120489259bcdb33'/>
<id>urn:sha1:0ecc363ccea71eda6a2cceade120489259bcdb33</id>
<content type='text'>
Rename common module to inv_sensors_timestamp, add configuration
at init (chip internal clock, acceptable jitter, ...) and update
inv_icm42600 driver integration.

Signed-off-by: Jean-Baptiste Maneyrol &lt;jean-baptiste.maneyrol@tdk.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20230606162147.79667-4-inv.git-commit@tdk.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: move inv_icm42600 timestamp module in common</title>
<updated>2023-07-20T18:21:28Z</updated>
<author>
<name>Jean-Baptiste Maneyrol</name>
<email>jean-baptiste.maneyrol@tdk.com</email>
</author>
<published>2023-06-06T16:21:45Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=d99ff463ecf651437e9e4abe68f331dfb6b5bd9d'/>
<id>urn:sha1:d99ff463ecf651437e9e4abe68f331dfb6b5bd9d</id>
<content type='text'>
Create new inv_sensors common modules and move inv_icm42600
timestamp module inside. This module will be used by IMUs and
also in the future by other chips.

Modify inv_icm42600 driver to use timestamp module and do some
headers cleanup.

Signed-off-by: Jean-Baptiste Maneyrol &lt;jean-baptiste.maneyrol@tdk.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20230606162147.79667-3-inv.git-commit@tdk.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: Rename iio_trigger_poll_chained and add kernel-doc</title>
<updated>2023-03-11T12:18:29Z</updated>
<author>
<name>Mehdi Djait</name>
<email>mehdi.djait.k@gmail.com</email>
</author>
<published>2023-03-02T13:04:36Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=f700e55ef6ef9ec723164659ed4385900981c872'/>
<id>urn:sha1:f700e55ef6ef9ec723164659ed4385900981c872</id>
<content type='text'>
Rename the function to iio_trigger_poll_nested. Add kernel-doc with
a note on the context where the function is expected to be called.

Signed-off-by: Mehdi Djait &lt;mehdi.djait.k@gmail.com&gt;
Link: https://lore.kernel.org/r/841b533cba28ca25a8e87280c44e45979166e8e2.1677761379.git.mehdi.djait.k@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: common: scmi_iio: use sysfs_emit() to instead of scnprintf()</title>
<updated>2022-12-28T17:19:45Z</updated>
<author>
<name>ye xingchen</name>
<email>ye.xingchen@zte.com.cn</email>
</author>
<published>2022-12-01T03:56:31Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=f9e51aacc740935bd0201565e040fd7b36f645aa'/>
<id>urn:sha1:f9e51aacc740935bd0201565e040fd7b36f645aa</id>
<content type='text'>
Replace the open-code with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen &lt;ye.xingchen@zte.com.cn&gt;
Link: https://lore.kernel.org/r/202212011156314630626@zte.com.cn
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: Don't silently expect attribute types</title>
<updated>2022-11-23T19:44:04Z</updated>
<author>
<name>Matti Vaittinen</name>
<email>mazziesaccount@gmail.com</email>
</author>
<published>2022-10-03T08:13:53Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=0a33755c4b01ed62a6d025cb585928304f9653d7'/>
<id>urn:sha1:0a33755c4b01ed62a6d025cb585928304f9653d7</id>
<content type='text'>
The iio_triggered_buffer_setup_ext() and the
devm_iio_kfifo_buffer_setup_ext() were changed by
commit 15097c7a1adc ("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().

When using IIO_CONST_ATTRs 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 function signatures to expect an array of iio_dev_attrs to
avoid similar errors in the future.

Merge conflict resolved whilst applying due to patch crossing with
two new drivers (kx022a accelerometer and ad4130 ADC).

Signed-off-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Tested-by: Claudiu Beznea &lt;claudiu.beznea@microchip.com&gt;
Link: https://lore.kernel.org/r/63f54787a684eb1232f1c5d275a09c786987fe4a.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: st_sensors: core and lsm9ds0 switch to devm_regulator_bulk_get_enable()</title>
<updated>2022-11-23T19:44:01Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2022-10-16T16:34:02Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=9e855d77b1ec57704d23e25761a97e6e64abed66'/>
<id>urn:sha1:9e855d77b1ec57704d23e25761a97e6e64abed66</id>
<content type='text'>
These drivers only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The two regulators were handled
separately so also switch to bulk registration.
The new devm_regulator_bulk_get_enable() replaces all this boilerplate
code.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Reviewed-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Link: https://lore.kernel.org/r/20221016163409.320197-8-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: common: scmi_iio: do not use internal iio_dev lock</title>
<updated>2022-11-23T19:43:58Z</updated>
<author>
<name>Nuno Sá</name>
<email>nuno.sa@analog.com</email>
</author>
<published>2022-10-04T13:49:04Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=d711a5a7eff4855deb0e2c2663e679dc205e2d9f'/>
<id>urn:sha1:d711a5a7eff4855deb0e2c2663e679dc205e2d9f</id>
<content type='text'>
The iio_device lock is only meant for internal use. Hence define a
device local lock to protect against concurrent accesses.

While at it, properly include "mutex.h" for mutex related APIs.

Signed-off-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Link: https://lore.kernel.org/r/20221004134909.1692021-12-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
