This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/15448] New: Integer overflow in sched.h cpu set CPU_* macros


http://sourceware.org/bugzilla/show_bug.cgi?id=15448

             Bug #: 15448
           Summary: Integer overflow in sched.h cpu set CPU_* macros
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: unassigned@sourceware.org
        ReportedBy: bugdal@aerifal.cx
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


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.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]