Public bug reported:

[Impact]

While running seccomp_bpf, kill_after_ptrace() gets stuck if we run it
via /usr/bin/timeout (that is the default), until the timeout expires.

This is because /usr/bin/timeout is preventing to properly deliver
signals to ptrace'd children (SIGSYS in this case).

[Test case]

This problem can be easily reproduced by running:

 $ sudo make TARGETS=seccomp kselftest
 ...

 # [ RUN      ] TRACE_syscall.skip_a#
 not ok 1 selftests: seccomp: seccomp_bpf # TIMEOUT

The test is hanging at this point until the timeout expires and then it
reports the timeout error.

[Fix]

This problem can be prevented by passing --foreground to /usr/bin/timeout,
allowing to properly deliver signals to children processes.

[Regression potential]

Not an upstream fix (patch has been sent to the lkml
https://lkml.org/lkml/2020/4/10/153), but the fix is trivial and it's
only affecting the selftests, not the kernel, so regression potential is
minimal.

** Affects: linux (Ubuntu)
     Importance: Medium
     Assignee: Andrea Righi (arighi)
         Status: New

** Affects: linux (Ubuntu Eoan)
     Importance: Medium
     Assignee: Andrea Righi (arighi)
         Status: New

** Affects: linux (Ubuntu Focal)
     Importance: Medium
     Assignee: Andrea Righi (arighi)
         Status: New

** Changed in: linux (Ubuntu)
   Importance: Undecided => Medium

** Changed in: linux (Ubuntu)
     Assignee: (unassigned) => Andrea Righi (arighi)

** Also affects: linux (Ubuntu Focal)
   Importance: Medium
     Assignee: Andrea Righi (arighi)
       Status: New

** Also affects: linux (Ubuntu Eoan)
   Importance: Undecided
       Status: New

** Changed in: linux (Ubuntu Eoan)
   Importance: Undecided => Medium

** Changed in: linux (Ubuntu Eoan)
     Assignee: (unassigned) => Andrea Righi (arighi)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1872047

Title:
  kselftest: seccomp kill_after_ptrace() timeout

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1872047/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to