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