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]
Date:   Mon, 30 Jan 2017 08:56:17 +0100
From:   Boris Brezillon <boris.brezillon@...e-electrons.com>
To:     Shailendra Verma <shailendra.v@...sung.com>
Cc:     Richard Weinberger <richard@....at>,
        David Woodhouse <dwmw2@...radead.org>,
        Brian Norris <computersforpeace@...il.com>,
        Marek Vasut <marek.vasut@...il.com>,
        Cyrille Pitchen <cyrille.pitchen@...el.com>,
        Stefan Agner <stefan@...er.ch>, linux-mtd@...ts.infradead.org,
        linux-kernel@...r.kernel.org, p.shailesh@...sung.com,
        ashish.kalra@...sung.com,
        Shailendra Verma <shailendra.capricorn@...il.com>
Subject: Re: [PATCH] Mtd: nand - Fix possible NULL derefrence.

Hi Shailendra,

Marek and I already reviewed this patch, and you're resending it
without any of the comments addressed. Is this a mistake?

On Mon, 30 Jan 2017 10:29:17 +0530
Shailendra Verma <shailendra.v@...sung.com> wrote:

> of_match_device could return NULL, and so can cause a NULL
> pointer dereference later.
> 
> Signed-off-by: Shailendra Verma <shailendra.v@...sung.com>
> ---
>  drivers/mtd/nand/mxc_nand.c  |    4 ++++
>  drivers/mtd/nand/vf610_nfc.c |    4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> index d7f724b..ca1b8ad 100644
> --- a/drivers/mtd/nand/mxc_nand.c
> +++ b/drivers/mtd/nand/mxc_nand.c
> @@ -1596,6 +1596,10 @@ static int __init mxcnd_probe_dt(struct mxc_nand_host *host)
>  	if (!np)
>  		return 1;
>  
> +	if (!of_id) {
> +		dev_err(host->dev, "Error: No device match found\n");
> +		return -ENODEV;
> +	}
>  	host->devtype_data = of_id->data;
>  
>  	return 0;
> diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
> index 3ad514c..0e09c11 100644
> --- a/drivers/mtd/nand/vf610_nfc.c
> +++ b/drivers/mtd/nand/vf610_nfc.c
> @@ -674,6 +674,10 @@ static int vf610_nfc_probe(struct platform_device *pdev)
>  	}
>  
>  	of_id = of_match_device(vf610_nfc_dt_ids, &pdev->dev);
> +	if (!of_id) {
> +		dev_err(&pdev->dev, "Error: No device match found\n");
> +		return -ENODEV;
> +	}
>  	nfc->variant = (enum vf610_nfc_variant)of_id->data;
>  
>  	for_each_available_child_of_node(nfc->dev->of_node, child) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ