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: <alpine.LSU.2.20.1506151254340.27315@wotan.suse.de>
Date:	Mon, 15 Jun 2015 13:30:11 +0200 (CEST)
From:	Michael Matz <matz@...e.de>
To:	Borislav Petkov <bp@...en8.de>
cc:	Enrico Mioso <mrkiko.rs@...il.com>, linux-kernel@...r.kernel.org,
	x86-ml <x86@...nel.org>
Subject: Re: X86 GIT GCC 5 compilation warning

Hi,

On Sun, 14 Jun 2015, Borislav Petkov wrote:

> > arch/x86/kernel/head_32.S:66: Warning: shift count out of range (32 is not between 0 and 31)
> 
> That's
> 
> LOWMEM_PAGES = (((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT)
> 
> and a 32-bit build. So gas hasn't been complaning so far about this.

This warning is in gas since 2009 (commit d85733c8).  In this case it only 
happens when the internal type to represent values is 32 bit, which 
happens only when binutils is compiled for only non-64bit architectures, 
_on_ a non-64bit architecture (e.g. when it's compiled on i386 for i386).

This has nothing to do with GCC, but must be a change in his binutils.

> Judging by the warning, it seems gas considers the "1" a 4-byte type now 
> and complains about the shift overflow.

gas internally converts all values to a common type valueT (or offsetT), 
which is either a 64bit type if necessary for the target, or simply 
(unsigned) long.  So if compiled on a 32bit arch, for only 32bit targets 
it will be a 32bit type, and the warning will trigger.

E.g. on a gas compiled with gcc -m32 and for i386-unknown-linux-gnu:
% gas/as-new bla.s
bla.s: Assembler messages:
bla.s:3: Warning: shift count out of range (32 is not between 0 and 31)

(This doesn't happen when the gas is compiled on e.g. x86-64-linux or for 
a 64bit target, or with --enable-64-bit-bfd)


Ciao,
Michael.
--
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