All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Claudiu.Beznea@microchip.com>
To: <mazziesaccount@gmail.com>, <matti.vaittinen@fi.rohmeurope.com>
Cc: <lars@metafoo.de>, <Michael.Hennerich@analog.com>,
	<cosmin.tanislav@analog.com>, <jic23@kernel.org>,
	<Eugen.Hristev@microchip.com>, <Nicolas.Ferre@microchip.com>,
	<alexandre.belloni@bootlin.com>, <bleung@chromium.org>,
	<groeck@chromium.org>, <alexandru.ardelean@analog.com>,
	<nathan@kernel.org>, <miquel.raynal@bootlin.com>,
	<linmq006@gmail.com>, <u.kleine-koenig@pengutronix.de>,
	<paul@crapouillou.net>, <mihail.chindris@analog.com>,
	<gwendal@chromium.org>, <andriy.shevchenko@linux.intel.com>,
	<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<chrome-platform@lists.linux.dev>
Subject: Re: [RFT PATCH v3 10/10] iio: Don't silently expect attribute types
Date: Thu, 6 Oct 2022 08:35:45 +0000	[thread overview]
Message-ID: <c163203c-d87b-7e71-f582-964a99e37efb@microchip.com> (raw)
In-Reply-To: <63f54787a684eb1232f1c5d275a09c786987fe4a.1664782676.git.mazziesaccount@gmail.com>

On 03.10.2022 11:13, Matti Vaittinen wrote:
> 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.
> 
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>

Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>

on SAMA5D2



WARNING: multiple messages have this Message-ID (diff)
From: <Claudiu.Beznea@microchip.com>
To: <mazziesaccount@gmail.com>, <matti.vaittinen@fi.rohmeurope.com>
Cc: alexandre.belloni@bootlin.com, linux-iio@vger.kernel.org,
	gwendal@chromium.org, linux-kernel@vger.kernel.org,
	paul@crapouillou.net, miquel.raynal@bootlin.com,
	groeck@chromium.org, chrome-platform@lists.linux.dev,
	lars@metafoo.de, linmq006@gmail.com,
	u.kleine-koenig@pengutronix.de, alexandru.ardelean@analog.com,
	mihail.chindris@analog.com, Michael.Hennerich@analog.com,
	cosmin.tanislav@analog.com, nathan@kernel.org,
	andriy.shevchenko@linux.intel.com, bleung@chromium.org,
	linux-arm-kernel@lists.infradead.org,
	Eugen.Hristev@microchip.com, jic23@kernel.org
Subject: Re: [RFT PATCH v3 10/10] iio: Don't silently expect attribute types
Date: Thu, 6 Oct 2022 08:35:45 +0000	[thread overview]
Message-ID: <c163203c-d87b-7e71-f582-964a99e37efb@microchip.com> (raw)
In-Reply-To: <63f54787a684eb1232f1c5d275a09c786987fe4a.1664782676.git.mazziesaccount@gmail.com>

On 03.10.2022 11:13, Matti Vaittinen wrote:
> 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.
> 
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>

Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>

on SAMA5D2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-10-06  8:35 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03  8:09 [PATCH v3 00/10] iio: Fix unsafe buffer attributes Matti Vaittinen
2022-10-03  8:09 ` Matti Vaittinen
2022-10-03  8:10 ` [PATCH v3 01/10] iio: adxl367: " Matti Vaittinen
2022-10-16 11:12   ` Jonathan Cameron
2022-10-03  8:10 ` [PATCH v3 02/10] iio: adxl372: " Matti Vaittinen
2022-10-16 11:12   ` Jonathan Cameron
2022-10-03  8:11 ` [PATCH v3 03/10] iio: bmc150-accel-core: " Matti Vaittinen
2022-10-16 11:13   ` Jonathan Cameron
2022-10-03  8:11 ` [PATCH v3 04/10] iio: at91-sama5d2_adc: " Matti Vaittinen
2022-10-03  8:11   ` Matti Vaittinen
2022-10-06  8:34   ` Claudiu.Beznea
2022-10-06  8:34     ` Claudiu.Beznea
2022-10-16 11:14     ` Jonathan Cameron
2022-10-16 11:14       ` Jonathan Cameron
2022-10-03  8:12 ` [PATCH v3 05/10] iio: Add IIO_STATIC_CONST_DEVICE_ATTR Matti Vaittinen
2022-10-03  8:12 ` [PATCH v3 06/10] iio: adxl367: Use IIO_STATIC_CONST_DEVICE_ATTR() Matti Vaittinen
2022-10-03  8:12 ` [PATCH v3 07/10] iio: adxl372: " Matti Vaittinen
2022-10-03  8:13 ` [PATCH v3 08/10] iio: bmc150-accel-core: " Matti Vaittinen
2022-10-03  8:13 ` [PATCH v3 09/10] iio: at91-sama5d2_adc: " Matti Vaittinen
2022-10-03  8:13   ` Matti Vaittinen
2022-10-06  8:35   ` Claudiu.Beznea
2022-10-06  8:35     ` Claudiu.Beznea
2022-10-03  8:13 ` [RFT PATCH v3 10/10] iio: Don't silently expect attribute types Matti Vaittinen
2022-10-03  8:13   ` Matti Vaittinen
2022-10-03  8:43   ` Andy Shevchenko
2022-10-03  8:43     ` Andy Shevchenko
2022-10-03  8:58     ` Matti Vaittinen
2022-10-03  8:58       ` Matti Vaittinen
2022-10-03  9:02       ` Matti Vaittinen
2022-10-03  9:02         ` Matti Vaittinen
2022-10-03  9:39         ` Andy Shevchenko
2022-10-03  9:39           ` Andy Shevchenko
2022-10-03  9:42       ` Andy Shevchenko
2022-10-03  9:42         ` Andy Shevchenko
2022-10-06  8:35   ` Claudiu.Beznea [this message]
2022-10-06  8:35     ` Claudiu.Beznea
2022-10-06 12:53     ` Matti Vaittinen
2022-10-06 12:53       ` Matti Vaittinen
2022-10-09 17:38       ` Jonathan Cameron
2022-10-09 17:38         ` Jonathan Cameron
2022-10-10  9:36         ` Matti Vaittinen
2022-10-10  9:36           ` Matti Vaittinen
2022-11-05 14:45           ` Jonathan Cameron
2022-11-05 14:45             ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c163203c-d87b-7e71-f582-964a99e37efb@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=Eugen.Hristev@microchip.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=cosmin.tanislav@analog.com \
    --cc=groeck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linmq006@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.com \
    --cc=mihail.chindris@analog.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=nathan@kernel.org \
    --cc=paul@crapouillou.net \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.