NetBSD Problem Report #45049

From khorben@defora.org  Fri Jun 10 21:07:54 2011
Return-Path: <khorben@defora.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 7FBDC63B970
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 10 Jun 2011 21:07:54 +0000 (UTC)
Message-Id: <20110610210750.99203AC1036@smtp.defora.org>
Date: Fri, 10 Jun 2011 23:07:50 +0200 (CEST)
From: Pierre Pronchery <khorben@defora.org>
Reply-To:
To: gnats-bugs@gnats.NetBSD.org
Subject: The HPN patch for OpenSSH breaks on SOCKS proxies
X-Send-Pr-Version: 3.95

>Number:         45049
>Category:       bin
>Synopsis:       The HPN patch for OpenSSH breaks on SOCKS proxies
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 10 21:10:00 +0000 2011
>Last-Modified:  Fri Oct 07 05:00:03 +0000 2011
>Originator:     Pierre Pronchery <khorben@defora.org>
>Release:        NetBSD 5.1_STABLE
>Organization:
>Environment:
System: NetBSD rst.defora.lan 5.1_STABLE NetBSD 5.1_STABLE (GENERIC) #0: Sun Apr 24 04:27:02 UTC 2011 khorben@kwarx.defora.lan:/home/i386/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
I am currently using OpenSSH over SOCKS proxies, as provided by existing
OpenSSH connections (using the "DynamicForward" mechanism). When using
the default SSH binaries from NetBSD base (on both client and server
side) I am observing difficulties after a few minutes of use with
interactive sessions:
- data is sent properly from the client to the server
- data is received from the server to the client, but never displayed on
  the terminal
- when this occurs, the ssh client forwarding the connection outputs the
  following error: "rcvd too much data"

This behavior has already been reported publicly, like found here in the
Gentoo bug reporting system:
http://bugs.gentoo.org/197182

During the ensueing debugging process, the HPN patch was found to be the
culprit. This patch seems to be applied by default on NetBSD; see
src/crypto/dist/ssh/HPN-README, and the output of "ssh -v" for instance:

Remote protocol version 2.0, remote software version OpenSSH_5.0
NetBSD_Secure_Shell-20080403-hpn13v1
debug1: match: OpenSSH_5.0 NetBSD_Secure_Shell-20080403-hpn13v1 pat
OpenSSH*

Replacing the SSH client used to forward connections over SOCKS with one
built from pkgsrc/security/openssh (without the "hpn-patch" option set)
seems to work-around the problem.

Alternatively, using the SSH client from base with the (undocumented
except in HPN-README) "HPNDisabled=yes" option seems to do the trick
too.

>How-To-Repeat:
first:
$ ssh -D 9050 some.remote.host

then, with pkgsrc's net/tsocks configured:
$ cat /usr/pkg/etc/tsocks.conf
local = 192.168.0.0/255.255.0.0
server = 127.0.0.1
server_type = 5
server_port = 9050
$ tsocks ssh some.other.host

after a while, the connection seems to break, and error messages appear
on the first client (providing the SOCKS proxy).

>Fix:
As mentioned above, the "HPNDisabled" option can be enabled to
workaround the problem.

Unfortunately, the HPN project doesn't seem to have enough resources to
maintain its patch properly:
http://www.psc.edu/networking/projects/hpn-ssh/

>Audit-Trail:
From: Pierre Pronchery <khorben@defora.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/45049: The HPN patch for OpenSSH breaks on SOCKS proxies
Date: Fri, 10 Jun 2011 23:12:22 +0200

 See also:
 http://mail-index.netbsd.org/netbsd-users/2010/06/13/msg006406.html

 Cheers,
 -- 
 khorben

From: Richard Hansen <rhansen@bbn.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/45049: The HPN patch for OpenSSH breaks on SOCKS proxies
Date: Thu, 06 Oct 2011 23:50:52 -0400

 I am also experiencing this bug.

  From the bottom of the HPN web site
 <http://www.psc.edu/networking/projects/hpn-ssh/>:

      Recent problems with buffer_append_space in HPN-SSH.
      If you are experiencing disconnects due to a failure in
      buffer_append_space please let us know.  We're currently tracking
      some problems with this and we're trying to gather more information
      to help resolve it.  You may want to try using
      -oHPNBufferSize=16384 to restrict the growth of the buffer.  Let us
      know if that helps.

 I did try setting HPNBufferSize to 16384 and it did make the problem go 
 away.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.