Commit Graph
15 Commits
Author SHA1 Message Date
Stefan Meinecke bb89714216 misc hardening: connection drop, NULL deref, OOB writes, dead option
- shovel(): fd2fd() returns FD_NODATA (-1) when a spurious wakeup
  meets an empty socket (EAGAIN), but the switch treated -1 like
  FD_CNXCLOSED and tore down a healthy connection. Only FD_CNXCLOSED
  closes now.

- decrease_forked_connection(): hash_find() can return NULL (stale
  SIGCHLD after a fork-limit rejection); dereferencing it crashed.
  Guard and log instead.

- hexdump(): sprintf() into a 76-byte stack buffer with a "%06x"
  offset that needs 12 chars once the dump passes 16 MB. Enlarge the
  buffer and bound all writes with snprintf().

- printsettings(): sprintf() of config-supplied host strings into a
  fixed buffer; use snprintf().

- echosrv: recvfrom() into data+prefix_len with size
  sizeof(data)-prefix_len lets the terminating NUL write land one
  byte past the stack buffer (verified with ASan at udp_echo, and a
  >64KB prefix overflows the memcpy). Bound the prefix, reserve one
  byte for the terminator, and skip the echo on recvfrom() error
  instead of writing data[prefix_len-1].

- msg_int_error used verbose_system_error, leaving the documented
  --verbose-int-error option dead. Point it at its own setting.

- Remove "echoѕrv-conf.h" (with Cyrillic ѕ, U+0455): a stale 2020
  sslh-conf.h copy committed under a filename that is visually
  identical to echosrv-conf.h but referenced by nothing.
2026-10-18 22:53:40 +02:00
Yves Rutschle bebc109b94 print_message() restores errno (fix #538) 2026-10-04 11:07:55 +02:00
Yves Rutschle e941e8dd2e fix cppcheck complains 2023-08-31 15:10:53 +02:00
Yves Rutschle d29c9524bd fix unbalance of va_start/va_end 2023-05-13 22:51:04 +02:00
Yves Rutschle 3a1ac6c8d7 add protocol name that was missing in previous commit 2023-01-08 17:45:50 +01:00
Yves Rutschle 9dc3e3ce56 connection loss before it is logged resulted in logging uninitialised characters 2023-01-08 17:31:05 +01:00
Toni Uhlig 61af0b2e09 fix cppcheck complains
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2022-09-11 22:12:33 +02:00
lns f9831df8bc Added support for logging to a file.
* Added ASAN/LSAN/UBSAN support via Makefile
 * Fixed a memory leak

Signed-off-by: lns <matzeton@googlemail.com>
2022-04-28 15:19:18 +02:00
yrutschle 66caf8a31b remove log_message 2021-09-27 12:51:37 +02:00
yrutschle 6ea7d48f86 migrate tls.c and probe.c to new log system 2021-09-26 16:55:31 +02:00
yrutschle e6cbbe9511 migrate common.c to new logging system 2021-09-26 15:53:21 +02:00
yrutschle e5f16b93ce hexdump writes to parametrable msg_info 2021-09-19 21:54:47 +02:00
yrutschle f7b6f669a4 sslh-select to use new log system 2021-09-19 20:24:46 +02:00
yrutschle 5e27806545 new logging system: now with message classes 2021-09-19 15:13:04 +02:00
yrutschle 317c08604b move logging code to its own file 2021-09-15 21:51:11 +02:00