Skip to content

Commit 7d8dbd7

Browse files
author
Lars Gierth
committed
Revert "doc: remove doc/ in preparation for git subtree-add"
This reverts commit 55c7f45.
1 parent 6f658cc commit 7d8dbd7

24 files changed

+5461
-0
lines changed

doc/CjdnsModules.odg

63.4 KB
Binary file not shown.

doc/CjdnsModules.png

317 KB
Loading

doc/Seccomp.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Seccomp
2+
3+
SECCOMP (secure computing) is a way for programs to declare to the Linux kernel
4+
that they will never make certain system calls, thus any attempt to make one of
5+
these calls is interpreted as a security penetration and the kernel can forcibly
6+
kill off the program, preventing harm to the computer.
7+
8+
## Seccomp failures in cjdns
9+
10+
If you are reading this because cjdns is halting on you, you are probably getting
11+
a log message like the following:
12+
13+
Attempted banned syscall number [232] see docs/Seccomp.md for more information
14+
15+
This number (`232` in the example) is specific to your system and you need to
16+
run a command to convert it to a syscall name.
17+
18+
echo '#include <sys/syscall.h>' | cpp -dM | grep '#define __NR_.* 232'
19+
20+
Obviously you'll be replacing `232` with the actual syscall number which your system
21+
printed. The Result might look something like the following:
22+
23+
#define __NR_epoll_wait 232
24+
25+
Which would tell you (for example) that the `epoll_wait` syscall was disallowed on
26+
your system. In this case you'd need to go to `util/Seccomp.c` and inside of the
27+
`mkfilter()` function where the actual SECCOMP rules are set up, you'll see a set
28+
of entries such as the following.
29+
30+
#ifdef __NR_mmap2
31+
IFEQ(__NR_mmap2, success),
32+
#endif
33+
34+
Add a similar entry for the syscall (make sure you put it with the others and not)
35+
below the `RET(SECCOMP_RET_TRAP),` line which triggers the failure). When you have
36+
finished adding your system call rebuild and re-test cjdns. If it works well then
37+
please make a Pull Request :-) If not then open a bug report and explain the problem.

doc/SmartOS.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Installing cjdns on SmartOS
2+
3+
** currently broken - wip
4+
5+
pkgin in scmgit-1.8.3.1
6+
pkgin in gcc47-4.7.3nb1
7+
pkgin in cmake-2.8.11
8+
pkgin in gmake-3.82nb7
9+
git clone git://github.com/cjdelisle/cjdns.git
10+
cd cjdns/
11+
./do
12+

doc/TrafficAnalisys.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Some tricks for debugging cjdns issues using traffic analysis
2+
3+
Traffic analysis on cjdns is stupidly hard because everything is encrypted point to point.
4+
Basically the only thing you have to go on is the size of packets, recently we fixed a bug
5+
in the switch pinger which was causing packets to be dropped randomly (most of the time).
6+
7+
In order to detect where the packets were dropping, we used ping with a special size and
8+
tcpdumped for the related packet.
9+
10+
Switch pings sent over UDP will normally appear as 60 bytes. By adding a few bytes of payload
11+
data to the ping, one can cause packets to appear at the UDP level which are of a very unlikely
12+
size.
13+
14+
## Step 1: startup tcpdump
15+
16+
$ sudo tcpdump -n -i eth0 'udp and port 11223' | grep ' 6[0-9]$'
17+
18+
## Step 2: begin sending pings
19+
20+
$ ./contrib/nodejs/tools/ping -s 0000.0000.0000.0aa3
21+
22+
Observe suddenly 60 byte packets appear:
23+
24+
18:40:56.292748 IP 123.45.67.8.12345 > 87.65.43.210.11223: UDP, length 60
25+
18:40:56.292748 IP 123.45.67.8.12345 > 87.65.43.210.11223: UDP, length 60
26+
27+
## Step 3: vary the size
28+
29+
In order to find a packet size which will filter out noise, add some bytes of data to the ping.
30+
31+
$ ./contrib/nodejs/tools/ping -d 'x' -s 0000.0000.0000.0aa3
32+
33+
This will create a ping with a single byte payload which will lead to 61 byte packets, a very
34+
rare packet size in general.
35+
36+
18:40:56.293030 IP 123.45.67.8.12345 > 87.65.43.210.11223: UDP, length 61
37+
18:40:57.289980 IP 123.45.67.8.12345 > 87.65.43.210.11223: UDP, length 61
38+
18:40:57.290356 IP 123.45.67.8.12345 > 87.65.43.210.11223: UDP, length 61
39+
40+
Once you find a "quiet" packet size to grep for, you can begin testing to see where the packet
41+
drops.
42+

doc/Whitepaper.md

+942
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)