[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdVnsoarYww+5hs+D6+8bWv0EO_9vs81ZrSTOo5g63deAg@mail.gmail.com>
Date: Mon, 21 Oct 2019 09:48:31 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Kangjie Lu <kjlu@....edu>
Cc: Ramesh Shanmugasundaram <rashanmu@...il.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Linux Media Mailing List <linux-media@...r.kernel.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] media: rcar_drif: fix a memory disclosure
Hi Kangjie,
On Sat, Oct 19, 2019 at 12:29 AM Kangjie Lu <kjlu@....edu> wrote:
> "f->fmt.sdr.reserved" is uninitialized. As other peer drivers
> like msi2500 and airspy do, the fix initializes it to avoid
> memory disclosures.
>
> Signed-off-by: Kangjie Lu <kjlu@....edu>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
> --- a/drivers/media/platform/rcar_drif.c
> +++ b/drivers/media/platform/rcar_drif.c
> @@ -912,6 +912,7 @@ static int rcar_drif_g_fmt_sdr_cap(struct file *file, void *priv,
> {
> struct rcar_drif_sdr *sdr = video_drvdata(file);
>
> + memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
> f->fmt.sdr.pixelformat = sdr->fmt->pixelformat;
> f->fmt.sdr.buffersize = sdr->fmt->buffersize;
I would do the memset() at the end, though, to follow declaration order of the
struct members.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists