[Bug 3908] New: sshlogdie() overrides the level parameter (essentially converts SYSLOG_LEVEL_ERRROR -> SYSLOG_LEVEL_INFO)

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Dec 31 00:26:38 AEDT 2025


https://bugzilla.mindrot.org/show_bug.cgi?id=3908

            Bug ID: 3908
           Summary: sshlogdie() overrides the level parameter (essentially
                    converts SYSLOG_LEVEL_ERRROR -> SYSLOG_LEVEL_INFO)
           Product: Portable OpenSSH
           Version: 10.2p1
          Hardware: Other
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: m.schmidt at emtec.com

Summary:

The sshlogdie() function has a loglevel parameter, but it calls sshlogv
with a loglevel SYSLOG_LEVEL_INFO always.  sshlogdie() is called in
sshpkt_vfatal() (packet.c) through logdie() macros. These macros always
invoke it with with a SYSLOG_LEVEL_ERROR.

This bug essentially reduces the intended loglevel of these messages
from ERROR to INFO.


Details:

void
sshlogdie(const char *file, const char *func, int line, int showfunc,
    LogLevel level, const char *suffix, const char *fmt, ...)
{
    [...]
    sshlogv(file, func, line, showfunc, SYSLOG_LEVEL_INFO,
        suffix, fmt, args);
    [...]
    cleanup_exit(255);
}


It is called only from sshpkt_vfatal() (in packet.c) via the logdie()
macros (defined in log.h) on the following situations:

packet.c:               logdie("Connection closed by %s", remote_id);
packet.c:               logdie("Connection %s %s timed out",
packet.c:               logdie("Disconnected from %s", remote_id);
packet.c:                       logdie("Connection reset by %s",
remote_id);
packet.c:                       logdie("Unable to negotiate with %s:
%s. "
packet.c:                       logdie_f("could not allocate failure
message");
packet.c:               logdie_r(r, "%s%sConnection %s %s",
packet.c:       logdie_f("should have exited");



The logdie suite of macros (in log.h) invoke sshlogdie with a
SYSLOG_LEVEL_ERRROR, e.g. 

#define logdie(...)     sshlogdie(__FILE__, __func__, __LINE__, 0,
SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)



PS: I hope posting these short source-code snippets here is acceptable.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list