NetBSD Problem Report #45049

From  Fri Jun 10 21:07:54 2011
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id 7FBDC63B970
	for <>; Fri, 10 Jun 2011 21:07:54 +0000 (UTC)
Message-Id: <>
Date: Fri, 10 Jun 2011 23:07:50 +0200 (CEST)
From: Pierre Pronchery <>
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 <>
>Release:        NetBSD 5.1_STABLE
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
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:

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
debug1: match: OpenSSH_5.0 NetBSD_Secure_Shell-20080403-hpn13v1 pat

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

$ ssh -D 9050

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

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

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:

From: Pierre Pronchery <>
Subject: Re: bin/45049: The HPN patch for OpenSSH breaks on SOCKS proxies
Date: Fri, 10 Jun 2011 23:12:22 +0200

 See also:


From: Richard Hansen <>
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

      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 

NetBSD Home
NetBSD PR Database Search

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