Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch for seccomp #130

Closed
wants to merge 1 commit into from
Closed

patch for seccomp #130

wants to merge 1 commit into from

Conversation

jorge-lip
Copy link
Contributor

Patch for seccomp on kernels >= 4.8.0
adds handle_tracee_event_kernel_4_8() to event.c

@walterbrebels
Copy link

We used proot and gdb to debug binaries within another sysroot. While it worked with the master branch and with an older kernel it doesn't work with a more recent kernel and/or this patch.

You can reproduce it with this command:

$ proot -R / gdb /bin/true
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /bin/true...(no debugging symbols found)...done.
(gdb) run
Starting program: /bin/true 
warning: linux_check_ptrace_features: failed to kill child

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000000000003 in ?? ()
#2  0x00007fffffffcffb in ?? ()
#3  0x00007fffffffd005 in ?? ()
#4  0x00007fffffffd008 in ?? ()
#5  0x0000000000000000 in ?? ()

With an older kernel and the master branch it works fine and when the application throws a segmentation fault we can catch it in gdb.

With a more recent kernel and the master branch we have to use PROOT_NO_SECCOMP=1 but gdb freezes when the application terminates. With a more recent kernel and this PR we get a segmentation fault as documented above.

This was referenced Jan 27, 2018
@oxr463 oxr463 added this to the v5.1.1 milestone Nov 29, 2018
@oxr463

This comment has been minimized.

@oxr463 oxr463 self-requested a review December 8, 2018 03:14
Copy link
Collaborator

@oxr463 oxr463 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See suggestions here: #130 (comment)

@oxr463 oxr463 self-assigned this Dec 11, 2018
@oxr463
Copy link
Collaborator

oxr463 commented Dec 11, 2018

#include <linux/version.h> /* KERNEL_VERSION, */

From: #149

@romainreuillon
Copy link

What if the machine proot run on is not the same as the one on which it as been compiled ?

@oxr463
Copy link
Collaborator

oxr463 commented Jan 13, 2019

If the kernel version doesn't match i.e. running on an older kernel, it will default to the old behavior.

Also, it is important to note that the user can fake the kernel version at runtime via the -k flag (1).

@romainreuillon
Copy link

Great !

@oxr463 oxr463 reopened this Mar 31, 2019
@oxr463
Copy link
Collaborator

oxr463 commented Mar 31, 2019

oxr463 pushed a commit that referenced this pull request May 14, 2019
Remove PROOT_NO_SECCOMP=1 from travis

Closes: #106
Closes: #130
@oxr463
Copy link
Collaborator

oxr463 commented May 28, 2019

Debugging

make -C src
make -C tests &> log.txt
make -C tests V=99 &> verbose_log.txt

Gentoo

log.txt
verbose_log.txt

Alpine

log.txt
verbose_log.txt

log.txt
verbose_log.txt

@dmikushin
Copy link

As of the current master 5f780cb, I have to use PROOT_NO_SECCOMP=1 on kernel 3.10.0-1160.95.1.el7.x86_64, otherwise I get SIGSEGV (signal 11) in the verbose log. Thanks for the tip!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants