RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1480510 - SSH connections get closed when time-based rekeyring is used and ClientAliveMaxCount=0
Summary: SSH connections get closed when time-based rekeyring is used and ClientAliveM...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openssh
Version: 7.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Jakub Jelen
QA Contact: Stefan Dordevic
URL:
Whiteboard:
Depends On:
Blocks: 1420851 1476743
TreeView+ depends on / blocked
 
Reported: 2017-08-11 09:47 UTC by Renaud Métrich
Modified: 2021-09-09 12:30 UTC (History)
9 users (show)

Fixed In Version: openssh-7.4p1-15.el7
Doc Type: Bug Fix
Doc Text:
Cause: The timeouts throughout the server code were not handled correctly. Consequence: Setting both time-based rekeying (RekeyLimit=default 45s) and client keep-alive (ClientAliveCountMax=0, ClientAliveInterval=900) in sshd resulted in the connection drop after the rekeying timeout. Fix: The code was updated to handle all combinations of timeouts correctly. Result: The rekeying no longer closes connection
Clone Of:
Environment:
Last Closed: 2018-04-10 18:19:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenSSH Project 2757 0 None None None 2019-07-09 14:00:25 UTC
Red Hat Knowledge Base (Solution) 3158191 0 None None None 2018-01-31 10:41:20 UTC
Red Hat Product Errata RHSA-2018:0980 0 None None None 2018-04-10 18:20:29 UTC

Description Renaud Métrich 2017-08-11 09:47:13 UTC
Description of problem:

When configuring time-based rekeyring on the SSHD server (e.g. RekeyLimit=default 45s)and configuring "ClientAliveMaxCount=0" on the SSHD server also, SSH connection gets unexpectedly closed by the SSHD server just before the rekeyring happens.

Version-Release number of selected component (if applicable):

openssh-7.4p1-11.el7.x86_64

How reproducible:

ALWAYS

Steps to Reproduce:
1. Stop the firewall (for convenience)

systemctl stop firewalld


2. Start a SSHD instance with custom rekeyring based on time and ClientAliveMaxCount=0 (requires ClientAliveInterval != 0)

/usr/sbin/sshd -D -ddd -p 8022 -o "ClientAliveCountMax=0" -o "ClientAliveInterval=900" -o "RekeyLimit=default 45s" -e


3. Connect to that SSHD instance and generate some traffic

ssh -p 8022 root@vm-rhel74 "date; while :; do sleep 30; date; done"


Actual results:

Immediately before Rekeyring is performed, connection gets closed with the following messages on the SSHD server:

"
Timeout, client not responding.
debug1: do_cleanup
debug1: PAM: cleanup
debug1: PAM: closing session
debug1: PAM: deleting credentials
debug3: PAM: sshpam_thread_cleanup entering
"


Expected results:

No connection closure.

Additional info:

This doesn't happen with "traffic-limit" rekeyring only (e.g. "RekeyLimit 4M").

Comment 2 Jakub Jelen 2017-08-11 15:02:36 UTC
Yes, that is indeed a bug. The select() returns on timeout, but it is interpreted as a ClientAlive timeout instead of rekey timeout (sigh ... too many timeouts for a single select()).

The same issue is still reproducible with latest OpenSSH 7.5 and also with current master.

The proposed workaround looks reasonable.

I filled a bug upstream [1] with a patch and briefly tested that it solves our problem. I can build a testing package next week.

[1] https://bugzilla.mindrot.org/show_bug.cgi?id=2757

Comment 13 errata-xmlrpc 2018-04-10 18:19:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0980


Note You need to log in before you can comment on or make changes to this bug.