[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250724115610.011110fb@jic23-huawei>
Date: Thu, 24 Jul 2025 11:56:10 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: David Lechner <dlechner@...libre.com>
Cc: Martin Tuma <martin.tuma@...iteqautomotive.com>, Mauro Carvalho Chehab
<mchehab@...nel.org>, Hans Verkuil <hverkuil@...all.nl>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org, Nuno
Sá <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
linux-iio@...r.kernel.org
Subject: Re: [PATCH] media: pci: mg4b: fix uninitialized iio scan data
On Tue, 22 Jul 2025 17:05:46 -0500
David Lechner <dlechner@...libre.com> wrote:
> Fix potential leak of uninitialized stack data to userspace by ensuring
> that the `scan` structure is zeroed before use.
>
> Fixes: 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver")
> Signed-off-by: David Lechner <dlechner@...libre.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>
> ---
> drivers/media/pci/mgb4/mgb4_trigger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/pci/mgb4/mgb4_trigger.c b/drivers/media/pci/mgb4/mgb4_trigger.c
> index 923650d53d4c82e87b542f87c3a0fbf6170dadc8..d7dddc5c8728e81c6249b03a4cbf692da15a4ced 100644
> --- a/drivers/media/pci/mgb4/mgb4_trigger.c
> +++ b/drivers/media/pci/mgb4/mgb4_trigger.c
> @@ -91,7 +91,7 @@ static irqreturn_t trigger_handler(int irq, void *p)
> struct {
> u32 data;
> s64 ts __aligned(8);
If you don't mind doing a follow up can change that to aligned_s64
and switch to iio_push_to_buffers_with_ts()
If not the second one at least will get swept up with other conversions
shortly and the aligned_s64 is just a nice to have.
> - } scan;
> + } scan = { };
>
> scan.data = mgb4_read_reg(&st->mgbdev->video, 0xA0);
> mgb4_write_reg(&st->mgbdev->video, 0xA0, scan.data);
>
> ---
> base-commit: cd2731444ee4e35db76f4fb587f12d327eec5446
> change-id: 20250722-media-pci-mg4b-fix-uninitialized-iio-scan-data-2dce1574d1e9
>
> Best regards,
Powered by blists - more mailing lists