Linux IIO development
 help / color / mirror / Atom feed
From: Sanjay Chitroda <sanjayembeddedse@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>,
	linux-iio@vger.kernel.org, Jinseob Kim <kimjinseob88@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Reported-by: Sashiko" <sashiko-bot@kernel.org>
Subject: Re: [PATCH] iio: buffer: Ensure bounce buffer used for unaligned case is zeroed.
Date: Sun, 31 May 2026 23:58:25 +0530	[thread overview]
Message-ID: <2417EDFF-1ADA-42CC-8D52-C93E90EC4953@gmail.com> (raw)
In-Reply-To: <20260531111605.2411980-1-jic23@kernel.org>



On 31 May 2026 4:46:05 pm IST, Jonathan Cameron <jic23@kernel.org> wrote:
>iio_push_to_buffers_with_ts_unaligned() leaks uninitialized heap memory
>to userspace if the data passed in is not a multiple of 8 bytes and the
>timestamp is enabled.  Use memset() to zero it after resizing.
>
>Fixes: 95ec3fdf2b79 ("iio: core: Introduce iio_push_to_buffers_with_ts_unaligned()")
>Reported-by: Reported-by: Sashiko <sashiko-bot@kernel.org>

Hi Jonathan,

Looks like "Reported-by:" is duplicated.

Thanks, Sanjay

>Closes: https://sashiko.dev/#/patchset/20260529121005.1470-1-kimjinseob88%40gmail.com
>Signed-off-by: Jonathan Cameron <jic23@kernel.org>
>---
>Cc: Jinseob Kim <kimjinseob88@gmail.com>
>
>This is untested as I don't have any devices that use this and long
>ago dropped whatever hacks I used to test it originally.
>
>Jinseob, could you please test this with your OSF driver - at least
>make sure it doesn't stop the data coming out!
>---
> drivers/iio/industrialio-buffer.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
>index 9d66510a1d49..d930e70e12ff 100644
>--- a/drivers/iio/industrialio-buffer.c
>+++ b/drivers/iio/industrialio-buffer.c
>@@ -2466,6 +2466,7 @@ int iio_push_to_buffers_with_ts_unaligned(struct iio_dev *indio_dev,
> 				   indio_dev->scan_bytes, GFP_KERNEL);
> 		if (!bb)
> 			return -ENOMEM;
>+		memset(iio_dev_opaque->bounce_buffer, 0, indio_dev->scan_bytes);
> 		iio_dev_opaque->bounce_buffer = bb;
> 		iio_dev_opaque->bounce_buffer_size = indio_dev->scan_bytes;
> 	}

  reply	other threads:[~2026-05-31 18:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31 11:16 [PATCH] iio: buffer: Ensure bounce buffer used for unaligned case is zeroed Jonathan Cameron
2026-05-31 18:28 ` Sanjay Chitroda [this message]
2026-06-03 13:55   ` Jonathan Cameron
2026-06-03 14:11     ` Joshua Crofts
2026-06-04  8:37       ` Jonathan Cameron
2026-06-04  8:43         ` Joshua Crofts
2026-06-08  0:00           ` Kim Jinseob

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=2417EDFF-1ADA-42CC-8D52-C93E90EC4953@gmail.com \
    --to=sanjayembeddedse@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=kimjinseob88@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=sashiko-bot@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox