[PATCH] elf.h SHF_EXCLUDE signed int 31 bit shift triggers undefined behaviour.

Carlos O'Donell carlos@redhat.com
Thu May 14 00:43:00 GMT 2015


On 05/13/2015 06:56 AM, Ondřej Bílka wrote:
> On Wed, May 13, 2015 at 12:46:26PM +0200, Mark Wielaard wrote:
>> On Wed, 2015-05-13 at 12:27 +0200, Ondřej Bílka wrote:
>>> On Tue, Mar 24, 2015 at 11:39:39AM +0100, Mark Wielaard wrote:
>>>> Any use of SHF_EXCLUDE in code that tries to check it against sh_flags
>>>> will trigger undefined behaviour because it is defined as a 31 bit shift
>>>> against an signed integer. Fix by explicitly using an unsigned int.
>>>> ---
>>>>  ChangeLog | 4 ++++
>>>>  elf/elf.h | 2 +-
>>>>  2 files changed, 5 insertions(+), 1 deletion(-)
>>>>
>>> I looked that Florian acked this at patchwork thread. Florian, could you also
>>> commit it or do we need more discussion?
>>
>> It is already in as commit fb4041, see:
>> https://sourceware.org/ml/libc-alpha/2015-04/msg00359.html
> 
> thanks. marked that also at patchwork.
> 

Ondrej,

Thanks for the patchwork cleanup!

c.



More information about the Libc-alpha mailing list