hyperboria / bugs

Peer-to-peer IPv6 networking, secure and near-zero-conf.
154 stars 17 forks source link

Printing backtrace is not working #86

Closed Kubuxu closed 8 years ago

Kubuxu commented 8 years ago

It was added in cjdelisle/cjdns#778 causes

Assertion failure ...
Attempted banned syscall number [2] see doc/Seccomp.md for more information

Core exited with status [0], signal [31]
Backtrace (10 frames):
  cjdroute(+0x695a) [0x7f86ce96395a]
  cjdroute(+0x5edc4) [0x7f86ce9bbdc4]
  cjdroute(+0x75df2) [0x7f86ce9d2df2]
  cjdroute(+0x76891) [0x7f86ce9d3891]
  cjdroute(+0x7cd94) [0x7f86ce9d9d94]
  cjdroute(+0x71b47) [0x7f86ce9ceb47]
  cjdroute(+0xbbc5) [0x7f86ce968bc5]
  cjdroute(+0x5dcd) [0x7f86ce962dcd]
  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f86cdf67a40]
  cjdroute(+0x6399) [0x7f86ce963399]
Aborted (core dumped)

It is due to call to open in fprintf.

ghost commented 8 years ago

Check out https://github.com/hyperboria/cjdns/blob/master/doc/Seccomp.md

Kubuxu commented 8 years ago

Problem is that we don't want to allow syscall 2 (open). Lines in question: https://github.com/cjdelisle/cjdns/blob/master/util/Assert.c#L38-L50

ghost commented 8 years ago

Yeah I'm not sure about the whole backtrace printing -- I haven't ever managed to get it to print a proper full backtrace, so it's usefulness is limited.

Kubuxu commented 8 years ago

Only backtrace I get is backtrace of it not being able to print backtrace. If it was not a case then it might been useful.

ghost commented 8 years ago

Wanna make that printf instead?

Kubuxu commented 8 years ago

Might also not work. Cjdns uses stderr for everything.

wfleurant commented 8 years ago

list of admin-api calls hiting Attempted banned syscall number.

ETHInterface_listDevices
Security_checkPermissions
Security_nofiles
Security_noforks
Security_seccomp
Security_setupComplete
Core_initTunnel
Security_getUser
Security_setUser
UDPInterface_new
wfleurant commented 8 years ago

prob wrong thread -- should i make an issue? on cjdns-v17.1-119-g0d845ab-dirty

Kubuxu commented 8 years ago

Those are probably crashing and showing this instead of real stacktrace.

Kubuxu commented 8 years ago

I removed printing trace in cjdelisle/cjdns#878