This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Avoid undefined behavior in __FD_MASK
- From: Florian Weimer <fweimer at redhat dot com>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 10 Feb 2014 14:57:05 +0100
- Subject: Re: [PATCH] Avoid undefined behavior in __FD_MASK
- Authentication-results: sourceware.org; auth=none
- References: <51651881 dot 2020906 at redhat dot com>
On 04/10/2013 09:45 AM, Florian Weimer wrote:
Shifting 1 into the sign position is supported by current GCC versions,
but the manual explicitly says this is subject to change. __fd_mask
should really be an unsigned type, but changing that is more risky. The
remaining bit operations should be safe.
I'd like to revive this patch:
<https://www.sourceware.org/ml/libc-alpha/2013-04/msg00295.html>
Changing the type of __fd_mask requires updates to the ABI testsuites.
__fd_mask was added to them for a reason, I suppose, so I think adding
the cast is the right way to address this.
--
Florian Weimer / Red Hat Product Security Team