Commit Graph
77 Commits
Author SHA1 Message Date
Max Lv 201e70c4bd Modernize C builds with offline dependencies and portable runtime helpers (#3050)
Bundle pinned offline dependencies, remove libcork/libipset and submodule requirements, and add portable runtime helpers with relocatable static/shared library installations.

Add Clang static build validation for Linux/musl, macOS and Windows, real TCP/UDP and SIP003 interoperability coverage, and recorded performance tradeoffs. All 21 hosted checks pass at the reviewed PR head 8d504e6218.
2026-09-11 13:42:11 +08:00
Max LvandClaude Fable 5 dd2704c857 Fix bugs found by clang-tidy triage; ratchet warning budget to zero (#3047)
Real bugs fixed:
- manager.c: kill_server/stop_server checked fscanf() != EOF, so malformed
  pid file content left pid uninitialized and passed it to kill(). Parse
  with fgets + ss_parse_int and require pid > 0.
- utils.c: get_default_conf() crashed on strlen(NULL) when HOME is unset
  (e.g. daemons started by init) and left a dangling static pointer after
  free(), a latent use-after-free on repeated calls. Use a static buffer
  and fall back to the system config when HOME is missing.
- local.c: in UDP_ONLY mode, start_ss_local_server() passed uninitialized
  listen_ctx.fd to the library callback. Initialize it to -1.

Improvements:
- Replace rand()/srand(time(NULL)) upstream-server selection in ss-local,
  ss-redir and ss-tunnel with libsodium randombytes_uniform(): unbiased,
  unpredictable, and no seeding required (cert-msc30/msc32).
- Mark FATAL() noreturn so both the compiler and analyzers understand
  control flow (removes a family of analyzer false positives).
- Drop two dead stores (manager.c restore_sigchld, udprelay.c src_addr_len).

All remaining findings were verified as false positives and carry NOLINT
comments with rationale (uthash macro internals, symmetric back-pointer
cleanup, analyzer-invisible postconditions). clang-tidy-18 on Linux now
reports zero warnings, so MAX_WARNINGS drops from 29 to 0.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 13:02:58 +08:00
Max Lv 5559eec939 Harden security-sensitive input handling (#3045)
* harden security-sensitive input handling

* enable ctest failure checks in ci

* add valgrind leak smoke tests

* split tests into separate workflow
2026-07-15 11:10:24 +08:00
Maxim Galaganov d61d09aa0c Detect kernel support for MPTCP at runtime 2022-06-23 10:38:32 +08:00
Max Lv 64b97cd9a3 Clean up 2019-07-17 09:16:06 +08:00
Max Lv f0205e7f13 Refine the helper function 2019-06-30 22:32:54 +08:00
Max Lv ab9764dbdf Fix building issues on Linux 2019-06-30 21:56:57 +08:00
Max Lv 6c28add775 Enable -Wcas-align for #2412 2019-06-30 21:34:35 +08:00
Chinsyo 7bd382042b bump copyright year 2019-03-21 12:39:29 +08:00
Max Lv 85b190372b Fix the ss_free macros 2019-01-22 16:20:49 +08:00
Max Lv 782311ad2b Refine ss_align interfaces 2019-01-22 12:59:29 +08:00
Max Lv fbb311ed06 Use _aligned_free for MinGW 2019-01-22 12:43:39 +08:00
Max Lv dd5e954ab4 Clean up 2018-09-02 17:21:23 -07:00
sxyoxygen 46e2b28d39 Update utils.h 2018-08-08 12:03:56 +08:00
sxyoxygen 9e7a99378a Update utils.h 2018-08-08 01:45:59 +08:00
Max Lv 20332eb04b Fix #1999 2018-03-26 19:48:19 -07:00
Linus Yang 4ee1d18ce9 MinGW: support color text in console 2018-03-23 02:59:50 +08:00
Linus Yang 14fb82b966 Enable plugins on MinGW 2018-03-14 09:58:25 +08:00
Linus Yang 2ed8791dab Re-add support for MinGW 2018-03-08 17:26:11 +08:00
ksqsf 3c3c50b4f8 Search XDG_CONFIG_HOME for user-specific config 2018-02-11 00:30:09 +08:00
Max Lv 85a64ae836 Bump version 2018-01-15 17:25:03 -08:00
星野ハジメ cc1bb4cf62 format with .uncrustify.cfg (#1759)
* format with .uncrustify.cfg

format with .uncrustify.cfg

* format with .uncrustify.cfg

* format with .uncrustify.cfg exclude json.* base64.* uthash.h

* format with .uncrustify.cfg exclude json.* base64.* uthash.h
2017-10-30 21:28:53 +08:00
Xingwang Liao f1fde57111 Redirect 'INFO' log to stdout
Signed-off-by: Xingwang Liao <kuoruan@gmail.com>
2017-08-24 17:48:02 +08:00
Yousong Zhou 7c5416b441 syslog with daemon facility instead of kern (0) 2017-08-01 22:59:38 -07:00
Yousong Zhou db1728c76d decouple use_syslog from pid_flags
Sometimes we need processes to run in the foreground to be supervised
and at the same time use syslog facility instead of logging its stdout,
stderr output
2017-08-01 22:59:38 -07:00
Max Lv b7bb4358e1 Clean up 2017-05-22 17:11:59 +08:00
Mygod 72622a3e3d Use standard __ANDROID__ preprocessor macro 2017-05-17 07:08:41 +08:00
Max Lv d434cd20ec Fix a memory leak 2017-02-17 12:31:22 +08:00
Max Lv 7b290f30d6 Make SO_REUSEPORT disabled by default 2017-02-02 21:05:57 +08:00
anonymous-contributor a3d0f02c3e Use enum number for val of long options (#1155) 2017-02-01 12:53:20 +08:00
Max Lv 4ebe5aeb12 Add SIP004 (AEAD) support 2017-01-29 10:10:44 +08:00
Max Lv 3f8cd982e5 Drop MinGW32 support 2017-01-24 20:10:31 +08:00
Max Lv 96a16f2612 Remove static_assert for clang 2016-12-30 16:14:56 +08:00
Max Lv 79c722cded Add static assert 2016-12-30 15:40:58 +08:00
Max Lv b9e19bfdb7 Remove the hardcode compiler-time endian convert 2016-12-29 16:30:32 +08:00
Max Lv 15dfb6f10d Refine the alignment again 2016-12-29 16:00:50 +08:00
Max Lv 60cdaf98df Use internal BIG_ENDIAN check 2016-12-29 14:32:47 +08:00
Max Lv 8cb4f81eba Add HTTP/TLS obfuscating. [SIP001] (#1009)
Add experimental HTTP/TLS obfuscating as an **optional extension** of shadowsocks protocol.

More discussions can be found here: https://github.com/shadowsocks/shadowsocks-org/issues/26

As this feature is still a SIP (Shadowsocks Improvement Proposal), it's very unstable and experimental. So, 

1. Don't enable it unless you know what it is.
2. Be very careful when using it in production environment.
2016-12-27 02:53:25 -06:00
Max Lv 25cc062e5d Use cork_container_of instead 2016-12-08 15:06:42 +08:00
Max Lv 65843154cf Fix building error 2016-12-08 14:51:14 +08:00
Max Lv a63a33861f Add container_of 2016-12-08 14:48:40 +08:00
Rayson zhu 99a1ece116 Feature: uid support in run_as 2016-11-16 10:45:15 +08:00
rampageX 6e60e17224 Show encryption library used in the help message (#851) 2016-09-27 21:57:43 -05:00
Max Lv b28638ab80 Clean up 2016-09-09 13:17:58 +08:00
Max Lv fd422008b7 Avoid linking issues on Android 2016-06-05 14:45:01 +08:00
Kim 08f873adc7 Roll up year to 2016 2016-04-22 22:50:26 +08:00
Kim b3b522fd5e Fix missing leading space in macro LOGI() 2016-04-22 22:38:51 +08:00
Max Lv 6c2c49ad60 Fix #586 2016-04-17 20:03:36 +08:00
Max Lv 114128668c Refine helper functions 2016-04-16 00:43:27 +08:00
Max Lv b0600a8784 Refine buffer handling 2015-11-30 15:03:04 +08:00