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]
Message-ID: <53E91894.3060501@gmx.de>
Date:	Mon, 11 Aug 2014 21:25:08 +0200
From:	Toralf Förster <toralf.foerster@....de>
To:	Vivek Goyal <vgoyal@...hat.com>,
	Richard Weinberger <richard@....at>
CC:	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	user-mode-linux-devel <user-mode-linux-devel@...ts.sourceforge.net>,
	sahne@...0.at
Subject: Re: [uml-devel] "resource: provide new functions to walk through
 resources" breaks UML

On 08/11/2014 08:44 PM, Vivek Goyal wrote:
> 
> Hi Richard,
> 
> Can you please give the attached patch a try and see if it fixes the UML
> issue.
> 
> I noticed that previous code had a for() loop which will not execute
> if p was null. I have resorted back to same code now. 
> 
> Thanks
> Vivek
> 
> 
> ---
>  kernel/resource.c |   11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> Index: linux-2.6/kernel/resource.c
> ===================================================================
> --- linux-2.6.orig/kernel/resource.c	2014-08-11 13:36:19.942423192 -0400
> +++ linux-2.6/kernel/resource.c	2014-08-11 13:50:20.529387653 -0400
> @@ -351,15 +351,12 @@ static int find_next_iomem_res(struct re
>  	end = res->end;
>  	BUG_ON(start >= end);
>  
> -	read_lock(&resource_lock);
> -
> -	if (first_level_children_only) {
> -		p = iomem_resource.child;
> +	if (first_level_children_only)
>  		sibling_only = true;
> -	} else
> -		p = &iomem_resource;
>  
> -	while ((p = next_resource(p, sibling_only))) {
> +	read_lock(&resource_lock);
> +
> +	for (p = iomem_resource.child; p; p = next_resource(p, sibling_only)) {
>  		if (p->flags != res->flags)
>  			continue;
>  		if (name && strcmp(p->name, name))
> 
At least at my system (32 bit x86) the patch seems to work (applied on top of v3.16-10473-gc8d6637)

-- 
Toralf

--
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