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] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 22 Sep 2014 10:58:12 -0400
From:	Vivek Goyal <vgoyal@...hat.com>
To:	Guenter Roeck <linux@...ck-us.net>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Mikael Starvik <starvik@...s.com>,
	Jesper Nilsson <jesper.nilsson@...s.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] resource: Add NULL check in next_resource

On Sun, Sep 21, 2014 at 08:51:44AM -0700, Guenter Roeck wrote:
> Commit 8c86e70acead ("resource: provide new functions to walk through
> resources") adds a suble new requirement that iomem_resource.child must
> not be NULL when walk_system_ram_range is called. This can cause a crash
> if it turns out that there are no children. The crash ('Unable to handle
> kernel NULL pointer dereference') is seen when trying to test a crisv32
> image on kernels with this commit applied.
> 
> Fix by adding a NULL check into next_resource().
> 
> Fixes: 8c86e70acead ("resource: provide new functions to walk through resources")

One such problem was solved with following commit.

commit 800df627e2eabaf4a921d342a1d5162c843b7fc2
Author: Vivek Goyal <vgoyal@...hat.com>
Date:   Fri Aug 29 15:18:29 2014 -0700

    resource: fix the case of null pointer access

Do you have this patch applied in your tree?

Thanks
Vivek

> Cc: Vivek Goyal <vgoyal@...hat.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
> ---
> The NULL check could be added elsewhere instead. I am open to suggestions.
> 
>  kernel/resource.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/kernel/resource.c b/kernel/resource.c
> index 60c5a38..00c57ad 100644
> --- a/kernel/resource.c
> +++ b/kernel/resource.c
> @@ -61,6 +61,9 @@ static DEFINE_SPINLOCK(bootmem_resource_lock);
>  
>  static struct resource *next_resource(struct resource *p, bool sibling_only)
>  {
> +	if (p == NULL)
> +		return NULL;
> +
>  	/* Caller wants to traverse through siblings only */
>  	if (sibling_only)
>  		return p->sibling;
> -- 
> 1.9.1
--
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