Comment 4 for bug 284631

Revision history for this message
Roman Yepishev (rye) wrote : Re: UML kernel built in Intrepid SEGFAULTs immediately

Fixed.

It is even not a glibc problem, it is UML one.

For the history: The actual crash happens inside os_create_unix_socket. Length is char[256] while in sockaddr_un sun_path which receives the file argument it is only 108 bytes long. __snprintf_chk catches this condition as we have a potential buffer overflow.

The short term fix is to tweak arch/um/drivers/mconsole_kern.c as follows:

...
 static int __init mconsole_init(void)
 {
      /* long to avoid size mismatch warnings from gcc */
      long sock;
      int err;
- char file[256];
+ char file[106];

      if (umid_file_name("mconsole", file, sizeof(file)))
          return -1;
...

This should be patched in kernel. Any build of UML in Intrepid or any other distro which uses _FORTIFY_SOURCE by default will fail with the cryptic messages as above.