summaryrefslogtreecommitdiff
path: root/DESIGN
diff options
context:
space:
mode:
Diffstat (limited to 'DESIGN')
-rw-r--r--DESIGN16
1 files changed, 16 insertions, 0 deletions
diff --git a/DESIGN b/DESIGN
index 35928b4..b6e2050 100644
--- a/DESIGN
+++ b/DESIGN
@@ -112,6 +112,22 @@ what lands on disk is the format opentracker has written for years. A step
112between writing and reading mis-dates a torrent by the size of the step, 112between writing and reading mis-dates a torrent by the size of the step,
113which costs it part of its last day and nothing else. 113which costs it part of its last day and nothing else.
114 114
115Build hardening the shipped binary
116----------------------------------
117
118The production and debug binaries carry -fstack-protector-strong, PIE and
119_FORTIFY_SOURCE=2; a GNU-style linker also gets full RELRO. Measured cost on
120the announce hot path is 300 to 305 nanoseconds, under two per cent, and the
121individual flags sit inside the run-to-run noise: add_peer has few stack
122buffers, most buffer sizes are known at compile time so FORTIFY emits no
123runtime check, and PIE on arm64 is almost free. On x86-64 PIE costs a little
124more. End to end it is invisible, since a UDP announce is mostly kernel time.
125
126The flags are not in OT_CFLAGS, so the sanitizer test builds do not inherit
127them. AddressSanitizer checks harder than FORTIFY does, and the two clash on
128FreeBSD, where a FORTIFY plus ASan build aborted a multi hash scrape that the
129hardened production binary serves without complaint.
130
115Startup and teardown order 131Startup and teardown order
116-------------------------- 132--------------------------
117 133