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/2163] New: ioctl() crashes if error value is returned


The following code causes SIGSEGV if the ioctl returns an error value:

void test()
{
       int fd = open("/dev/ttyXR3", O_RDWR);
       char dummy[512];
       if (ioctl(fd, TCSETSW, dummy) < 0) {
               printf("hello\n");
       }
}

The problem is that the pointer to the global offset table (gp) is modified and
not correctly restored in the glibc implementation for MIPS64.

-- 
           Summary: ioctl() crashes if error value is returned
           Product: glibc
           Version: 2.3.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: christoph dot stueckjuergen at siemens dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: mips64-linux-gnu


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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