wireguard-go-awg2-lx/device
Leadaxe ee7ff1b77f lx: fix transport padding buffer overrun + harden AWG config guards
Transport padding (s4) crashed the whole process with
"index out of range" in RoutineSequentialSender on the first data
packet: InputPacket/InputPackets sized elem.buffer without headroom
for the in-buffer right-shift that prepends the random prefix.

- send.go: reserve paddings.transport in both injection-path
  allocLength computations; replace the manual backward byte loop
  with an overlap-safe copy; defensively grow the buffer (pool-backed)
  if it still lacks headroom, dropping packets that cannot fit a
  single WG message instead of overrunning.
- receive.go: drop the rxBytes/timers block duplicated by the AWG
  re-graft (rx accounting was doubled, keepKeyFreshReceiving fired
  twice per batch).
- send.go: swap jmin/jmax when configured inverted (UAPI validates
  the fields only individually; a swapped pair panicked rand.Int
  with a non-positive bound on the first handshake).
- obf*.go: bound obfuscator length args to [0, MaxMessageSize]
  (negative panicked slice bounds, huge ones OOMed the handshake).
- magic-header.go: widen to int64 before end-start+1 so a full-range
  header cannot wrap to a zero rand.Int bound.

Tests: transport_padding_test.go reproduces the on-device crash
byte-for-byte (red on the previous commit, green now) across both
injection paths and the tun path; obf_guards_test.go pins the
config-value guards.
2026-08-05 16:55:02 +03:00
..
allowedips.go device: refactor container locking for lock-order clarity 2026-08-04 19:18:01 +08:00
channels.go device: convert runtime.SetFinalizer to AddCleanup (#71) 2026-08-04 19:18:01 +08:00
constants.go Apply Tailscale bind send headroom 2026-05-17 20:36:35 +08:00
cookie.go lx: re-graft AmneziaWG 2.0 obfuscation onto sagernet/wireguard-go v0.0.5 2026-08-05 16:53:12 +03:00
device.go lx: re-graft AmneziaWG 2.0 obfuscation onto sagernet/wireguard-go v0.0.5 2026-08-05 16:53:12 +03:00
devicestate_string.go device: remove deviceStateNew 2021-02-09 15:39:19 +01:00
indextable.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
ip.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
keypair.go Rename module 2026-05-17 20:09:28 +08:00
logger.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
magic-header.go lx: fix transport padding buffer overrun + harden AWG config guards 2026-08-05 16:55:02 +03:00
mobilequirks.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
noise-helpers.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
noise-protocol.go lx: re-graft AmneziaWG 2.0 obfuscation onto sagernet/wireguard-go v0.0.5 2026-08-05 16:53:12 +03:00
noise-types.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
obf.go lx: fix transport padding buffer overrun + harden AWG config guards 2026-08-05 16:55:02 +03:00
obf_bytes.go lx: re-graft AmneziaWG 2.0 obfuscation onto sagernet/wireguard-go v0.0.5 2026-08-05 16:53:12 +03:00
obf_data.go lx: re-graft AmneziaWG 2.0 obfuscation onto sagernet/wireguard-go v0.0.5 2026-08-05 16:53:12 +03:00
obf_datasize.go lx: fix transport padding buffer overrun + harden AWG config guards 2026-08-05 16:55:02 +03:00
obf_datastring.go lx: re-graft AmneziaWG 2.0 obfuscation onto sagernet/wireguard-go v0.0.5 2026-08-05 16:53:12 +03:00
obf_guards_test.go lx: fix transport padding buffer overrun + harden AWG config guards 2026-08-05 16:55:02 +03:00
obf_rand.go lx: fix transport padding buffer overrun + harden AWG config guards 2026-08-05 16:55:02 +03:00
obf_randchars.go lx: fix transport padding buffer overrun + harden AWG config guards 2026-08-05 16:55:02 +03:00
obf_randdigits.go lx: fix transport padding buffer overrun + harden AWG config guards 2026-08-05 16:55:02 +03:00
obf_timestamp.go lx: re-graft AmneziaWG 2.0 obfuscation onto sagernet/wireguard-go v0.0.5 2026-08-05 16:53:12 +03:00
peer.go device: fix TOCTOU race during session state update (#77) 2026-08-04 19:18:01 +08:00
pools.go device: refactor container locking for lock-order clarity 2026-08-04 19:18:01 +08:00
queueconstants_android.go Rename module 2026-05-17 20:09:28 +08:00
queueconstants_default.go Rename module 2026-05-17 20:09:28 +08:00
queueconstants_ios.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
queueconstants_windows.go global: bump copyright notice 2025-05-05 15:05:35 +02:00
receive.go lx: re-graft AmneziaWG 2.0 obfuscation onto sagernet/wireguard-go v0.0.5 2026-08-05 16:53:12 +03:00
send.go lx: fix transport padding buffer overrun + harden AWG config guards 2026-08-05 16:55:02 +03:00
sticky_default.go Rename module 2026-05-17 20:09:28 +08:00
sticky_linux.go Rename module 2026-05-17 20:09:28 +08:00
timers.go device: fix TOCTOU race during session state update (#77) 2026-08-04 19:18:01 +08:00
transport_padding_test.go lx: fix transport padding buffer overrun + harden AWG config guards 2026-08-05 16:55:02 +03:00
tun.go Rename module 2026-05-17 20:09:28 +08:00
uapi.go lx: re-graft AmneziaWG 2.0 obfuscation onto sagernet/wireguard-go v0.0.5 2026-08-05 16:53:12 +03:00