From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF0EO-0001sG-LE for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:31:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF0EC-0003c7-45 for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:31:15 -0400 Received: from indium.canonical.com ([91.189.90.7]:37914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF0EB-0003bx-U0 for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:31:04 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1bF0EB-0001Zf-1p for ; Mon, 20 Jun 2016 14:31:03 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id B00962E80D5 for ; Mon, 20 Jun 2016 14:30:59 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Mon, 20 Jun 2016 14:22:14 -0000 From: Peter Maydell Reply-To: Bug 1594394 <1594394@bugs.launchpad.net> Sender: bounces@canonical.com References: <20160620140124.12349.60184.malonedeb@wampee.canonical.com> Message-Id: <20160620142214.12385.99316.malone@wampee.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1594394] Re: Using setreuid / setegid crashes x86_64 user-mode target List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Whoops, I meant http://patchwork.ozlabs.org/patch/590640/. -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1594394 Title: Using setreuid / setegid crashes x86_64 user-mode target Status in QEMU: New Bug description: When setreuid() or setegid() are called from x86_64 target code in user mode, qemu crashes inside the NPTL signal handlers. x86 targets do not directly use a syscall to handle setreuid() / setegid(); instead the x86 NPTL implementation sets up a temporary data region in memory (__xidcmd) and issues a signal (SIGRT1) to all threads, allowing the handler for that signal to issue the syscall. Under qemu, __xidcmd remains null (see variable display below backtrace). Backtrace: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x3fff85c74fc0 (LWP 74517)] 0x000000006017491c in sighandler_setxid (sig=3D33, si=3D0x3fff85c72d08, c= tx=3D0x3fff85c71f90) at nptl-init.c:263 263 nptl-init.c: No such file or directory. (gdb) thread apply all bt Thread 3 (Thread 0x3fff87e8efc0 (LWP 74515)): #0 0x00000000601cc430 in syscall () #1 0x0000000060109080 in futex_wait (val=3D, ev=3D) at /build/qemu/util/qemu-thread-posix.c:292 #2 qemu_event_wait (ev=3D0x62367bb0 ) at /build/qe= mu/util/qemu-thread-posix.c:399 #3 0x000000006010f73c in call_rcu_thread (opaque=3D) at /= build/qemu/util/rcu.c:250 #4 0x0000000060176f8c in start_thread (arg=3D0x3fff87e8efc0) at pthread_= create.c:336 #5 0x00000000601cebf4 in clone () Thread 2 (Thread 0x3fff85c74fc0 (LWP 74517)): #0 0x000000006017491c in sighandler_setxid (sig=3D33, si=3D0x3fff85c72d0= 8, ctx=3D0x3fff85c71f90) at nptl-init.c:263 #1 #2 0x00000000601cc42c in syscall () #3 0x0000000060044b08 in safe_futex (val3=3D, uaddr2=3D0x= 0, timeout=3D, val=3D, op=3D128, uaddr=3D) at /build/qemu/linux-user/syscall.c:748 #4 do_futex (val3=3D, uaddr2=3D275186650880, timeout=3D0,= val=3D1129, op=3D128, uaddr=3D275186651116) at /build/qemu/linux-user/sysc= all.c:6201 #5 do_syscall (cpu_env=3D0x1000abfd350, num=3D, arg1=3D27= 5186651116, arg2=3D, arg3=3D1129, arg4=3D0, arg5=3D275186650= 880, arg6=3D, arg7=3D0, arg8=3D0) at /build/qemu/linux-user/syscall.c:10651 #6 0x00000000600347b8 in cpu_loop (env=3D0x1000abfd350) at /build/qemu/l= inux-user/main.c:317 #7 0x0000000060036ae0 in clone_func (arg=3D0x3fffc4c2ca38) at /build/qem= u/linux-user/syscall.c:5445 #8 0x0000000060176f8c in start_thread (arg=3D0x3fff85c74fc0) at pthread_= create.c:336 #9 0x00000000601cebf4 in clone () Thread 1 (Thread 0x1000aa05000 (LWP 74511)): #0 0x00000000601cc430 in syscall () #1 0x0000000060044b08 in safe_futex (val3=3D, uaddr2=3D0x= 0, timeout=3D, val=3D, op=3D128, uaddr=3D) at /build/qemu/linux-user/syscall.c:748 #2 do_futex (val3=3D, uaddr2=3D1, timeout=3D0, val=3D1, o= p=3D128, uaddr=3D275078324992) at /build/qemu/linux-user/syscall.c:6201 #3 do_syscall (cpu_env=3D0x1000aa23890, num=3D, arg1=3D27= 5078324992, arg2=3D, arg3=3D1, arg4=3D0, arg5=3D1, arg6=3D, arg7=3D0, arg8=3D0) at /build/qemu/linux-user/syscall.c:10651 #4 0x00000000600347b8 in cpu_loop (env=3D0x1000aa23890) at /build/qemu/l= inux-user/main.c:317 #5 0x00000000600020e4 in main (argc=3D, argv=3D, envp=3D) at /build/qemu/linux-user/main.c:4779 (gdb) p __xidcmd $1 =3D (struct xid_command *) 0x0 To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1594394/+subscriptions