7bccbbd821
- Update to 7.8p1: * no actual changes for the askpass - Format with spec-cleaner - Respect cflags - Use gtk3 rather than gtk2 which is being phased out - Remove the mention of the SLE12 in the README.SUSE - Install firewall rules only when really needed (<SLE15) - Version update to 7.8p1: * For most details see release notes file * ssh-keygen(1): write OpenSSH format private keys by default instead of using OpenSSL's PEM format - Rebase patches to apply on 7.8p1 release: * openssh-7.7p1-fips.patch * openssh-7.7p1-cavstest-kdf.patch * openssh-7.7p1-fips_checks.patch * openssh-7.7p1-gssapi_key_exchange.patch * openssh-7.7p1-audit.patch * openssh-7.7p1-openssl_1.1.0.patch * openssh-7.7p1-ldap.patch * openssh-7.7p1-IPv6_X_forwarding.patch * openssh-7.7p1-sftp_print_diagnostic_messages.patch * openssh-7.7p1-disable_short_DH_parameters.patch * openssh-7.7p1-hostname_changes_when_forwarding_X.patch * openssh-7.7p1-pam_check_locks.patch * openssh-7.7p1-seed-prng.patch * openssh-7.7p1-systemd-notify.patch * openssh-7.7p1-X11_trusted_forwarding.patch - Dropped patches: OBS-URL: https://build.opensuse.org/request/show/642573 OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=153
76 lines
2.2 KiB
Diff
76 lines
2.2 KiB
Diff
# HG changeset patch
|
|
# Parent 2e66b48b2212113d9897a58aaada67557b7c4f35
|
|
block SIGALRM while logging through syslog to prevent deadlocks
|
|
(through grace_alarm_handler())
|
|
|
|
bnc#57354
|
|
|
|
diff --git a/openssh-7.7p1/log.c b/openssh-7.7p1/log.c
|
|
--- openssh-7.7p1/log.c
|
|
+++ openssh-7.7p1/log.c
|
|
@@ -46,16 +46,17 @@
|
|
#include <syslog.h>
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS)
|
|
# include <vis.h>
|
|
#endif
|
|
|
|
#include "log.h"
|
|
+#include <signal.h>
|
|
|
|
static LogLevel log_level = SYSLOG_LEVEL_INFO;
|
|
static int log_on_stderr = 1;
|
|
static int log_stderr_fd = STDERR_FILENO;
|
|
static int log_facility = LOG_AUTH;
|
|
static char *argv0;
|
|
static log_handler_fn *log_handler;
|
|
static void *log_handler_ctx;
|
|
@@ -396,16 +397,17 @@ do_log(LogLevel level, const char *fmt,
|
|
{
|
|
#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
|
|
struct syslog_data sdata = SYSLOG_DATA_INIT;
|
|
#endif
|
|
char msgbuf[MSGBUFSIZ];
|
|
char fmtbuf[MSGBUFSIZ];
|
|
char *txt = NULL;
|
|
int pri = LOG_INFO;
|
|
+ sigset_t nset, oset;
|
|
int saved_errno = errno;
|
|
log_handler_fn *tmp_handler;
|
|
|
|
if (level > log_level)
|
|
return;
|
|
|
|
switch (level) {
|
|
case SYSLOG_LEVEL_FATAL:
|
|
@@ -455,20 +457,28 @@ do_log(LogLevel level, const char *fmt,
|
|
log_handler = NULL;
|
|
tmp_handler(level, fmtbuf, log_handler_ctx);
|
|
log_handler = tmp_handler;
|
|
} else if (log_on_stderr) {
|
|
snprintf(msgbuf, sizeof msgbuf, "%.*s\r\n",
|
|
(int)sizeof msgbuf - 3, fmtbuf);
|
|
(void)write(log_stderr_fd, msgbuf, strlen(msgbuf));
|
|
} else {
|
|
+ /* Prevent a race between the grace_alarm which writes a
|
|
+ * log message and terminates and main sshd code that leads
|
|
+ * to deadlock as syslog is not async safe.
|
|
+ */
|
|
+ sigemptyset(&nset);
|
|
+ sigaddset(&nset, SIGALRM);
|
|
+ sigprocmask(SIG_BLOCK, &nset, &oset);
|
|
#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
|
|
openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata);
|
|
syslog_r(pri, &sdata, "%.500s", fmtbuf);
|
|
closelog_r(&sdata);
|
|
#else
|
|
openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility);
|
|
syslog(pri, "%.500s", fmtbuf);
|
|
closelog();
|
|
#endif
|
|
+ sigprocmask(SIG_SETMASK, &oset, NULL);
|
|
}
|
|
errno = saved_errno;
|
|
}
|