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: <20100209120334.f3657ee1.akpm@linux-foundation.org>
Date:	Tue, 9 Feb 2010 12:03:34 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Christoph Lameter <cl@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [PATCH 23/35] x86: make 32bit support NO_BOOTMEM

On Tue, 09 Feb 2010 11:32:34 -0800
Yinghai Lu <yinghai@...nel.org> wrote:

> --- a/arch/x86/kernel/early_res.c
> +++ b/arch/x86/kernel/early_res.c
> @@ -354,6 +354,9 @@ int __init get_free_all_memory_range(struct range **rangep, int nodeid)
>  
>  	/* need to go over early_node_map to find out good range for node */
>  	nr_range = add_from_early_node_map(range, count, nr_range, nodeid);
> +#ifdef CONFIG_X86_32
> +	subtract_range(range, count, max_low_pfn, -1UL);
> +#endif
>  	subtract_early_res(range, count);
>  	nr_range = clean_sort_range(range, count);

I'm too lazy to hunt through all the patches to see the surrounding code...

The "-1UL" is worrisome.  If that contant is to be assigned to a u64
then on x86_32 we end up with 0x00000000ffffffff, which is surely
wrong.

Generally I think it's safer and more maintainable (but odd-looking) to
use plain old "-1" when specifying the all-ones contant pattern. 
Because "-1" always works, whatever the size of the target scalar. 
This particularly matters when you're dealing with types which have
different sizes on different architectures, or whose type changes with
config options.


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