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:   Tue, 19 Mar 2019 05:36:36 +0000
From:   Jisheng Zhang <Jisheng.Zhang@...aptics.com>
To:     Aditya Pakki <pakki001@....edu>
CC:     Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        "kjlu@....edu" <kjlu@....edu>, Will Deacon <will.deacon@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] PCI: Fix to avoid potential NULL pointer dereference

On Mon, 18 Mar 2019 19:26:30 -0500 Aditya Pakki wrote:

> 
> In gen_pci_probe, of_match_node can return a NULL pointer in case of

This could not happen. If the probe is called, it means OF registered a
device with a valid compatible string, so of_match_node cannot be NULL.

> failure. The patch avoids a NULL pointer dereference in such a scenario.
> 
> Signed-off-by: Aditya Pakki <pakki001@....edu>
> ---
>  drivers/pci/controller/pci-host-generic.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/controller/pci-host-generic.c b/drivers/pci/controller/pci-host-generic.c
> index dea3ec7592a2..85f473f50e96 100644
> --- a/drivers/pci/controller/pci-host-generic.c
> +++ b/drivers/pci/controller/pci-host-generic.c
> @@ -83,6 +83,8 @@ static int gen_pci_probe(struct platform_device *pdev)
>         struct pci_ecam_ops *ops;
> 
>         of_id = of_match_node(gen_pci_of_match, pdev->dev.of_node);
> +       if (!of_id)
> +               return -ENXIO;
>         ops = (struct pci_ecam_ops *)of_id->data;
> 
>         return pci_host_common_probe(pdev, ops);
> --
> 2.17.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.infradead.org_mailman_listinfo_linux-2Darm-2Dkernel&d=DwICAg&c=7dfBJ8cXbWjhc0BhImu8wQ&r=wlaKTGoVCDxOzHc2QUzpzGEf9oY3eidXlAe3OF1omvo&m=Aaw3ijENR3L1GJbf1JjDlPa-S8-6UwqqXN40ECdoisk&s=ByG7jEMATcZVHKP-JW7j4efNcV-iAfJDFTEzC8Ba7oc&e=

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ