[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241130205948.389689b1@jic23-huawei>
Date: Sat, 30 Nov 2024 20:59:57 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Javier Carrasco <javier.carrasco.cruz@...il.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>, Antoni Pokusinski
<apokusinski01@...il.com>, Francesco Dolcini <francesco@...cini.it>,
João Paulo Gonçalves
<jpaulo.silvagoncalves@...il.com>, Gregor Boirie
<gregor.boirie@...rot.com>, Jonathan Cameron <Jonathan.Cameron@...wei.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org, João Paulo Gonçalves
<joao.goncalves@...adex.com>, Francesco Dolcini
<francesco.dolcini@...adex.com>, stable@...r.kernel.org
Subject: Re: [PATCH 03/11] iio: pressure: zpa2326: fix information leak in
triggered buffer
On Mon, 25 Nov 2024 22:16:11 +0100
Javier Carrasco <javier.carrasco.cruz@...il.com> wrote:
> The 'sample' local struct is used to push data to user space from a
> triggered buffer, but it has a hole between the temperature and the
> timestamp (u32 pressure, u16 temperature, GAP, u64 timestamp).
> This hole is never initialized.
>
> Initialize the struct to zero before using it to avoid pushing
> uninitialized information to userspace.
>
> Cc: stable@...r.kernel.org
> Fixes: 03b262f2bbf4 ("iio:pressure: initial zpa2326 barometer support")
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@...il.com>
Applied.
> ---
> drivers/iio/pressure/zpa2326.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c
> index 950f8dee2b26..b4c6c7c47256 100644
> --- a/drivers/iio/pressure/zpa2326.c
> +++ b/drivers/iio/pressure/zpa2326.c
> @@ -586,6 +586,8 @@ static int zpa2326_fill_sample_buffer(struct iio_dev *indio_dev,
> } sample;
> int err;
>
> + memset(&sample, 0, sizeof(sample));
> +
> if (test_bit(0, indio_dev->active_scan_mask)) {
> /* Get current pressure from hardware FIFO. */
> err = zpa2326_dequeue_pressure(indio_dev, &sample.pressure);
>
Powered by blists - more mailing lists