In file sysdeps/unix/sysv/linux/bits/sched.h, the cpu set macros attempt to check for overflow of the cpu index, but fail to do so properly due to an integer overflow error. The condition:
147 __cpu < 8 * (setsize)
overflows if setsize is greater than SIZE_MAX/8. The correct test would be:
__cpu/8 < (setsize)
which is valid since the low 3 bits of __cpu are irrelevant to whether the index overflows.
This is fixed now for glibc 2.18, thanks for your report.
Author: Andreas Jaeger <firstname.lastname@example.org>
Date: Fri May 10 20:28:40 2013 +0200
Fix integer overflow in sysdeps/unix/sysv/linux/bits/sched.h
* sysdeps/unix/sysv/linux/bits/sched.h (__CPU_SET_S)
(__CPU_CLR_S, __CPU_ISSET_S): Avoid integer overflow.