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: <1461784.GDeppdBeAX@vostro.rjw.lan>
Date:	Thu, 06 Aug 2015 01:20:56 +0200
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:	"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] device property: fix potential NULL pointer dereference

On Wednesday, August 05, 2015 04:51:11 PM Andy Shevchenko wrote:
> In device_add_property_set() we check pset parameter for a NULL, but few lines
> later we do a pointer arithmetic without check that will crash kernel in the
> set_secondary_fwnode().
> 
> Here we check if pset parameter is NULL and return immediately.
> 
> Fixes: 16ba08d5c9ec (device property: Introduce firmware node type for platform data)
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

I don't think there are any users of this in 4.2, so I'll queue it up for 4.3.

Thanks!


> ---
>  drivers/base/property.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index f3f6d16..37a7bb7 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -27,9 +27,10 @@
>   */
>  void device_add_property_set(struct device *dev, struct property_set *pset)
>  {
> -	if (pset)
> -		pset->fwnode.type = FWNODE_PDATA;
> +	if (!pset)
> +		return;
>  
> +	pset->fwnode.type = FWNODE_PDATA;
>  	set_secondary_fwnode(dev, &pset->fwnode);
>  }
>  EXPORT_SYMBOL_GPL(device_add_property_set);
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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