Comments (2)
$ ./dump_policy_bpf </tmp/pol
*** Error in `./dump_policy_bpf': malloc(): memory corruption: 0x000055fdfeb8fff0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x790cb)[0x7f83045d30cb]
/lib/x86_64-linux-gnu/libc.so.6(+0x8421e)[0x7f83045de21e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_calloc+0x27b)[0x7f83045e0c2b]
./dump_policy_bpf(+0x13a50)[0x55fdfcc43a50]
./dump_policy_bpf(+0x140cd)[0x55fdfcc440cd]
./dump_policy_bpf(+0x129d8)[0x55fdfcc429d8]
./dump_policy_bpf(+0x10f19)[0x55fdfcc40f19]
./dump_policy_bpf(+0x10563)[0x55fdfcc40563]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f830457a3f1]
./dump_policy_bpf(+0x103aa)[0x55fdfcc403aa]
======= Memory map: ========
55fdfcc30000-55fdfcc4e000 r-xp 00000000 fd:00 1454983 /home/jagger/src/nsjail/kafel/tools/dump_policy_bpf/dump_policy_bpf
55fdfce4d000-55fdfce61000 r--p 0001d000 fd:00 1454983 /home/jagger/src/nsjail/kafel/tools/dump_policy_bpf/dump_policy_bpf
55fdfce61000-55fdfce62000 rw-p 00031000 fd:00 1454983 /home/jagger/src/nsjail/kafel/tools/dump_policy_bpf/dump_policy_bpf
55fdfeb8d000-55fdfebae000 rw-p 00000000 00:00 0 [heap]
7f8300000000-7f8300021000 rw-p 00000000 00:00 0
7f8300021000-7f8304000000 ---p 00000000 00:00 0
7f8304343000-7f8304359000 r-xp 00000000 fd:00 919447 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8304359000-7f8304558000 ---p 00016000 fd:00 919447 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8304558000-7f8304559000 r--p 00015000 fd:00 919447 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8304559000-7f830455a000 rw-p 00016000 fd:00 919447 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f830455a000-7f8304717000 r-xp 00000000 fd:00 919887 /lib/x86_64-linux-gnu/libc-2.24.so
7f8304717000-7f8304917000 ---p 001bd000 fd:00 919887 /lib/x86_64-linux-gnu/libc-2.24.so
7f8304917000-7f830491b000 r--p 001bd000 fd:00 919887 /lib/x86_64-linux-gnu/libc-2.24.so
7f830491b000-7f830491d000 rw-p 001c1000 fd:00 919887 /lib/x86_64-linux-gnu/libc-2.24.so
7f830491d000-7f8304921000 rw-p 00000000 00:00 0
7f8304921000-7f8304946000 r-xp 00000000 fd:00 919883 /lib/x86_64-linux-gnu/ld-2.24.so
7f8304b15000-7f8304b17000 rw-p 00000000 00:00 0
7f8304b41000-7f8304b45000 rw-p 00000000 00:00 0
7f8304b45000-7f8304b46000 r--p 00024000 fd:00 919883 /lib/x86_64-linux-gnu/ld-2.24.so
7f8304b46000-7f8304b47000 rw-p 00025000 fd:00 919883 /lib/x86_64-linux-gnu/ld-2.24.so
7f8304b47000-7f8304b48000 rw-p 00000000 00:00 0
7ffe6df63000-7ffe6df84000 rw-p 00000000 00:00 0 [stack]
7ffe6dfc8000-7ffe6dfca000 r--p 00000000 00:00 0 [vvar]
7ffe6dfca000-7ffe6dfcc000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted
And with ASAN
$ ./dump_policy_bpf </tmp/pol
ASAN:DEADLYSIGNAL
=================================================================
==2844==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000514cc3 bp 0x0c3a000001d2 sp 0x7ffd070566f0 T0)
==2844==The signal is caused by a READ memory access.
==2844==Hint: address points to the zero page.
#0 0x514cc2 in fix_tailq_moving /home/jagger/src/nsjail/kafel/range_rules.c:75:7
#1 0x514cc2 in add_range_rule /home/jagger/src/nsjail/kafel/range_rules.c:97
#2 0x5160d3 in add_missing_rules /home/jagger/src/nsjail/kafel/range_rules.c:254:7
#3 0x5160d3 in normalize_rules /home/jagger/src/nsjail/kafel/range_rules.c:309
#4 0x50ee61 in compile_policy /home/jagger/src/nsjail/kafel/codegen.c:551:3
#5 0x50ca39 in kafel_compile /home/jagger/src/nsjail/kafel/kafel.c:106:10
#6 0x50a765 in main /home/jagger/src/nsjail/kafel/tools/dump_policy_bpf/main.c:42:12
#7 0x7f3fe1e4f3f0 in __libc_start_main /build/glibc-jxM2Ev/glibc-2.24/csu/../csu/libc-start.c:291
#8 0x419679 in _start (/home/jagger/src/nsjail/kafel/tools/dump_policy_bpf/dump_policy_bpf+0x419679)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/jagger/src/nsjail/kafel/range_rules.c:75:7 in fix_tailq_moving
==2844==ABORTING
from kafel.
Fixed with b59123e
from kafel.
Related Issues (20)
- Support "#include" statements for general/shared policy files HOT 1
- no 'stat' at x86-64? HOT 2
- Bitwise OR seems to be missing HOT 1
- Support SECCOMP_RET_KILL_PROCESS action HOT 1
- Buildish time support? HOT 1
- Tests depend on system configuration, fail if SIGSYS dumps core HOT 1
- __X32_SYSCALL_BIT not checked HOT 2
- Reduce libkafel.so size
- Add a tag HOT 1
- member access operator HOT 3
- Incorrect PBF generation when `if` branch invalidates `else` location HOT 1
- segv in grow_errors_buffer HOT 1
- Fail to build dump_bpf_policy binary on x86 box HOT 1
- Using fields in structs HOT 1
- Release a new version HOT 1
- Is it possible to filter specific execve based on the filename that is being executed? HOT 1
- nsjail requires listing it's own syscalls
- Missing syscalls from amd64 HOT 2
- Cant build under CentOS 7 HOT 5
- Support SECCOMP_RET_LOG action HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kafel.