components/openssh/patches/032-hang_on_closed_output.patch
author Jan Parcel <jan.parcel@oracle.com>
Mon, 25 Jan 2016 10:57:40 -0800
branchs11u3-sru
changeset 5324 5683175b6e99
permissions -rw-r--r--
PSARC/2015/395 OpenSSH 7.1p1 PSARC 2014/390 OpenSSH GSSKEY 21696247 upgrade OpenSSH to 7.1p1 22031540 problem in UTILITY/OPENSSH 22022180 problem in UTILITY/OPENSSH 22048638 problem in UTILITY/OPENSSH 19775805 OpenSSH contains a redundant call to do_pam_setcred() 21379157 OpenSSH shouldn't call setproject(3PROJECT) when configured to use PAM 20919294 upgrade OpenSSH to 6.8p1 19130869 migrate the Xforwarding bug fix (15350344) from SunSSH to OpenSSH 21861322 OpenSSH client hangs on broken pipe 22018764 remove cast128-cbc from OpenSSH 21919790 add GSSKeyEx as an alias to GSSAPIKeyExchange in OpenSSH 19941148 GSS-API Key Exchange for OpenSSH 21643415 OpenSSH should use AI_ADDRCONFIG per bug 19827438 20370803 OpenSSH patch number collision 20711463 OpenSSH wants to be able to login to a role too 22389801 OpenSSH: remove cast from ssh(1), sshd(8), ssh_config(5) and sshd_config(5) 22582153 openssh system/linker should be added to core REQ

#
# Fix possible hang on closed output.
#
# When there is a connectivity problem between the server and the client
# (network outage, server crash or reboot), the client indefinitely hangs.
#
# This patch fixes the issue by checking ssh_packet_write_poll return value
# in ssh_packet_write_wait and passing it through.
#
# The (updated) patch has been accepted upstream and will be part of 7.2
# https://github.com/openssh/openssh-portable/commit/8408218
#
diff -pur old/packet.c new/packet.c
--- old/packet.c
+++ new/packet.c
@@ -2040,7 +2040,8 @@ ssh_packet_write_wait(struct ssh *ssh)
 	    NFDBITS), sizeof(fd_mask));
 	if (setp == NULL)
 		return SSH_ERR_ALLOC_FAIL;
-	ssh_packet_write_poll(ssh);
+	if ((r = ssh_packet_write_poll(ssh)) != 0)
+		return r;
 	while (ssh_packet_have_data_to_write(ssh)) {
 		memset(setp, 0, howmany(state->connection_out + 1,
 		    NFDBITS) * sizeof(fd_mask));