Set up Linux development environment - #1
Merged
Conversation
Co-authored-by: BrainX <brainx@users.noreply.github.com>
brainx
marked this pull request as ready for review
July 20, 2026 23:52
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
brainx
added a commit
that referenced
this pull request
Jul 26, 2026
The daily-summary loop clamped its start index with a ternary whose result was
discarded:
for ((i = (today - havestats) / SECONDSPERDAY) > 79 ? 79 : i; i >= 1; i--)
What executed was the bare assignment, so i took the unbounded day count and
indexed msg[7][80] and pool[2][80] past their ends. havestats is updated outside
the `today - then < 80 * SECONDSPERDAY` guard that protects the array writes
(three sites), so any stats.log or id.log record older than 80 days puts the
index out of range.
Reachable unauthenticated: a mail with `Subject: remailer-stats` classifies as
REM_KIND_STATS and dispatches straight into stats(). Without a sanitizer the
process does not fault -- it formats the out-of-bounds stack words into the reply
and mails them to whoever asked, which for a remailer is the worst available
failure mode.
Confirmed with AddressSanitizer before the fix:
ERROR: AddressSanitizer: stack-buffer-overflow READ of size 4
#0 stats stats.c:220
#1 remailer_dispatch remailer_dispatch.c:136
[1088, 3328) 'msg' <== Memory access at offset 3328 overflows this variable
and in the delivered reply: 431 lines instead of ~100, with leaked stack values
in the Postings column (583045632, 583045584, -188923520). After the fix the same
input is ASan-clean and the reply is 110 lines with exactly 79 daily rows.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
brainx
added a commit
that referenced
this pull request
Jul 26, 2026
The daily-summary loop clamped its start index with a ternary whose result was
discarded:
for ((i = (today - havestats) / SECONDSPERDAY) > 79 ? 79 : i; i >= 1; i--)
What executed was the bare assignment, so i took the unbounded day count and
indexed msg[7][80] and pool[2][80] past their ends. havestats is updated outside
the `today - then < 80 * SECONDSPERDAY` guard that protects the array writes
(three sites), so any stats.log or id.log record older than 80 days puts the
index out of range.
Reachable unauthenticated: a mail with `Subject: remailer-stats` classifies as
REM_KIND_STATS and dispatches straight into stats(). Without a sanitizer the
process does not fault -- it formats the out-of-bounds stack words into the reply
and mails them to whoever asked, which for a remailer is the worst available
failure mode.
Confirmed with AddressSanitizer before the fix:
ERROR: AddressSanitizer: stack-buffer-overflow READ of size 4
#0 stats stats.c:220
#1 remailer_dispatch remailer_dispatch.c:136
[1088, 3328) 'msg' <== Memory access at offset 3328 overflows this variable
and in the delivered reply: 431 lines instead of ~100, with leaked stack values
in the Postings column (583045632, 583045584, -188923520). After the fix the same
input is ASan-clean and the reply is 110 lines with exactly 79 daily rows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The repo's documented build path (
scripts/build-macos.sh,make build, CI) targets macOS/Homebrew, but the cloud dev VM is Linux. This PR adds a Linux build path and developer documentation so the project builds, runs, and tests on Linux without modifying any vintage source.scripts/build-linux.sh— mirrorsbuild-macos.shusing system libraries (libssl-dev,libpcre3-dev(PCRE1),libncurses-dev,zlib1g-dev). Adds the-fcommonflag required by modern GCC/Clang for the legacy global declarations, generatesSrc/MakefilefromMakefile.in, builds, and installsbin/mixmaster+bin/mixremailer.AGENTS.md—## Cursor Cloud specific instructionsdocumenting the Linux build, run/test commands, and non-obvious runtime gotchas (no MTA on VM, pool batching, self-addressed loopback, expired 2007 sample keys).No existing code was changed.
Verification
Built both binaries and ran a full end-to-end anonymous-remailer flow: client encrypts a message → remailer decrypts the hop → final mail delivered with the recovered plaintext and anonymizing disclaimer.
mixmaster_e2e_demo.mp4
Mixmaster ncurses client menu
Delivered anonymous mail (final hop output):
final_delivered_mail.eml
./scripts/build-linux.sh— buildsbin/mixmaster+bin/mixremailerMIXPATH="$PWD/Mix" ./bin/mixremailer -M— CI smoke test, exit 0 (auto-generates RSA key)cc -DHAVE_SETENV -include string.h Src/tests/test-parse_yearmonthday.c && ./a.out— printsOK.To show artifacts inline, enable in settings.