0002-sshsigdie-async-signal-unsafe.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 7f4a743171f9e6b283207d448de6562219774fbf Mon Sep 17 00:00:00 2001
  2. From: Salvatore Bonaccorso <carnil@debian.org>
  3. Date: Tue, 25 Jun 2024 12:24:29 +0100
  4. Subject: Disable async-signal-unsafe code from the sshsigdie() function
  5. Address signal handler race condition: if a client does not authenticate
  6. within LoginGraceTime seconds (120 by default, 600 in old OpenSSH
  7. versions), then sshd's SIGALRM handler is called asynchronously, but
  8. this signal handler calls various functions that are not
  9. async-signal-safe (for example, syslog()).
  10. This is a regression from CVE-2006-5051 ("Signal handler race condition
  11. in OpenSSH before 4.4 allows remote attackers to cause a denial of
  12. service (crash), and possibly execute arbitrary code")
  13. Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
  14. Upstream: https://salsa.debian.org/ssh-team/openssh/-/blob/525bb16e45edac4c03b95e106380d70aecbaf27e/debian/patches/sshsigdie-async-signal-unsafe.patch
  15. Patch-Name: sshsigdie-async-signal-unsafe.patch
  16. ---
  17. log.c | 2 ++
  18. 1 file changed, 2 insertions(+)
  19. diff --git a/log.c b/log.c
  20. index 6a8b1fc4a..57256660f 100644
  21. --- a/log.c
  22. +++ b/log.c
  23. @@ -452,12 +452,14 @@ void
  24. sshsigdie(const char *file, const char *func, int line, int showfunc,
  25. LogLevel level, const char *suffix, const char *fmt, ...)
  26. {
  27. +#if 0
  28. va_list args;
  29. va_start(args, fmt);
  30. sshlogv(file, func, line, showfunc, SYSLOG_LEVEL_FATAL,
  31. suffix, fmt, args);
  32. va_end(args);
  33. +#endif
  34. _exit(1);
  35. }