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  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:   Tue, 25 Sep 2018 16:58:46 +0800
From:   Baoquan He <bhe@...hat.com>
To:     Bjorn Helgaas <helgaas@...nel.org>
Cc:     Lianbo Jiang <lijiang@...hat.com>, Vivek Goyal <vgoyal@...hat.com>,
        linux-kernel@...r.kernel.org, kexec@...ts.infradead.org,
        tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
        x86@...nel.org, akpm@...ux-foundation.org,
        dan.j.williams@...el.com, thomas.lendacky@....com,
        baiyaowei@...s.chinamobile.com, tiwai@...e.de, bp@...e.de,
        brijesh.singh@....com, dyoung@...hat.com
Subject: Re: [PATCH 3/3] resource: Fix find_next_iomem_res() iteration issue

Hi Bjorn,

On 09/24/18 at 05:15pm, Bjorn Helgaas wrote:
> @@ -359,32 +362,31 @@ static int find_next_iomem_res(struct resource *res, unsigned long desc,
>  	read_unlock(&resource_lock);
>  	if (!p)
>  		return -1;
> +
>  	/* copy data */
> -	if (res->start < p->start)
> -		res->start = p->start;
> -	if (res->end > p->end)
> -		res->end = p->end;
> +	res->start = max(start, p->start);
> +	res->end = min(end, p->end);
>  	res->flags = p->flags;

I think this fix is good. However, is it OK to keep res->flags always,
never touch it in find_next_iomem_res()? We just iterate and update
region, its start and end. So just removing that "res->flags = p->flags;"
line might involve much less code changes.

Thanks
Baoquan

Powered by blists - more mailing lists