Skip to contentSkip to conversation

qemu runas and sandbox option incompatible, process will hang in futex after setgid

Qemu-devel Serge Hallyn 1 participant 6 messages Apr 20, 2016 – Jun 10, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

** Also affects: qemu
Importance: Undecided
Status: New

** Changed in: qemu (Ubuntu)
Status: New => Triaged

** Changed in: qemu (Ubuntu)
Importance: Undecided => Wishlist

Signature · 55 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1525676

Title:
  qemu runas and sandbox option incompatible, process will hang in futex
  after setgid

Status in QEMU:
  New
Status in qemu package in Ubuntu:
  Triaged

Bug description:
  With -runas [user] and -sandbox on, qemu process will fail in the
  process of dropping privileges. While setgid() is done (see below),
  setuid() is not attempted. Instead process blocks waiting for a futex
  never to come.

  [pid 21769] +++ killed by SIGSYS +++
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] tgkill(21767, 21768, SIGRT_1 <unfinished ...>
  [pid 21768] <... nanosleep resumed> {0, 7284187}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
  [pid 21768] --- SIGRT_1 {si_signo=SIGRT_1, si_code=SI_TKILL, si_pid=21767, si_uid=0} ---
  [pid 21768] setgid(100)                 = 0
  [pid 21768] futex(0x7f7f0f53fd1c, FUTEX_WAKE_PRIVATE, 1) = 0
  [pid 21768] rt_sigreturn()              = -1 EINTR (Interrupted system call)
  [pid 21768] nanosleep({0, 7284187},  <unfinished ...>
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] futex(0x7ffd5a9b6890, FUTEX_WAIT_PRIVATE, 3, NULL <unfinished ...>
  [pid 21768] <... nanosleep resumed> 0x7f7f0f53eb00) = 0
  [pid 21768] futex(0x55f52acd1f44, FUTEX_WAIT, 4294967295, NULL

  This bug might be addresses in the discussion/patchset
  http://qemu.11.n7.nabble.com/PATCH-Add-syscalls-for-runas-and-chroot-
  to-the-seccomp-sandbox-td359588.html

  # lsb_release -rd
  Description:    Ubuntu 15.10
  Release:        15.10

  # apt-cache policy qemu-system-x86
  qemu-system-x86:
    Installed: 1:2.3+dfsg-5ubuntu9.1
    Candidate: 1:2.3+dfsg-5ubuntu9.1
    Version table:
   *** 1:2.3+dfsg-5ubuntu9.1 0
          500 http://archive.ubuntu.com/ubuntu/ wily-updates/main amd64 Packages
          500 http://archive.ubuntu.com/ubuntu/ wily-security/main amd64 Packages
          100 /var/lib/dpkg/status
       1:2.3+dfsg-5ubuntu9 0
          500 http://archive.ubuntu.com/ubuntu/ wily/main amd64 Packages

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1525676/+subscriptions
#2 lore raw
In reply to a message not in the archive

hmm, the change still did not made it upstream.
I lost track on it and only see it now checking bugs that became dormant - was that fixed in another way?

** Changed in: qemu (Ubuntu)
Status: Triaged => Incomplete

Signature · 55 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1525676

Title:
  qemu runas and sandbox option incompatible, process will hang in futex
  after setgid

Status in QEMU:
  New
Status in qemu package in Ubuntu:
  Incomplete

Bug description:
  With -runas [user] and -sandbox on, qemu process will fail in the
  process of dropping privileges. While setgid() is done (see below),
  setuid() is not attempted. Instead process blocks waiting for a futex
  never to come.

  [pid 21769] +++ killed by SIGSYS +++
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] tgkill(21767, 21768, SIGRT_1 <unfinished ...>
  [pid 21768] <... nanosleep resumed> {0, 7284187}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
  [pid 21768] --- SIGRT_1 {si_signo=SIGRT_1, si_code=SI_TKILL, si_pid=21767, si_uid=0} ---
  [pid 21768] setgid(100)                 = 0
  [pid 21768] futex(0x7f7f0f53fd1c, FUTEX_WAKE_PRIVATE, 1) = 0
  [pid 21768] rt_sigreturn()              = -1 EINTR (Interrupted system call)
  [pid 21768] nanosleep({0, 7284187},  <unfinished ...>
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] futex(0x7ffd5a9b6890, FUTEX_WAIT_PRIVATE, 3, NULL <unfinished ...>
  [pid 21768] <... nanosleep resumed> 0x7f7f0f53eb00) = 0
  [pid 21768] futex(0x55f52acd1f44, FUTEX_WAIT, 4294967295, NULL

  This bug might be addresses in the discussion/patchset
  http://qemu.11.n7.nabble.com/PATCH-Add-syscalls-for-runas-and-chroot-
  to-the-seccomp-sandbox-td359588.html

  # lsb_release -rd
  Description:    Ubuntu 15.10
  Release:        15.10

  # apt-cache policy qemu-system-x86
  qemu-system-x86:
    Installed: 1:2.3+dfsg-5ubuntu9.1
    Candidate: 1:2.3+dfsg-5ubuntu9.1
    Version table:
   *** 1:2.3+dfsg-5ubuntu9.1 0
          500 http://archive.ubuntu.com/ubuntu/ wily-updates/main amd64 Packages
          500 http://archive.ubuntu.com/ubuntu/ wily-security/main amd64 Packages
          100 /var/lib/dpkg/status
       1:2.3+dfsg-5ubuntu9 0
          500 http://archive.ubuntu.com/ubuntu/ wily/main amd64 Packages

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1525676/+subscriptions
#3 lore raw
In reply to a message not in the archive

There is some overlap with LP: #1675114 so you might be interested to know that @otubo is working on refactoring seccomp for upstream. No firm ETA yet but he thinks that 18.04 would be doable.

Signature · 55 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1525676

Title:
  qemu runas and sandbox option incompatible, process will hang in futex
  after setgid

Status in QEMU:
  New
Status in qemu package in Ubuntu:
  Incomplete

Bug description:
  With -runas [user] and -sandbox on, qemu process will fail in the
  process of dropping privileges. While setgid() is done (see below),
  setuid() is not attempted. Instead process blocks waiting for a futex
  never to come.

  [pid 21769] +++ killed by SIGSYS +++
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] tgkill(21767, 21768, SIGRT_1 <unfinished ...>
  [pid 21768] <... nanosleep resumed> {0, 7284187}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
  [pid 21768] --- SIGRT_1 {si_signo=SIGRT_1, si_code=SI_TKILL, si_pid=21767, si_uid=0} ---
  [pid 21768] setgid(100)                 = 0
  [pid 21768] futex(0x7f7f0f53fd1c, FUTEX_WAKE_PRIVATE, 1) = 0
  [pid 21768] rt_sigreturn()              = -1 EINTR (Interrupted system call)
  [pid 21768] nanosleep({0, 7284187},  <unfinished ...>
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] futex(0x7ffd5a9b6890, FUTEX_WAIT_PRIVATE, 3, NULL <unfinished ...>
  [pid 21768] <... nanosleep resumed> 0x7f7f0f53eb00) = 0
  [pid 21768] futex(0x55f52acd1f44, FUTEX_WAIT, 4294967295, NULL

  This bug might be addresses in the discussion/patchset
  http://qemu.11.n7.nabble.com/PATCH-Add-syscalls-for-runas-and-chroot-
  to-the-seccomp-sandbox-td359588.html

  # lsb_release -rd
  Description:    Ubuntu 15.10
  Release:        15.10

  # apt-cache policy qemu-system-x86
  qemu-system-x86:
    Installed: 1:2.3+dfsg-5ubuntu9.1
    Candidate: 1:2.3+dfsg-5ubuntu9.1
    Version table:
   *** 1:2.3+dfsg-5ubuntu9.1 0
          500 http://archive.ubuntu.com/ubuntu/ wily-updates/main amd64 Packages
          500 http://archive.ubuntu.com/ubuntu/ wily-security/main amd64 Packages
          100 /var/lib/dpkg/status
       1:2.3+dfsg-5ubuntu9 0
          500 http://archive.ubuntu.com/ubuntu/ wily/main amd64 Packages

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1525676/+subscriptions
#4 lore raw
In reply to a message not in the archive

I haven't tried, but I think this should be fixed now with the new elevateprivileges parameter of the -sandbox option. Have you tried to reproduce the problem with the latest version of QEMU already?

** Changed in: qemu
Status: New => Incomplete

Signature · 55 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1525676

Title:
  qemu runas and sandbox option incompatible, process will hang in futex
  after setgid

Status in QEMU:
  Incomplete
Status in qemu package in Ubuntu:
  Incomplete

Bug description:
  With -runas [user] and -sandbox on, qemu process will fail in the
  process of dropping privileges. While setgid() is done (see below),
  setuid() is not attempted. Instead process blocks waiting for a futex
  never to come.

  [pid 21769] +++ killed by SIGSYS +++
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] tgkill(21767, 21768, SIGRT_1 <unfinished ...>
  [pid 21768] <... nanosleep resumed> {0, 7284187}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
  [pid 21768] --- SIGRT_1 {si_signo=SIGRT_1, si_code=SI_TKILL, si_pid=21767, si_uid=0} ---
  [pid 21768] setgid(100)                 = 0
  [pid 21768] futex(0x7f7f0f53fd1c, FUTEX_WAKE_PRIVATE, 1) = 0
  [pid 21768] rt_sigreturn()              = -1 EINTR (Interrupted system call)
  [pid 21768] nanosleep({0, 7284187},  <unfinished ...>
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] futex(0x7ffd5a9b6890, FUTEX_WAIT_PRIVATE, 3, NULL <unfinished ...>
  [pid 21768] <... nanosleep resumed> 0x7f7f0f53eb00) = 0
  [pid 21768] futex(0x55f52acd1f44, FUTEX_WAIT, 4294967295, NULL

  This bug might be addresses in the discussion/patchset
  http://qemu.11.n7.nabble.com/PATCH-Add-syscalls-for-runas-and-chroot-
  to-the-seccomp-sandbox-td359588.html

  # lsb_release -rd
  Description:    Ubuntu 15.10
  Release:        15.10

  # apt-cache policy qemu-system-x86
  qemu-system-x86:
    Installed: 1:2.3+dfsg-5ubuntu9.1
    Candidate: 1:2.3+dfsg-5ubuntu9.1
    Version table:
   *** 1:2.3+dfsg-5ubuntu9.1 0
          500 http://archive.ubuntu.com/ubuntu/ wily-updates/main amd64 Packages
          500 http://archive.ubuntu.com/ubuntu/ wily-security/main amd64 Packages
          100 /var/lib/dpkg/status
       1:2.3+dfsg-5ubuntu9 0
          500 http://archive.ubuntu.com/ubuntu/ wily/main amd64 Packages

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1525676/+subscriptions
#5 lore raw
In reply to a message not in the archive

[Expired for qemu (Ubuntu) because there has been no activity for 60 days.]

** Changed in: qemu (Ubuntu)
Status: Incomplete => Expired

Signature · 55 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1525676

Title:
  qemu runas and sandbox option incompatible, process will hang in futex
  after setgid

Status in QEMU:
  Expired
Status in qemu package in Ubuntu:
  Expired

Bug description:
  With -runas [user] and -sandbox on, qemu process will fail in the
  process of dropping privileges. While setgid() is done (see below),
  setuid() is not attempted. Instead process blocks waiting for a futex
  never to come.

  [pid 21769] +++ killed by SIGSYS +++
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] tgkill(21767, 21768, SIGRT_1 <unfinished ...>
  [pid 21768] <... nanosleep resumed> {0, 7284187}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
  [pid 21768] --- SIGRT_1 {si_signo=SIGRT_1, si_code=SI_TKILL, si_pid=21767, si_uid=0} ---
  [pid 21768] setgid(100)                 = 0
  [pid 21768] futex(0x7f7f0f53fd1c, FUTEX_WAKE_PRIVATE, 1) = 0
  [pid 21768] rt_sigreturn()              = -1 EINTR (Interrupted system call)
  [pid 21768] nanosleep({0, 7284187},  <unfinished ...>
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] futex(0x7ffd5a9b6890, FUTEX_WAIT_PRIVATE, 3, NULL <unfinished ...>
  [pid 21768] <... nanosleep resumed> 0x7f7f0f53eb00) = 0
  [pid 21768] futex(0x55f52acd1f44, FUTEX_WAIT, 4294967295, NULL

  This bug might be addresses in the discussion/patchset
  http://qemu.11.n7.nabble.com/PATCH-Add-syscalls-for-runas-and-chroot-
  to-the-seccomp-sandbox-td359588.html

  # lsb_release -rd
  Description:    Ubuntu 15.10
  Release:        15.10

  # apt-cache policy qemu-system-x86
  qemu-system-x86:
    Installed: 1:2.3+dfsg-5ubuntu9.1
    Candidate: 1:2.3+dfsg-5ubuntu9.1
    Version table:
   *** 1:2.3+dfsg-5ubuntu9.1 0
          500 http://archive.ubuntu.com/ubuntu/ wily-updates/main amd64 Packages
          500 http://archive.ubuntu.com/ubuntu/ wily-security/main amd64 Packages
          100 /var/lib/dpkg/status
       1:2.3+dfsg-5ubuntu9 0
          500 http://archive.ubuntu.com/ubuntu/ wily/main amd64 Packages

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1525676/+subscriptions
#6 lore raw
In reply to a message not in the archive

[Expired for QEMU because there has been no activity for 60 days.]

** Changed in: qemu
Status: Incomplete => Expired

Signature · 55 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1525676

Title:
  qemu runas and sandbox option incompatible, process will hang in futex
  after setgid

Status in QEMU:
  Expired
Status in qemu package in Ubuntu:
  Expired

Bug description:
  With -runas [user] and -sandbox on, qemu process will fail in the
  process of dropping privileges. While setgid() is done (see below),
  setuid() is not attempted. Instead process blocks waiting for a futex
  never to come.

  [pid 21769] +++ killed by SIGSYS +++
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] tgkill(21767, 21768, SIGRT_1 <unfinished ...>
  [pid 21768] <... nanosleep resumed> {0, 7284187}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
  [pid 21768] --- SIGRT_1 {si_signo=SIGRT_1, si_code=SI_TKILL, si_pid=21767, si_uid=0} ---
  [pid 21768] setgid(100)                 = 0
  [pid 21768] futex(0x7f7f0f53fd1c, FUTEX_WAKE_PRIVATE, 1) = 0
  [pid 21768] rt_sigreturn()              = -1 EINTR (Interrupted system call)
  [pid 21768] nanosleep({0, 7284187},  <unfinished ...>
  [pid 21767] <... tgkill resumed> )      = 0
  [pid 21767] futex(0x7ffd5a9b6890, FUTEX_WAIT_PRIVATE, 3, NULL <unfinished ...>
  [pid 21768] <... nanosleep resumed> 0x7f7f0f53eb00) = 0
  [pid 21768] futex(0x55f52acd1f44, FUTEX_WAIT, 4294967295, NULL

  This bug might be addresses in the discussion/patchset
  http://qemu.11.n7.nabble.com/PATCH-Add-syscalls-for-runas-and-chroot-
  to-the-seccomp-sandbox-td359588.html

  # lsb_release -rd
  Description:    Ubuntu 15.10
  Release:        15.10

  # apt-cache policy qemu-system-x86
  qemu-system-x86:
    Installed: 1:2.3+dfsg-5ubuntu9.1
    Candidate: 1:2.3+dfsg-5ubuntu9.1
    Version table:
   *** 1:2.3+dfsg-5ubuntu9.1 0
          500 http://archive.ubuntu.com/ubuntu/ wily-updates/main amd64 Packages
          500 http://archive.ubuntu.com/ubuntu/ wily-security/main amd64 Packages
          100 /var/lib/dpkg/status
       1:2.3+dfsg-5ubuntu9 0
          500 http://archive.ubuntu.com/ubuntu/ wily/main amd64 Packages

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1525676/+subscriptions