lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <s5hmwbi6h59.wl%tiwai@suse.de>
Date:	Tue, 05 Aug 2014 18:22:10 +0200
From:	Takashi Iwai <tiwai@...e.de>
To:	jean-michel.hautbois@...alys.com
Cc:	linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
	arnd@...db.de, jhautbois@...il.com
Subject: Re: [PATCH] Lattice ECP3 FPGA: Check firmware pointer

At Tue,  5 Aug 2014 18:19:37 +0200,
jean-michel.hautbois@...alys.com wrote:
> 
> From: Jean-Michel Hautbois <jean-michel.hautbois@...alys.com>
> 
> This patch corrects a lack of testing.
> If fw is NULL when calling firmware_load(), it results in a kernel oops.
> 
> Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@...alys.com>

Reviewed-by: Takashi Iwai <tiwai@...e.de>


Takashi

> ---
>  drivers/misc/lattice-ecp3-config.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/misc/lattice-ecp3-config.c b/drivers/misc/lattice-ecp3-config.c
> index 7ffdb58..7e1efd5 100644
> --- a/drivers/misc/lattice-ecp3-config.c
> +++ b/drivers/misc/lattice-ecp3-config.c
> @@ -79,6 +79,11 @@ static void firmware_load(const struct firmware *fw, void *context)
> 	u32 jedec_id;
> 	u32 status;
> 
> +	if (fw == NULL) {
> +		dev_err(&spi->dev, "Cannot load firmware, aborting\n");
> +		return;
> +	}
> +
> 	if (fw->size == 0) {
> 		dev_err(&spi->dev, "Error: Firmware size is 0!\n");
> 		return;
> --
> 2.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ