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 19:08:10 +0000
From:   Russell King - ARM Linux <linux@...linux.org.uk>
To:     Shailendra Verma <shailendra.v@...sung.com>
Cc:     linux-arm-kernel@...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] Arch: arm: plat-pxa - Fix possible NULL derefrence.

On Mon, Jan 30, 2017 at 10:28:31AM +0530, Shailendra Verma wrote:
> of_match_device could return NULL, and so can cause a NULL
> pointer dereference later.

Please explain how this can happen.

The driver is matched to the device via the driver model looking up
the compatible string in the match table:

                .of_match_table = of_match_ptr(pxa_ssp_of_ids),

It then calls the probe function, which notices that there's a DT
node pointer, and the driver looks the device up in the very same
table.

If the driver model found a match and then the device driver didn't
for the very same device, something really bad went wrong.

So, if you want to add something:

	if (WARN_ON(!id))
		return -ENODEV;

should be about it, since it's something we expect to never encounter.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ