Call for testing: OpenSSH-6.5

81 views
Skip to first unread message

Damien Miller

unread,
Jan 16, 2014, 7:26:47 PM1/16/14
to openssh-...@mindrot.org
Hi,

OpenSSH 6.5 is almost ready for release, so we would appreciate testing
on as many platforms and systems as possible. This release contains
some substantial new features and a number of bugfixes.

Snapshot releases for portable OpenSSH are available from
http://www.mindrot.org/openssh_snap/

The OpenBSD version is available in CVS HEAD:
http://www.openbsd.org/anoncvs.html

Portable OpenSSH is also available via anonymous CVS using the
instructions at http://www.openssh.com/portable.html#cvs or
via Mercurial at http://hg.mindrot.org/openssh

Running the regression tests supplied with Portable OpenSSH does not
require installation and is a simply:

$ ./configure && make tests

Live testing on suitable non-production systems is also
appreciated. Please send reports of success or failure to
openssh-...@mindrot.org.

Below is a summary of changes. More detail may be found in the ChangeLog
in the portable OpenSSH tarballs.

Thanks to the many people who contributed to this release.

Changes since OpenSSH 6.4
=========================

This is a feature-focused release.

New features:

* ssh(1), sshd(8): Add support for key exchange using elliptic-curve
Diffie Hellman in Daniel Bernstein's Curve25519. This key exchange
method is the default when both the client and server support it.

* ssh(1), sshd(8): Add support for Ed25519 as a public key type.
Ed25519 is a elliptic curve signature scheme that offers
better security than ECDSA and DSA and good performance. It may be
used for both user and host keys.

* Add a new private key format that uses a bcrypt KDF to better
protect keys at rest. This format is used unconditionally for
Ed25519 keys, but may be requested when generating or saving
existing keys of other types via the -o ssh-keygen(1) option.
We intend to make the new format the default in the near future.
Details of the new format are in the PROTOCOL.key file.

* ssh(1), sshd(8): Add a new transport cipher
"chacha20...@openssh.com" that combines Daniel Bernstein's
ChaCha20 stream cipher and Poly1305 MAC to build an authenticated
encryption mode. Details are in the PROTOCOL.chacha20poly1305 file.

* ssh(1), sshd(8): Refuse RSA keys from old proprietary clients and
servers that use the obsolete RSA+MD5 signature scheme. It will
still be possible to connect with these clients/servers but only
DSA keys will be accepted, and OpenSSH will refuse connection
entirely in a future release.

* ssh(1), sshd(8): Refuse old proprietary clients and servers that
use a weaker key exchange hash calculation.

* ssh(1): Increase the size of the Diffie-Hellman groups requested
for each symmetric key size. New values from NIST Special
Publication 800-57 with the upper limit specified by RFC4419

* ssh(1), ssh-agent(1): Support pkcs#11 tokes that only provide
X.509 certs instead of raw public keys (requested as bz#1908).

* ssh(1): Add a ssh_config(5) "Match" keyword that allows
conditional configuration to be applied by matching on hostname,
user and result of arbitrary commands.

* ssh(1): Add support for client-side hostname canonicalisation
using a set of DNS suffixes and rules in ssh_config(5). This
allows unqualified names to be canonicalised to fully-qualified
domain names to eliminate ambiguity when looking up keys in
known_hosts or checking host certificate names.

* sftp-server(8): Add the ability to whitelist and/or blacklist sftp
protocol requests by name.

* sftp-server(8): Add a sftp "fs...@openssh.com" to support calling
fsync(2) on an open file handle.

* sshd(8): Add a ssh_config(5) PermitTTY to disallow TTY allocation,
mirroring the longstanding no-pty authorized_keys option.

* ssh(1): Add a ssh_config ProxyUseFDPass option that supports the
use of ProxyCommands that establish a connection and then pass a
connected file descriptor back to ssh(1). This allows the
ProxyCommand to exit rather than staying around to transfer data.

Bugfixes:

* ssh(1), sshd(8): Fix potential stack exhaustion caused by nested
certificates.

* ssh(1): bz#1211: make BindAddress work with UsePrivilegedPort.

* sftp(1): bz#2137: fix the progress meter for resumed transfer.

* ssh-add(1): bz#2187: do not request smartcard PIN when removing
keys from ssh-agent.

* sshd(8): bz#2139: fix re-exec fallback when original sshd binary
cannot be executed.

* ssh-keygen(1): Make relative-specified certificate expiry times
relative to current time and not the validity start time.

* sshd(8): bz#2161: fix AuthorizedKeysCommand inside a Match block.

* sftp(1): bz#2129: symlinking a file would incorrectly canonicalise
the target path.

* ssh-agent(1): bz#2175: fix a use-after-free in the PKCS#11 agent
helper executable.

* sshd(8): Improve logging of sessions to include the user name,
remote host and port, the session type (shell, command, etc.) and
allocated TTY (if any).

* sshd(8): bz#1297: tell the client (via a debug message) when
their preferred listen address has been overridden by the
server's GatewayPorts setting.

* sshd(8): bz#2162: include report port in bad protocol banner
message.

* sftp(1): bz#2163: fix memory leak in error path in do_readdir()

* sftp(1): bz#2171: don't leak file descriptor on error.

* sshd(8): Include the local address and port in "Connection from
..." message (only shown at loglevel>=verbose)

Portable OpenSSH:

* Switch to a ChaCha20-based arc4random() PRNG for platforms that do
not provide their own.

* sshd(8): bz#2156: restore Linux oom_adj setting when handling
SIGHUP to maintain behaviour over retart.

* sshd(8): bz#2032: use local username in krb5_kuserok check rather
than full client name which may be of form user@REALM.

* ssh(1), sshd(8): Test for both the presence of ECC NID numbers in
OpenSSL and that they actually work. Fedora (at least) has
NID_secp521r1 that doesn't work.

* bz#2173: use pkg-config --libs to include correct -L location for
libedit.

Reporting Bugs:
===============

- Please read http://www.openssh.com/report.html
Security bugs should be reported directly to ope...@openssh.com

OpenSSH is brought to you by Markus Friedl, Niels Provos, Theo de Raadt,
Kevin Steves, Damien Miller, Darren Tucker, Jason McIntyre, Tim Rice and
Ben Lindstrom.

_______________________________________________
openssh-unix-dev mailing list
openssh-...@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

Darren Tucker

unread,
Jan 17, 2014, 3:26:54 AM1/17/14
to Damien Miller, OpenSSH Devel List
Here's a potential problem (freebsd4 but probably other older platforms):

monitor_mm.c: In function `mm_make_entry':
monitor_mm.c:78: warning: unknown conversion type character `z' in format

All instances I've seen so far have been calls to fatal(), and that
does through snprintf. We should probably check for that and if found
use the snprintf in the compat library.

haven't had a chance to look into it yet but posting in case someone
else sees this.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Gert Doering

unread,
Jan 17, 2014, 7:42:14 AM1/17/14
to Damien Miller, openssh-...@mindrot.org
Hi,

On Fri, Jan 17, 2014 at 11:26:47AM +1100, Damien Miller wrote:
> OpenSSH 6.5 is almost ready for release, so we would appreciate testing
> on as many platforms and systems as possible. This release contains
> some substantial new features and a number of bugfixes.
[..]

Tested the snapshot of today on NetBSD 5.1_STABLE/sparc64.

Took an eternity and a bit :-) - but everything passed:

...
key revocation lists: checking revocations for unrevoked certs
ok key revocation lists
all tests passed

gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany ge...@greenie.muc.de
fax: +49-89-35655025 ge...@net.informatik.tu-muenchen.de

Damien Miller

unread,
Jan 17, 2014, 7:49:31 AM1/17/14
to Gert Doering, openssh-...@mindrot.org
On Fri, 17 Jan 2014, Gert Doering wrote:

> Hi,
>
> On Fri, Jan 17, 2014 at 11:26:47AM +1100, Damien Miller wrote:
> > OpenSSH 6.5 is almost ready for release, so we would appreciate testing
> > on as many platforms and systems as possible. This release contains
> > some substantial new features and a number of bugfixes.
> [..]
>
> Tested the snapshot of today on NetBSD 5.1_STABLE/sparc64.
>
> Took an eternity and a bit :-) - but everything passed:

Yes, the tests are a little slower now - we are testing more KEX, key
and cipher combinations, and doing it a little more exhaustively

Thanks!

-d

Gert Doering

unread,
Jan 17, 2014, 8:12:40 AM1/17/14
to Damien Miller, Gert Doering, openssh-...@mindrot.org
Hi,

On Fri, Jan 17, 2014 at 11:49:31PM +1100, Damien Miller wrote:
> > Took an eternity and a bit :-) - but everything passed:
>
> Yes, the tests are a little slower now - we are testing more KEX, key
> and cipher combinations, and doing it a little more exhaustively

I'm all for testing every possible combination of stuff :-) - running
the full test on this box took about 4 hours, but if it saves a single
debugging session of "why does it fail for cipher X on platform Y"
later on, it's all worth it...

gert

--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany ge...@greenie.muc.de
fax: +49-89-35655025 ge...@net.informatik.tu-muenchen.de

Darren Tucker

unread,
Jan 17, 2014, 8:27:41 AM1/17/14
to Gert Doering, Damien Miller, OpenSSH Devel List
On Sat, Jan 18, 2014 at 12:12 AM, Gert Doering <ge...@greenie.muc.de> wrote:
[...]
> I'm all for testing every possible combination of stuff :-) - running
> the full test on this box took about 4 hours, but if it saves a single
> debugging session of "why does it fail for cipher X on platform Y"
> later on, it's all worth it...

It does. In the case of failure there should be a set of failed-*.log
files containing both client and server side debug logs. It's not
perfect, but it's a lot better than it used to be.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Darren Tucker

unread,
Jan 17, 2014, 8:55:13 AM1/17/14
to Damien Miller, OpenSSH Devel List
build failure on netbsd4 with gssapi enabled while linking sshd:

gss-serv-krb5.o: In function `ssh_gssapi_krb5_storecreds´:
gss-serv-krb5.c:135: undefined reference to `krb5_cc_new_unique´

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Corinna Vinschen

unread,
Jan 17, 2014, 12:00:48 PM1/17/14
to openssh-...@mindrot.org
On Jan 17 11:26, Damien Miller wrote:
> Hi,
>
> OpenSSH 6.5 is almost ready for release, so we would appreciate testing
> on as many platforms and systems as possible. This release contains
> some substantial new features and a number of bugfixes.

I pulled from CVS HEAD. Builds out of the box on Cygwin (baring the
-Werror issues, of course). All tests pass.


Corinna

--
Corinna Vinschen
Cygwin Maintainer
Red Hat

Iain Morgan

unread,
Jan 17, 2014, 5:14:52 PM1/17/14
to Damien Miller, openssh-...@mindrot.org
On Fri, Jan 17, 2014 at 11:26:47 +1100, Damien Miller wrote:
> Hi,
>
> OpenSSH 6.5 is almost ready for release, so we would appreciate testing
> on as many platforms and systems as possible. This release contains
> some substantial new features and a number of bugfixes.
>

The 20140118 snapshot builds and passes all tests on:

RHEL 6.5/amd64
SLES 11sp1/amd64
Mac OS X 10.8.5

For completeness, the following warnings were reported on RHEL and SLES:

readpassphrase.c:127: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
readpassphrase.c:146: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
log.c:448: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
ssh.c:1183: warning: ignoring return value of ‘daemon’, declared with attribute warn_unused_result
serverloop.c:151: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
ssh-agent.c:1211: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result
scp.c:1341: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
sftp.c:234: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
sftp-client.c:1262: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result

The list is _much_ longer on OS X; about 750 warnings. However, most of
these appear to be related to OpenSSL and are probably related to having to
use --without-openssl-header-check.

--
Iain Morgan

Damien Miller

unread,
Jan 17, 2014, 5:30:24 PM1/17/14
to Darren Tucker, OpenSSH Devel List
On Sat, 18 Jan 2014, Darren Tucker wrote:

> build failure on netbsd4 with gssapi enabled while linking sshd:
>
> gss-serv-krb5.o: In function `ssh_gssapi_krb5_storecreds?:
> gss-serv-krb5.c:135: undefined reference to `krb5_cc_new_unique?

hmm, that line has been there for a while. No obvious changes to
krb5 detection in configure.ac either...

Kevin Brott

unread,
Jan 18, 2014, 7:29:21 PM1/18/14
to Damien Miller, openssh-...@mindrot.org
On 2014-01-16 16:26, Damien Miller wrote:
> Hi,
>
> OpenSSH 6.5 is almost ready for release, so we would appreciate testing
> on as many platforms and systems as possible. This release contains
> some substantial new features and a number of bugfixes.
>
> Snapshot releases for portable OpenSSH are available from
> http://www.mindrot.org/openssh_snap/
>
> The OpenBSD version is available in CVS HEAD:
> http://www.openbsd.org/anoncvs.html
>
> Portable OpenSSH is also available via anonymous CVS using the
> instructions at http://www.openssh.com/portable.html#cvs or
> via Mercurial at http://hg.mindrot.org/openssh
>
> Running the regression tests supplied with Portable OpenSSH does not
> require installation and is a simply:
>
> $ ./configure && make tests
>
>

Using openssh-SNAP-20140119.tar.gz:
Debian GNU/Linux 7.3 (wheezy) x86_64, gcc (Debian 4.7.2-5) , and OpenSSL 1.0.1e 11 - all tests passed

Full test suite (RHEL/AIX/HP-UX/maybe Solaris) will get cranked up in the lab at work come Monday. :)

Mauricio Tavares

unread,
Jan 19, 2014, 2:49:56 AM1/19/14
to openssh-...@mindrot.org
On Sat, Jan 18, 2014 at 7:29 PM, Kevin Brott <kevin...@gmail.com> wrote:
> On 2014-01-16 16:26, Damien Miller wrote:
>>
>> Hi,
>>
>> OpenSSH 6.5 is almost ready for release, so we would appreciate testing
>> on as many platforms and systems as possible. This release contains
>> some substantial new features and a number of bugfixes.
>>
>> Snapshot releases for portable OpenSSH are available from
>> http://www.mindrot.org/openssh_snap/
>>
>> The OpenBSD version is available in CVS HEAD:
>> http://www.openbsd.org/anoncvs.html
>>
>> Portable OpenSSH is also available via anonymous CVS using the
>> instructions at http://www.openssh.com/portable.html#cvs or
>> via Mercurial at http://hg.mindrot.org/openssh
>>
>> Running the regression tests supplied with Portable OpenSSH does not
>> require installation and is a simply:
>>
>> $ ./configure && make tests
>>
>>
>
> Using openssh-SNAP-20140119.tar.gz:
> Debian GNU/Linux 7.3 (wheezy) x86_64, gcc (Debian 4.7.2-5) , and OpenSSL
> 1.0.1e 11 - all tests passed
>
> Full test suite (RHEL/AIX/HP-UX/maybe Solaris) will get cranked up in the
> lab at work come Monday. :)
>
Ran 20140119 snapshot tests on Ubuntu 12.04.4 LTS x64; had to
create /var/empty but after that all test passed. Also compiled and
ran the same tests on CentOS 6.5 x64. And got the following:

[...]
certified host keys: host rsa connect wrong cert
certified host keys: host dsa connect wrong cert
certified host keys: host rsa connect wrong cert
certified host keys: host dsa connect wrong cert
failed certified host keys
make[1]: *** [t-exec] Error 1
make[1]: Leaving directory `/home/raub/dev/openssh/regress'
make: *** [tests] Error 2
[raub@devcentos openssh]$

Anything I should worry about? Or are they related to openssl/something else?

Damien Miller

unread,
Jan 19, 2014, 5:50:29 AM1/19/14
to Mauricio Tavares, openssh-...@mindrot.org
On Sun, 19 Jan 2014, Mauricio Tavares wrote:

> Ran 20140119 snapshot tests on Ubuntu 12.04.4 LTS x64; had to
> create /var/empty but after that all test passed. Also compiled and
> ran the same tests on CentOS 6.5 x64. And got the following:
>
> [...]
> certified host keys: host rsa connect wrong cert
> certified host keys: host dsa connect wrong cert
> certified host keys: host rsa connect wrong cert
> certified host keys: host dsa connect wrong cert
> failed certified host keys
> make[1]: *** [t-exec] Error 1
> make[1]: Leaving directory `/home/raub/dev/openssh/regress'
> make: *** [tests] Error 2
> [raub@devcentos openssh]$
>
> Anything I should worry about? Or are they related to
> openssl/something else?

Those lines don't contain the actual error message. There should be a
failed-regress.log in the regress/ directory that shows the full test
log and failure. The one of failed-ssh.log and failed-sshd.log files
might also contain some clues.

-d

Loganaden Velvindron

unread,
Jan 19, 2014, 9:46:28 AM1/19/14
to Damien Miller, openssh-...@mindrot.org
On Sun, Jan 19, 2014 at 2:50 PM, Damien Miller <d...@mindrot.org> wrote:
> On Sun, 19 Jan 2014, Mauricio Tavares wrote:
>
>> Ran 20140119 snapshot tests on Ubuntu 12.04.4 LTS x64; had to
>> create /var/empty but after that all test passed. Also compiled and
>> ran the same tests on CentOS 6.5 x64. And got the following:
>>
>> [...]
>> certified host keys: host rsa connect wrong cert
>> certified host keys: host dsa connect wrong cert
>> certified host keys: host rsa connect wrong cert
>> certified host keys: host dsa connect wrong cert
>> failed certified host keys
>> make[1]: *** [t-exec] Error 1
>> make[1]: Leaving directory `/home/raub/dev/openssh/regress'
>> make: *** [tests] Error 2
>> [raub@devcentos openssh]$
>>
>> Anything I should worry about? Or are they related to
>> openssl/something else?
>
> Those lines don't contain the actual error message. There should be a
> failed-regress.log in the regress/ directory that shows the full test
> log and failure. The one of failed-ssh.log and failed-sshd.log files
> might also contain some clues.

I was looking at the new digest API and something caught my attention.

struct ssh_digest_ctx *
ssh_digest_start(int alg) {
const struct ssh_digest *digest = ssh_digest_by_alg(alg);
struct ssh_digest_ctx *ret;

if (digest == NULL || ((ret = calloc(1, sizeof(*ret))) == NULL))
return NULL;
ret->alg = alg;
EVP_MD_CTX_init(&ret->mdctx);
if (EVP_DigestInit_ex(&ret->mdctx, digest->mdfunc(), NULL) != 1) {
free(ret);
return NULL;
}
return ret;
}
ret is calloc()'ed.

int
ssh_digest_memory(int alg, const void *m, size_t mlen, u_char *d, size_t dlen)
{
struct ssh_digest_ctx *ctx = ssh_digest_start(alg);

if (ctx == NULL)
return -1;
if (ssh_digest_update(ctx, m, mlen) != 0 ||
ssh_digest_final(ctx, d, dlen) != 0)
return -1;
ssh_digest_free(ctx);
return 0;
}

ssh_digest_memory() it calls ssh_digest_free(ctx);

void
ssh_digest_free(struct ssh_digest_ctx *ctx)
{
EVP_MD_CTX_cleanup(&ctx->mdctx);
memset(ctx, 0, sizeof(*ctx));

}
shouldn't there be a call to free(ctx); in ssh_digest_free() before returning ?



>
> -d
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-...@mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



--
This message is strictly personal and the opinions expressed do not
represent those of my employers, either past or present.

Darren Tucker

unread,
Jan 19, 2014, 8:51:23 PM1/19/14
to Damien Miller, OpenSSH Devel List
On Sat, Jan 18, 2014 at 9:30 AM, Damien Miller <d...@mindrot.org> wrote:
> On Sat, 18 Jan 2014, Darren Tucker wrote:
>
>> build failure on netbsd4 with gssapi enabled while linking sshd:
>>
>> gss-serv-krb5.o: In function `ssh_gssapi_krb5_storecreds?:
>> gss-serv-krb5.c:135: undefined reference to `krb5_cc_new_unique?
>
> hmm, that line has been there for a while. No obvious changes to
> krb5 detection in configure.ac either...

It came in with this change:

revision 1.18
date: 2013/07/20 03:35:45; author: djm; state: Exp; lines: +25 -19
- d...@cvs.openbsd.org 2013/07/20 01:55:13
[auth-krb5.c gss-serv-krb5.c gss-serv.c]
fix kerberos/GSSAPI deprecation warnings and linking; "looks okay" millert@

- if ((problem = krb5_cc_gen_new(krb_context, &krb5_fcc_ops, &ccache))) {
- logit("krb5_cc_gen_new(): %.100s",
- krb5_get_err_text(krb_context, problem));
+ if ((problem = krb5_cc_new_unique(krb_context, krb5_fcc_ops.prefix,
+ NULL, &ccache)) != 0) {
+ errmsg = krb5_get_error_message(krb_context, problem);
+ logit("krb5_cc_new_unique(): %.100s", errmsg);
+ krb5_free_error_message(krb_context, errmsg);
return;
}
[other stuff omitted]

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Darren Tucker

unread,
Jan 19, 2014, 9:02:30 PM1/19/14
to Damien Miller, OpenSSH Devel List
On Sat, Jan 18, 2014 at 09:30:24AM +1100, Damien Miller wrote:
> On Sat, 18 Jan 2014, Darren Tucker wrote:
>
> > build failure on netbsd4 with gssapi enabled while linking sshd:
> >
> > gss-serv-krb5.o: In function `ssh_gssapi_krb5_storecreds?:
> > gss-serv-krb5.c:135: undefined reference to `krb5_cc_new_unique?
>
> hmm, that line has been there for a while. No obvious changes to
> krb5 detection in configure.ac either...

Turns out we already detect this in configure and handle it in
auth-krb5.c. ok?

Index: gss-serv-krb5.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/gss-serv-krb5.c,v
retrieving revision 1.18
diff -u -p -r1.18 gss-serv-krb5.c
--- gss-serv-krb5.c 20 Jul 2013 03:35:45 -0000 1.18
+++ gss-serv-krb5.c 20 Jan 2014 01:58:33 -0000
@@ -132,10 +132,16 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_cl
return;

#ifdef HEIMDAL
+# ifdef HAVE_KRB5_CC_NEW_UNIQUE
if ((problem = krb5_cc_new_unique(krb_context, krb5_fcc_ops.prefix,
NULL, &ccache)) != 0) {
errmsg = krb5_get_error_message(krb_context, problem);
logit("krb5_cc_new_unique(): %.100s", errmsg);
+# else
+ if ((problem = krb5_cc_gen_new(krb_context, &krb5_fcc_ops, &ccache))) {
+ logit("krb5_cc_gen_new(): %.100s",
+ krb5_get_err_text(krb_context, problem));
+# endif
krb5_free_error_message(krb_context, errmsg);
return;
}

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Damien Miller

unread,
Jan 19, 2014, 9:34:56 PM1/19/14
to Darren Tucker, OpenSSH Devel List
On Mon, 20 Jan 2014, Darren Tucker wrote:

> On Sat, Jan 18, 2014 at 9:30 AM, Damien Miller <d...@mindrot.org> wrote:
> > On Sat, 18 Jan 2014, Darren Tucker wrote:
> >
> >> build failure on netbsd4 with gssapi enabled while linking sshd:
> >>
> >> gss-serv-krb5.o: In function `ssh_gssapi_krb5_storecreds?:
> >> gss-serv-krb5.c:135: undefined reference to `krb5_cc_new_unique?
> >
> > hmm, that line has been there for a while. No obvious changes to
> > krb5 detection in configure.ac either...
>
> It came in with this change:

ah, I'd only looked back at the previous release.

Looks like we already have #ifdefs around it in auth-krb5.c:

# ifdef HAVE_KRB5_CC_NEW_UNIQUE
problem = krb5_cc_new_unique(authctxt->krb5_ctx,
krb5_mcc_ops.prefix, NULL, &ccache);
# else
problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_mcc_ops, &ccache);
# endif

Damien Miller

unread,
Jan 19, 2014, 11:00:27 PM1/19/14
to Darren Tucker, OpenSSH Devel List
ok djm

Andy Tsouladze

unread,
Jan 19, 2014, 11:48:30 PM1/19/14
to OpenSSH Devel List
Snapshot openssh-SNAP-20140121.tar.gz builds and passes all tests on
Slackware-14.0, 64-bit.

Regards,

Andy

Dr Andy Tsouladze
Sr Unix/Storage/Security SysAdmin
PWD=`cat /dev/urandom | sed 's/[^\x21-\x7f]//g' | head -c 14`

Darren Tucker

unread,
Jan 20, 2014, 12:49:19 AM1/20/14
to Damien Miller, openssh-...@mindrot.org, Mauricio Tavares
On Sun, Jan 19, 2014 at 9:50 PM, Damien Miller <d...@mindrot.org> wrote:
[...]
> Those lines don't contain the actual error message. There should be a
> failed-regress.log in the regress/ directory that shows the full test
> log and failure. The one of failed-ssh.log and failed-sshd.log files
> might also contain some clues.

run test cert-hostkey.sh ...
certified host keys: sign host rsa cert
certified host keys: sign host rsa_v00 cert
certified host keys: sign host dsa cert
certified host keys: sign host dsa_v00 cert
certified host keys: sign host ed25519 cert
certified host keys: sign host ecdsa-sha2-nistp256 cert
certified host keys: sign host ecdsa-sha2-nistp384 cert
certified host keys: host rsa cert connect privsep yes
certified host keys: host dsa cert connect privsep yes
certified host keys: host ed25519 cert connect privsep yes
certified host keys: host ecdsa-sha2-nistp256 cert connect privsep yes
certified host keys: host ecdsa-sha2-nistp384 cert connect privsep yes
certified host keys: host rsa_v00 cert connect privsep yes
certified host keys: host dsa_v00 cert connect privsep yes
certified host keys: host rsa cert connect privsep no
certified host keys: host dsa cert connect privsep no
certified host keys: host ed25519 cert connect privsep no
certified host keys: host ecdsa-sha2-nistp256 cert connect privsep no
certified host keys: host ecdsa-sha2-nistp384 cert connect privsep no
certified host keys: host rsa_v00 cert connect privsep no
certified host keys: host dsa_v00 cert connect privsep no
cat: /root/openssh/regress/cert_host_key_ecdsa-sha2-nistp521.pub: No
such file or directory
certified host keys: host rsa revoked cert privsep yes
certified host keys: host dsa revoked cert privsep yes
certified host keys: host ed25519 revoked cert privsep yes
ssh cert connect succeeded unexpectedly
certified host keys: host ecdsa-sha2-nistp256 revoked cert privsep yes
certified host keys: host ecdsa-sha2-nistp384 revoked cert privsep yes
certified host keys: host rsa_v00 revoked cert privsep yes
certified host keys: host dsa_v00 revoked cert privsep yes
certified host keys: host rsa revoked cert privsep no
certified host keys: host dsa revoked cert privsep no
certified host keys: host ed25519 revoked cert privsep no
ssh cert connect succeeded unexpectedly
certified host keys: host ecdsa-sha2-nistp256 revoked cert privsep no
certified host keys: host ecdsa-sha2-nistp384 revoked cert privsep no
certified host keys: host rsa_v00 revoked cert privsep no
certified host keys: host dsa_v00 revoked cert privsep no
certified host keys: host rsa revoked cert
certified host keys: host dsa revoked cert
certified host keys: host ed25519 revoked cert
certified host keys: host ecdsa-sha2-nistp256 revoked cert
certified host keys: host ecdsa-sha2-nistp384 revoked cert
certified host keys: host rsa_v00 revoked cert
certified host keys: host dsa_v00 revoked cert
certified host keys: host cert connect user-certificate rsa expect failure
certified host keys: host cert connect user-certificate rsa_v00 expect failure
certified host keys: host cert connect empty principals rsa expect success
certified host keys: host cert connect empty principals rsa_v00 expect success
certified host keys: host cert connect wrong principals rsa expect failure
certified host keys: host cert connect wrong principals rsa_v00 expect failure
certified host keys: host cert connect cert not yet valid rsa expect failure
certified host keys: host cert connect cert not yet valid rsa_v00 expect failure
certified host keys: host cert connect cert expired rsa expect failure
certified host keys: host cert connect cert expired rsa_v00 expect failure
certified host keys: host cert connect cert valid interval rsa expect success
certified host keys: host cert connect cert valid interval rsa_v00
expect success
certified host keys: host cert connect cert has constraints rsa expect failure
certified host keys: host cert connect cert has constraints rsa_v00
expect failure
certified host keys: host rsa v01 cert downgrade to raw key
certified host keys: host dsa v01 cert downgrade to raw key
certified host keys: host rsa v00 cert downgrade to raw key
certified host keys: host dsa v00 cert downgrade to raw key
certified host keys: host rsa connect wrong cert
certified host keys: host dsa connect wrong cert
certified host keys: host rsa connect wrong cert
certified host keys: host dsa connect wrong cert
failed certified host keys
make[1]: *** [t-exec] Error 1
make[1]: Leaving directory `/root/openssh/regress'
make: *** [tests] Error 2

I suspect that is is at least partly related to the fact that redhat
don't implement NID_secp521r1
(https://bugzilla.redhat.com/show_bug.cgi?id=1019256)

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Damien Miller

unread,
Jan 20, 2014, 1:01:20 AM1/20/14
to Darren Tucker, openssh-...@mindrot.org, Mauricio Tavares
On Mon, 20 Jan 2014, Darren Tucker wrote:

> cat: /root/openssh/regress/cert_host_key_ecdsa-sha2-nistp521.pub: No
> such file or directory
> certified host keys: host rsa revoked cert privsep yes
> certified host keys: host dsa revoked cert privsep yes
> certified host keys: host ed25519 revoked cert privsep yes
> ssh cert connect succeeded unexpectedly

Does this help? (my centos 6.5 is still installing)

Index: regress/cert-hostkey.sh
===================================================================
RCS file: /var/cvs/openssh/regress/cert-hostkey.sh,v
retrieving revision 1.15
diff -u -p -r1.15 cert-hostkey.sh
--- regress/cert-hostkey.sh 7 Dec 2013 06:07:16 -0000 1.15
+++ regress/cert-hostkey.sh 20 Jan 2014 06:00:39 -0000
@@ -72,32 +72,10 @@ done
printf '@cert-authority '
printf "$HOSTS "
cat $OBJ/host_ca_key.pub
- printf '@revoked '
- printf "* "
- cat $OBJ/cert_host_key_rsa.pub
- if test "x$TEST_SSH_ECC" = "xyes"; then
- printf '@revoked '
- printf "* "
- cat $OBJ/cert_host_key_ecdsa-sha2-nistp256.pub
- printf '@revoked '
- printf "* "
- cat $OBJ/cert_host_key_ecdsa-sha2-nistp384.pub
- printf '@revoked '
- printf "* "
- cat $OBJ/cert_host_key_ecdsa-sha2-nistp521.pub
- fi
- printf '@revoked '
- printf "* "
- cat $OBJ/cert_host_key_ed25519.pub
- printf '@revoked '
- printf "* "
- cat $OBJ/cert_host_key_dsa.pub
- printf '@revoked '
- printf "* "
- cat $OBJ/cert_host_key_rsa_v00.pub
- printf '@revoked '
- printf "* "
- cat $OBJ/cert_host_key_dsa_v00.pub
+ for ktype in $PLAIN_TYPES rsa_v00 dsa_v00; do
+ test -f "$OBJ/cert_host_key_${ktype}.pub" || fatal "no pubkey"
+ printf "@revoked * `cat $OBJ/cert_host_key_${ktype}.pub`\n"
+ done
) > $OBJ/known_hosts-cert
for privsep in yes no ; do
for ktype in $PLAIN_TYPES rsa_v00 dsa_v00; do

Kevin Brott

unread,
Jan 21, 2014, 7:51:38 PM1/21/14
to Damien Miller, openssh-...@mindrot.org
On-call this week so it's going slow - but felt I should report on the
build failure I found:

Using http://www.mindrot.org/openssh_snap/openssh-SNAP-20140122.tar.gz

OS Build_Target CC
OpenSSL BUILD TEST
============== =========================== ================
============ ===== =================
RHEL 2.1 i686-pc-linux-gnu gcc 2.96-129.7.2
0.9.6b-eng OK all tests passed
RHEL 3 TU4 i686-pc-linux-gnu gcc 3.2.3-47
0.9.7a FAIL*2
Fedora Core r2 i686-pc-linux-gnu gcc 3.3.3-7
0.9.7a OK*1 all tests passed
RHEL 4.0 nu8 i686-pc-linux-gnu gcc 3.4.6-11
0.9.7a OK*1 all tests passed
RHEL 4.0 nu8 x86_64-unknown-linux-gnu gcc 3.4.6-11
0.9.7a OK*1 all tests passed

# RHL Red Hat Linux
# RHEL Red Hat Enterprise Linux

# *1 --without-zlib-version-check
# *2 build failure:
gcc -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare
-Wformat-security -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv
-fno-builtin-memset -std=gnu99 -fPIE -I. -I.. -I. -I./.. -DHAVE_CONFIG_H
-c setproctitle.c
setproctitle.c: In function `compat_init_setproctitle':
setproctitle.c:99: warning: implicit declaration of function `strlen'
setproctitle.c:107: `argv_start' undeclared (first use in this function)
setproctitle.c:107: (Each undeclared identifier is reported only once
setproctitle.c:107: for each function it appears in.)
setproctitle.c:108: `argv_env_len' undeclared (first use in this function)
setproctitle.c:115: warning: implicit declaration of function `strdup'
setproctitle.c:115: warning: assignment makes pointer from integer
without a cast
make[1]: *** [setproctitle.o] Error 1
make[1]: Leaving directory `/usr/src/openssh/openbsd-compat'
make: *** [openbsd-compat/libopenbsd-compat.a] Error 2
##
## OPENSSH 6.4p1 builds/tests fine
##




On Sat, Jan 18, 2014 at 4:29 PM, Kevin Brott <kevin...@gmail.com> wrote:

> On 2014-01-16 16:26, Damien Miller wrote:
>
>> Hi,
>>
>> OpenSSH 6.5 is almost ready for release, so we would appreciate testing
>> on as many platforms and systems as possible. This release contains
>> some substantial new features and a number of bugfixes.
>>
>> Snapshot releases for portable OpenSSH are available from
>> http://www.mindrot.org/openssh_snap/
>>
>> The OpenBSD version is available in CVS HEAD:
>> http://www.openbsd.org/anoncvs.html
>>
>> Portable OpenSSH is also available via anonymous CVS using the
>> instructions at http://www.openssh.com/portable.html#cvs or
>> via Mercurial at http://hg.mindrot.org/openssh
>>
>> Running the regression tests supplied with Portable OpenSSH does not
>> require installation and is a simply:
>>
>> $ ./configure && make tests
>>
>>
>>
> Using openssh-SNAP-20140119.tar.gz:
> Debian GNU/Linux 7.3 (wheezy) x86_64, gcc (Debian 4.7.2-5) , and OpenSSL
> 1.0.1e 11 - all tests passed
>
> Full test suite (RHEL/AIX/HP-UX/maybe Solaris) will get cranked up in the
> lab at work come Monday. :)
>
>
>
>
>


--
# include <stddisclaimer.h>
/* Kevin Brott <Kevin...@gmail.com> */

Damien Miller

unread,
Jan 21, 2014, 8:10:28 PM1/21/14
to Kevin Brott, openssh-...@mindrot.org
On Tue, 21 Jan 2014, Kevin Brott wrote:

> On-call this week so it's going slow - but felt I should report on the build
> failure I found:

thanks again for testing.

> gcc -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare
> -Wformat-security -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv
> -fno-builtin-memset -std=gnu99 -fPIE -I. -I.. -I. -I./.. -DHAVE_CONFIG_H
> -c setproctitle.c
> setproctitle.c: In function `compat_init_setproctitle':
> setproctitle.c:99: warning: implicit declaration of function `strlen'
> setproctitle.c:107: `argv_start' undeclared (first use in this function)
> setproctitle.c:107: (Each undeclared identifier is reported only once
> setproctitle.c:107: for each function it appears in.)
> setproctitle.c:108: `argv_env_len' undeclared (first use in this function)
> setproctitle.c:115: warning: implicit declaration of function `strdup'
> setproctitle.c:115: warning: assignment makes pointer from integer without
> a cast
> make[1]: *** [setproctitle.o] Error 1
> make[1]: Leaving directory `/usr/src/openssh/openbsd-compat'
> make: *** [openbsd-compat/libopenbsd-compat.a] Error 2

Could you send the output of "grep SPT_ config.h" for this one?

Thanks,
Damien

Mauricio Tavares

unread,
Jan 22, 2014, 12:21:03 AM1/22/14
to openssh-...@mindrot.org
On Sun, Jan 19, 2014 at 5:50 AM, Damien Miller <d...@mindrot.org> wrote:
> On Sun, 19 Jan 2014, Mauricio Tavares wrote:
>
>> Ran 20140119 snapshot tests on Ubuntu 12.04.4 LTS x64; had to
>> create /var/empty but after that all test passed. Also compiled and
>> ran the same tests on CentOS 6.5 x64. And got the following:
>>
>> [...]
>> certified host keys: host rsa connect wrong cert
>> certified host keys: host dsa connect wrong cert
>> certified host keys: host rsa connect wrong cert
>> certified host keys: host dsa connect wrong cert
>> failed certified host keys
>> make[1]: *** [t-exec] Error 1
>> make[1]: Leaving directory `/home/raub/dev/openssh/regress'
>> make: *** [tests] Error 2
>> [raub@devcentos openssh]$
>>
>> Anything I should worry about? Or are they related to
>> openssl/something else?
>
> Those lines don't contain the actual error message. There should be a
> failed-regress.log in the regress/ directory that shows the full test
> log and failure. The one of failed-ssh.log and failed-sshd.log files
> might also contain some clues.
>
> -d

Oops! Shame on me! So, this is what I am getting in the
failed-regress file:

[dalek@devcentos openssh]$ cat regress/failed-regress.log
trace: certified host keys: host ed25519 revoked cert privsep yes
FAIL: ssh cert connect succeeded unexpectedly

trace: certified host keys: host ed25519 revoked cert privsep no
FAIL: ssh cert connect succeeded unexpectedly

[dalek@devcentos openssh]$

I am seeing more details on this in the failed_ssh* files, but I
honestly do not know what I am looking for. Would you want the two
files? They are around 300 lines each.

Now, while I was out, I also got my Mac mini g4 running OSX
10.5.something-or-another and stock Xcode 3.1.1 and ran tests in it.
And it worked.

Damien Miller

unread,
Jan 22, 2014, 12:38:34 AM1/22/14
to Kevin Brott, openssh-...@mindrot.org
On Wed, 22 Jan 2014, Damien Miller wrote:

> On Tue, 21 Jan 2014, Kevin Brott wrote:
>
> > gcc -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare
> > -Wformat-security -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv
> > -fno-builtin-memset -std=gnu99 -fPIE -I. -I.. -I. -I./.. -DHAVE_CONFIG_H
> > -c setproctitle.c
> > setproctitle.c: In function `compat_init_setproctitle':
> > setproctitle.c:99: warning: implicit declaration of function `strlen'
> > setproctitle.c:107: `argv_start' undeclared (first use in this function)
> > setproctitle.c:107: (Each undeclared identifier is reported only once
> > setproctitle.c:107: for each function it appears in.)
> > setproctitle.c:108: `argv_env_len' undeclared (first use in this function)
> > setproctitle.c:115: warning: implicit declaration of function `strdup'
> > setproctitle.c:115: warning: assignment makes pointer from integer without
> > a cast
> > make[1]: *** [setproctitle.o] Error 1
> > make[1]: Leaving directory `/usr/src/openssh/openbsd-compat'
> > make: *** [openbsd-compat/libopenbsd-compat.a] Error 2
>
> Could you send the output of "grep SPT_ config.h" for this one?

Don't worry - I installed CentOS 3.4 and was able to reproduce and fix
this. It was fallout from the toolchain hardening options that we are
turning on by default now.

-d

Darren Tucker

unread,
Jan 22, 2014, 1:04:45 AM1/22/14
to Mauricio Tavares, openssh-...@mindrot.org
On Wed, Jan 22, 2014 at 4:21 PM, Mauricio Tavares <raub...@gmail.com> wrote:
[...]
> [dalek@devcentos openssh]$ cat regress/failed-regress.log
> trace: certified host keys: host ed25519 revoked cert privsep yes
> FAIL: ssh cert connect succeeded unexpectedly
> trace: certified host keys: host ed25519 revoked cert privsep no
> FAIL: ssh cert connect succeeded unexpectedly

this one was due to redhat not supporting the NID_secp521r1 algorithm.
This caused a test failure, but that failure also corrupted the setup
for the following line a

Damien fixed it:
https://anongit.mindrot.org/openssh.git/commit/?id=f9df7f6f477792254eab33cdef71a6d66488cb88

and the next snapshot (or possibly even the current one) should be good.

> Would you want the two files? They are around 300 lines each.

only if a snapshot built after that change above still shows a problem

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Damien Miller

unread,
Jan 22, 2014, 7:25:28 AM1/22/14
to Kevin Brott, openssh-...@mindrot.org
On Wed, 22 Jan 2014, Damien Miller wrote:

> Don't worry - I installed CentOS 3.4 and was able to reproduce and fix
> this. It was fallout from the toolchain hardening options that we are
> turning on by default now.

CVS/git head and the 20140123 snapshot (due in ~1 hour) have the fixes for
this.

Gerald Turner

unread,
Jan 22, 2014, 4:54:28 PM1/22/14
to openssh-...@mindrot.org
Damien Miller <d...@mindrot.org> writes:
> Running the regression tests supplied with Portable OpenSSH does not
> require installation and is a simply:
>
> $ ./configure && make tests

Tested openssh-SNAP-20140123 on Debian jessie/testing amd64 with OpenSSL
1.0.1f on two machines (one with AES-NI instructions), all tests passed
and no warnings.

> * ssh(1), sshd(8): Add support for Ed25519 as a public key type.
> Ed25519 is a elliptic curve signature scheme that offers
> better security than ECDSA and DSA and good performance. It may be
> used for both user and host keys.

Is there SSHFP support for Ed25519? I suppose not - looks like it would
need Internet Drafts equivalent to RFC6090 (ECDSA) and RFC6594 (SSHFP).
Currently Curve25519 has an I-D but not for Ed25519:

http://datatracker.ietf.org/doc/draft-josefsson-tls-curve25519/

“This document only describes usage of additional curves for ephemeral
key exchange (ECDHE), not for use with long-term keys embedded in
PKIX certificates (ECDH_RSA and ECDH_ECDSA). This is because
Curve25519 is not directly suitable for authentication with ECDSA,
and thus not applicable for signing of e.g. PKIX certificates.”

--
Gerald Turner Email: gtu...@unzane.com JID: gtu...@unzane.com
GPG: 0xFA8CD6D5 21D9 B2E8 7FE7 F19E 5F7D 4D0C 3FA0 810F FA8C D6D5

Hisashi T Fujinaka

unread,
Jan 22, 2014, 6:12:55 PM1/22/14
to Damien Miller, openssh-...@mindrot.org
On NetBSD amd64-current with a git pull on 1/22 at about 2300GMT:

(cd openbsd-compat && make)
BUILDDIR=`pwd`; TEST_SHELL="sh"; TEST_SSH_SSH="${BUILDDIR}/ssh"; TEST_SSH_SSHD="${BUILDDIR}/sshd"; TEST_SSH_SSHAGENT="${BUILDDIR}/ssh-agent"; TEST_SSH_SSHADD="${BUILDDIR}/ssh-add"; TEST_SSH_SSHKEYGEN="${BUILDDIR}/ssh-keygen"; TEST_SSH_SSHPKCS11HELPER="${BUILDDIR}/ssh-pkcs11-helper"; TEST_SSH_SSHKEYSCAN="${BUILDDIR}/ssh-keyscan"; TEST_SSH_SFTP="${BUILDDIR}/sftp"; TEST_SSH_SFTPSERVER="${BUILDDIR}/sftp-server"; TEST_SSH_PLINK="plink"; TEST_SSH_PUTTYGEN="puttygen"; TEST_SSH_CONCH="conch"; TEST_SSH_IPV6="yes" ; TEST_SSH_ECC="yes" ; cd ./regress || exit $?; make .OBJDIR="${BUILDDIR}/regress" .CURDIR="`pwd`" BUILDDIR="${BUILDDIR}" OBJ="${BUILDDIR}/regress/" PATH="${BUILDDIR}:${PATH}" TEST_ENV=MALLOC_OPTIONS="AJRX" TEST_SHELL="${TEST_SHELL}" TEST_SSH_SSH="${TEST_SSH_SSH}" TEST_SSH_SSHD="${TEST_SSH_SSHD}" TEST_SSH_SSHAGENT="${TEST_SSH_SSHAGENT}" TEST_SSH_SSHADD="${TEST_SSH_SSHADD}" TEST_SSH_SSHKEYGEN="${TEST_SSH_SSHKEYGEN}" TEST_SSH_SSHPKCS11HELPER="${TES
T_SSH_SSHPKCS11HELPER}" TEST_SSH_SSHKEYSCAN="${TEST_SSH_SSHKEYSCAN}" TEST_SSH_SFTP="${TEST_SSH_SFTP}" TEST_SSH_SFTPSERVER="${TEST_SSH_SFTPSERVER}" TEST_SSH_PLINK="${TEST_SSH_PLINK}" TEST_SSH_PUTTYGEN="${TEST_SSH_PUTTYGEN}" TEST_SSH_CONCH="${TEST_SSH_CONCH}" TEST_SSH_IPV6="${TEST_SSH_IPV6}" TEST_SSH_ECC="${TEST_SSH_ECC}" EXEEXT="" tests && echo all tests passed
/home/htodd/openssh/ssh-keygen -if /home/htodd/openssh/regress/rsa_ssh2.prv | diff - /home/htodd/openssh/regress/rsa_openssh.prv
tr '\n' '\r' </home/htodd/openssh/regress/rsa_ssh2.prv > /home/htodd/openssh/regress/rsa_ssh2_cr.prv
/home/htodd/openssh/ssh-keygen -if /home/htodd/openssh/regress/rsa_ssh2_cr.prv | diff - /home/htodd/openssh/regress/rsa_openssh.prv
awk '{print $0 "\r"}' /home/htodd/openssh/regress/rsa_ssh2.prv > /home/htodd/openssh/regress/rsa_ssh2_crnl.prv
/home/htodd/openssh/ssh-keygen -if /home/htodd/openssh/regress/rsa_ssh2_crnl.prv | diff - /home/htodd/openssh/regress/rsa_openssh.prv
cat /home/htodd/openssh/regress/rsa_openssh.prv > /home/htodd/openssh/regress//t2.out
chmod 600 /home/htodd/openssh/regress//t2.out
/home/htodd/openssh/ssh-keygen -yf /home/htodd/openssh/regress//t2.out | diff - /home/htodd/openssh/regress/rsa_openssh.pub
/home/htodd/openssh/ssh-keygen -ef /home/htodd/openssh/regress/rsa_openssh.pub >/home/htodd/openssh/regress//t3.out
/home/htodd/openssh/ssh-keygen -if /home/htodd/openssh/regress//t3.out | diff - /home/htodd/openssh/regress/rsa_openssh.pub
/home/htodd/openssh/ssh-keygen -lf /home/htodd/openssh/regress/rsa_openssh.pub | awk '{print $2}' | diff - /home/htodd/openssh/regress/t4.ok
/home/htodd/openssh/ssh-keygen -Bf /home/htodd/openssh/regress/rsa_openssh.pub | awk '{print $2}' | diff - /home/htodd/openssh/regress/t5.ok
/home/htodd/openssh/ssh-keygen -if /home/htodd/openssh/regress/dsa_ssh2.prv > /home/htodd/openssh/regress//t6.out1
/home/htodd/openssh/ssh-keygen -if /home/htodd/openssh/regress/dsa_ssh2.pub > /home/htodd/openssh/regress//t6.out2
chmod 600 /home/htodd/openssh/regress//t6.out1
/home/htodd/openssh/ssh-keygen -yf /home/htodd/openssh/regress//t6.out1 | diff - /home/htodd/openssh/regress//t6.out2
/home/htodd/openssh/ssh-keygen -lf /home/htodd/openssh/regress//t7.out > /dev/null
/home/htodd/openssh/ssh-keygen -Bf /home/htodd/openssh/regress//t7.out > /dev/null
/home/htodd/openssh/ssh-keygen -lf /home/htodd/openssh/regress//t8.out > /dev/null
/home/htodd/openssh/ssh-keygen -Bf /home/htodd/openssh/regress//t8.out > /dev/null
test "yes" != yes || /home/htodd/openssh/ssh-keygen -lf /home/htodd/openssh/regress//t9.out > /dev/null
test "yes" != yes || /home/htodd/openssh/ssh-keygen -Bf /home/htodd/openssh/regress//t9.out > /dev/null
/home/htodd/openssh/ssh-keygen -lf /home/htodd/openssh/regress//t10.out > /dev/null
/home/htodd/openssh/ssh-keygen -Bf /home/htodd/openssh/regress//t10.out > /dev/null
FATAL: sshd_proxy broken
*** Error code 1

Stop.
make[1]: stopped in /home/htodd/openssh/regress
*** Error code 1

Stop.
make: stopped in /home/htodd/openssh

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Darren Tucker

unread,
Jan 22, 2014, 6:17:55 PM1/22/14
to Hisashi T Fujinaka, Damien Miller, OpenSSH Devel List
On Thu, Jan 23, 2014 at 10:12 AM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
> On NetBSD amd64-current with a git pull on 1/22 at about 2300GMT:
[...]

The test framework should have created the files failed-sshd.log and
failed-ssh.log and failed-regress.log containing the output of the
failing test.

The problem is most likely in failed-sshd.log. If it's not obvious,
please post all three.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement

Hisashi T Fujinaka

unread,
Jan 22, 2014, 6:27:44 PM1/22/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
> On Thu, Jan 23, 2014 at 10:12 AM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
>> On NetBSD amd64-current with a git pull on 1/22 at about 2300GMT:
> [...]
>
> The test framework should have created the files failed-sshd.log and
> failed-ssh.log and failed-regress.log containing the output of the
> failing test.
>
> The problem is most likely in failed-sshd.log. If it's not obvious,
> please post all three.

diff3 (if I did it right) shows the same in all three files:
trace: generate keys
FATAL: sshd_proxy broken

trace: generate keys
FATAL: sshd_proxy broken
FAIL: sshd_proxy broken

trace: generate keys
FATAL: sshd_proxy broken

trace: generate keys
FATAL: sshd_proxy broken
FAIL: sshd_proxy broken


--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Darren Tucker

unread,
Jan 22, 2014, 6:38:09 PM1/22/14
to Hisashi T Fujinaka, Damien Miller, OpenSSH Devel List
On Thu, Jan 23, 2014 at 10:27 AM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
>> On Thu, Jan 23, 2014 at 10:12 AM, Hisashi T Fujinaka <ht...@twofifty.com>
>> wrote:
>>>
>>> On NetBSD amd64-current with a git pull on 1/22 at about 2300GMT:
>>
>> [...]
>>
>> The test framework should have created the files failed-sshd.log and
>> failed-ssh.log and failed-regress.log containing the output of the
>> failing test.
>>
>> The problem is most likely in failed-sshd.log. If it's not obvious,
>> please post all three.
>
> diff3 (if I did it right) shows the same in all three files:
> trace: generate keys
> FATAL: sshd_proxy broken

That's not what I was expecting to see. That's the entire content of
those files? How big are they? Also take a look at ssh.log and
sshd.log.

If that doesn't prove helpful the next step is to add "set -x" to the
top of regress/test-exec.sh and rerun the tests. It'll be somewhat
noisy but might give a clue about what's going on.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Hisashi T Fujinaka

unread,
Jan 22, 2014, 6:41:10 PM1/22/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Thu, 23 Jan 2014, Darren Tucker wrote:

> On Thu, Jan 23, 2014 at 10:27 AM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
>>> On Thu, Jan 23, 2014 at 10:12 AM, Hisashi T Fujinaka <ht...@twofifty.com>
>>> wrote:
>>>>
>>>> On NetBSD amd64-current with a git pull on 1/22 at about 2300GMT:
>>>
>>> [...]
>>>
>>> The test framework should have created the files failed-sshd.log and
>>> failed-ssh.log and failed-regress.log containing the output of the
>>> failing test.
>>>
>>> The problem is most likely in failed-sshd.log. If it's not obvious,
>>> please post all three.
>>
>> diff3 (if I did it right) shows the same in all three files:
>> trace: generate keys
>> FATAL: sshd_proxy broken
>
> That's not what I was expecting to see. That's the entire content of
> those files? How big are they? Also take a look at ssh.log and
> sshd.log.
>
> If that doesn't prove helpful the next step is to add "set -x" to the
> top of regress/test-exec.sh and rerun the tests. It'll be somewhat
> noisy but might give a clue about what's going on.

ssh.log and sshd.log are even smaller and only contain:

trace: generate keys
FATAL: sshd_proxy broken
FAIL: sshd_proxy broken

I did re-run the tests after doing a build, so that might be part of it.

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Hisashi T Fujinaka

unread,
Jan 22, 2014, 6:42:50 PM1/22/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
The -x didn't add much interesting, but I did see:
+ /home/htodd/openssh/sshd -t -f '/home/htodd/openssh/regress/sshd_proxy'
[1] Segmentation fault (core dumped) ${SSHD} -t -f ${...

Darren Tucker

unread,
Jan 22, 2014, 6:43:49 PM1/22/14
to Hisashi T Fujinaka, Damien Miller, OpenSSH Devel List
On Thu, Jan 23, 2014 at 10:41 AM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
[...]
> I did re-run the tests after doing a build, so that might be part of it.

That shouldn't make a difference. I'd suggest trying the set -x thing
described above next.

Also one other simple test see if the binaries are actually
executable: "./ssh -V"

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement

Hisashi T Fujinaka

unread,
Jan 22, 2014, 6:57:46 PM1/22/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Thu, 23 Jan 2014, Darren Tucker wrote:

> On Thu, Jan 23, 2014 at 10:41 AM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
> [...]
>> I did re-run the tests after doing a build, so that might be part of it.
>
> That shouldn't make a difference. I'd suggest trying the set -x thing
> described above next.
>
> Also one other simple test see if the binaries are actually
> executable: "./ssh -V"

The set -x created a lot of noise on the screen, but even less in the
log files. And ./ssh -V gave "OpenSSH_6.5p1, OpenSSL 1.0.1f 6 Jan 2014".
run test connect.sh ...
+ '_POSIX2_VERSION=199209'
+ export '_POSIX2_VERSION'
+ uname -s
+ '[' '!' -z '' ']'
+ PORT=4242
+ '[' -x /usr/ucb/whoami ']'
+ whoami
+ whoami
+ USER=htodd
+ OBJ=/home/htodd/openssh/regress
+ '[' x/home/htodd/openssh/regress = x ']'
+ '[' '!' -d /home/htodd/openssh/regress ']'
+ 'SCRIPT=/home/htodd/openssh/regress/connect.sh'
+ '[' 'x/home/htodd/openssh/regress/connect.sh' = x ']'
+ '[' '!' -f '/home/htodd/openssh/regress/connect.sh' ']'
+ sh -n '/home/htodd/openssh/regress/connect.sh'
+ true
+ unset 'SSH_AUTH_SOCK'
+ dirname '/home/htodd/openssh/regress/connect.sh'
+ SRC=/home/htodd/openssh/regress
+ SSH=ssh
+ SSHD=sshd
+ SSHAGENT=ssh-agent
+ SSHADD=ssh-add
+ SSHKEYGEN=ssh-keygen
+ SSHKEYSCAN=ssh-keyscan
+ SFTP=sftp
+ SFTPSERVER=/usr/libexec/openssh/sftp-server
+ SCP=scp
+ PLINK=plink
+ PUTTYGEN=puttygen
+ CONCH=conch
+ '[' x/home/htodd/openssh/ssh '!=' x ']'
+ SSH=/home/htodd/openssh/ssh
+ '[' x/home/htodd/openssh/sshd '!=' x ']'
+ SSHD=/home/htodd/openssh/sshd
+ '[' x/home/htodd/openssh/ssh-agent '!=' x ']'
+ SSHAGENT=/home/htodd/openssh/ssh-agent
+ '[' x/home/htodd/openssh/ssh-add '!=' x ']'
+ SSHADD=/home/htodd/openssh/ssh-add
+ '[' x/home/htodd/openssh/ssh-keygen '!=' x ']'
+ SSHKEYGEN=/home/htodd/openssh/ssh-keygen
+ '[' x/home/htodd/openssh/ssh-keyscan '!=' x ']'
+ SSHKEYSCAN=/home/htodd/openssh/ssh-keyscan
+ '[' x/home/htodd/openssh/sftp '!=' x ']'
+ SFTP=/home/htodd/openssh/sftp
+ '[' x/home/htodd/openssh/sftp-server '!=' x ']'
+ SFTPSERVER=/home/htodd/openssh/sftp-server
+ '[' x '!=' x ']'
+ '[' xplink '!=' x ']'
+ which plink
+ PLINK=
+ '[' xputtygen '!=' x ']'
+ which puttygen
+ PUTTYGEN=
+ '[' xconch '!=' x ']'
+ which conch
+ CONCH=
+ '[' x = x ']'
+ 'TEST_SSH_LOGFILE=/home/htodd/openssh/regress/ssh.log'
+ '[' x = x ']'
+ 'TEST_SSHD_LOGFILE=/home/htodd/openssh/regress/sshd.log'
+ '[' x = x ']'
+ 'TEST_REGRESS_LOGFILE=/home/htodd/openssh/regress/regress.log'
+
+
+
+ 'SSHLOGWRAP=/home/htodd/openssh/regress/ssh-log-wrapper.sh'
+ echo '#!/bin/sh'
+ echo 'exec /home/htodd/openssh/ssh -E/home/htodd/openssh/regress/ssh.log "$@"'
+ chmod 'a+rx' '/home/htodd/openssh/regress/ssh-log-wrapper.sh'
+ 'SSH=/home/htodd/openssh/regress/ssh-log-wrapper.sh'
+ DATANAME=data
+ DATA=/home/htodd/openssh/regress/data
+ cat /home/htodd/openssh/ssh-agent
+ chmod 'u+w' /home/htodd/openssh/regress/data
+ COPY=/home/htodd/openssh/regress/copy
+ rm -f /home/htodd/openssh/regress/copy
+ export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER SCP
+ RESULT=0
+ PIDFILE=/home/htodd/openssh/regress/pidfile
+ trap fatal 3 2
+ cat
+ '[' '!' -z '' ']'
+ cp '/home/htodd/openssh/regress/sshd_config' '/home/htodd/openssh/regress/sshd_proxy'
+ echo 'StrictModes no'
+ cat
+ '[' '!' -z '' ']'
+ rm -f '/home/htodd/openssh/regress/known_hosts' '/home/htodd/openssh/regress/authorized_keys_htodd'
+ trace 'generate keys'
+ 'start_debug_log' generate keys
+ echo 'trace: generate' keys
+ echo 'trace: generate' keys
+ echo 'trace: generate' keys
+ '[' X = Xyes ']'
+ '[' '!' -f /home/htodd/openssh/regress/rsa ']'
+ '[' /home/htodd/openssh/ssh-keygen -nt /home/htodd/openssh/regress/rsa ']'
+ printf 'localhost-with-alias,127.0.0.1,::1 '
+ cat '/home/htodd/openssh/regress/rsa.pub'
+ cat '/home/htodd/openssh/regress/rsa.pub'
+ echo IdentityFile /home/htodd/openssh/regress/rsa
+ cp /home/htodd/openssh/regress/rsa '/home/htodd/openssh/regress/host.rsa'
+ echo HostKey '/home/htodd/openssh/regress/host.rsa'
+ echo HostKey /home/htodd/openssh/regress/rsa
+ '[' '!' -f /home/htodd/openssh/regress/rsa1 ']'
+ '[' /home/htodd/openssh/ssh-keygen -nt /home/htodd/openssh/regress/rsa1 ']'
+ printf 'localhost-with-alias,127.0.0.1,::1 '
+ cat '/home/htodd/openssh/regress/rsa1.pub'
+ cat '/home/htodd/openssh/regress/rsa1.pub'
+ echo IdentityFile /home/htodd/openssh/regress/rsa1
+ cp /home/htodd/openssh/regress/rsa1 '/home/htodd/openssh/regress/host.rsa1'
+ echo HostKey '/home/htodd/openssh/regress/host.rsa1'
+ echo HostKey /home/htodd/openssh/regress/rsa1
+ chmod 644 '/home/htodd/openssh/regress/authorized_keys_htodd'
+ 'REGRESS_INTEROP_CONCH=no'
+ test -x ''
+ 'REGRESS_INTEROP_PUTTY=no'
+ test -x '' -a -x ''
+ 'REGRESS_INTEROP_PUTTY=no'
+ test no = yes
+ cat '/home/htodd/openssh/regress/ssh_config'
+ echo proxycommand sh '/home/htodd/openssh/regress/sshd-log-wrapper.sh' /home/htodd/openssh/sshd '/home/htodd/openssh/regress/sshd.log' -i -f '/home/htodd/openssh/regress/sshd_proxy'
+ /home/htodd/openssh/sshd -t -f '/home/htodd/openssh/regress/sshd_proxy'
[1] Segmentation fault (core dumped) ${SSHD} -t -f ${...
+ fatal 'sshd_proxy broken'
+ 'save_debug_log' 'FATAL: sshd_proxy broken'
+ echo 'FATAL:' 'sshd_proxy' broken
+ echo 'FATAL:' 'sshd_proxy' broken
+ echo 'FATAL:' 'sshd_proxy' broken
+ cat '/home/htodd/openssh/regress/regress.log'
+ echo
+ cat '/home/htodd/openssh/regress/ssh.log'
+ echo
+ cat '/home/htodd/openssh/regress/sshd.log'
+ echo
+ printf 'FATAL: '
FATAL: + fail 'sshd_proxy broken'
+ 'save_debug_log' 'FAIL: sshd_proxy broken'
+ echo 'FAIL:' 'sshd_proxy' broken
+ echo 'FAIL:' 'sshd_proxy' broken
+ echo 'FAIL:' 'sshd_proxy' broken
+ cat '/home/htodd/openssh/regress/regress.log'
+ echo
+ cat '/home/htodd/openssh/regress/ssh.log'
+ echo
+ cat '/home/htodd/openssh/regress/sshd.log'
+ echo
+ RESULT=1
+ echo 'sshd_proxy broken'
sshd_proxy broken
+ cleanup
+ '[' -f /home/htodd/openssh/regress/pidfile ']'
+ exit 1
*** Error code 1

Stop.
make[1]: stopped in /home/htodd/openssh/regress
*** Error code 1

Stop.
make: stopped in /home/htodd/openssh

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Darren Tucker

unread,
Jan 22, 2014, 7:08:25 PM1/22/14
to Hisashi T Fujinaka, Damien Miller, OpenSSH Devel List
On Thu, Jan 23, 2014 at 10:57 AM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
> + /home/htodd/openssh/sshd -t -f '/home/htodd/openssh/regress/sshd_proxy'
> [1] Segmentation fault (core dumped) ${SSHD} -t -f ${...

well there's the problem: sshd is segfaulting immediately on startup.

I suspect this is fallout from the extra compiler hardening flags we
added recently. Could you rebuild with "./configure
--without-hardening --without-pie && make clean && make tests' and see
if that works?

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Hisashi T Fujinaka

unread,
Jan 22, 2014, 8:05:19 PM1/22/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Thu, 23 Jan 2014, Darren Tucker wrote:

> On Thu, Jan 23, 2014 at 10:57 AM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
>> + /home/htodd/openssh/sshd -t -f '/home/htodd/openssh/regress/sshd_proxy'
>> [1] Segmentation fault (core dumped) ${SSHD} -t -f ${...
>
> well there's the problem: sshd is segfaulting immediately on startup.
>
> I suspect this is fallout from the extra compiler hardening flags we
> added recently. Could you rebuild with "./configure
> --without-hardening --without-pie && make clean && make tests' and see
> if that works?

Looks like the exact same error. Let me try on a netbsd-6 machine to see
if that works.

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Hisashi T Fujinaka

unread,
Jan 22, 2014, 8:13:13 PM1/22/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Wed, 22 Jan 2014, Hisashi T Fujinaka wrote:

> On Thu, 23 Jan 2014, Darren Tucker wrote:
>
>> On Thu, Jan 23, 2014 at 10:57 AM, Hisashi T Fujinaka <ht...@twofifty.com>
>> wrote:
>>> + /home/htodd/openssh/sshd -t -f '/home/htodd/openssh/regress/sshd_proxy'
>>> [1] Segmentation fault (core dumped) ${SSHD} -t -f ${...
>>
>> well there's the problem: sshd is segfaulting immediately on startup.
>>
>> I suspect this is fallout from the extra compiler hardening flags we
>> added recently. Could you rebuild with "./configure
>> --without-hardening --without-pie && make clean && make tests' and see
>> if that works?
>
> Looks like the exact same error. Let me try on a netbsd-6 machine to see
> if that works.

htodd@mara:~/openssh/regress > gdb ../sshd sshd.core
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/htodd/openssh/sshd...done.
[New process 1]
Core was generated by `sshd'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f7ff62a0603 in istrsenvisx (mbdst=0x7f7fffffbde0 "\rj\340R", dlen=0x7f7fffffbc88,
mbsrc=0x400 <Address 0x400 out of bounds>, mblength=0, flags=33, mbextra=0x7f7ff6310ee2 "", cerr_ptr=0x0)
at /usr/src/lib/libc/gen/vis.c:379
379 mblength = strlen(mbsrc);
(gdb) bt
#0 0x00007f7ff62a0603 in istrsenvisx (mbdst=0x7f7fffffbde0 "\rj\340R", dlen=0x7f7fffffbc88,
mbsrc=0x400 <Address 0x400 out of bounds>, mblength=0, flags=33, mbextra=0x7f7ff6310ee2 "", cerr_ptr=0x0)
at /usr/src/lib/libc/gen/vis.c:379
#1 0x00007f7ff62a11f8 in strnvis (mbdst=<optimized out>, dlen=140187732525536, mbsrc=<optimized out>, flags=<optimized out>)
at /usr/src/lib/libc/gen/vis.c:655
#2 0x0000000000439ec5 in do_log (level=SYSLOG_LEVEL_FATAL, fmt=<optimized out>, args=0x7f7fffffc630) at log.c:438
#3 0x0000000000438c15 in fatal (fmt=<optimized out>) at fatal.c:42
#4 0x000000000040a7c8 in main (ac=<optimized out>, av=<optimized out>) at sshd.c:1803
(gdb)

Darren Tucker

unread,
Jan 22, 2014, 8:56:48 PM1/22/14
to Hisashi T Fujinaka, Damien Miller, OpenSSH Devel List
On Thu, Jan 23, 2014 at 12:13 PM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
> #1 0x00007f7ff62a11f8 in strnvis (mbdst=<optimized out>,
> dlen=140187732525536, mbsrc=<optimized out>, flags=<optimized out>)
> at /usr/src/lib/libc/gen/vis.c:655

strnvis? interesting. Could you please try:

../../configure --with-cflags=-DBROKEN_STRNVIS && make clean && make tests

Thanks.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Mark E. Lee

unread,
Jan 22, 2014, 9:01:49 PM1/22/14
to openssh-...@mindrot.org
On Fri, 2014-01-17 at 11:26 +1100, Damien Miller wrote:
> Hi,
>
> OpenSSH 6.5 is almost ready for release, so we would appreciate testing
> on as many platforms and systems as possible. This release contains
> some substantial new features and a number of bugfixes.
>
> Snapshot releases for portable OpenSSH are available from
> http://www.mindrot.org/openssh_snap/
>
> The OpenBSD version is available in CVS HEAD:
> http://www.openbsd.org/anoncvs.html
>
> Portable OpenSSH is also available via anonymous CVS using the
> instructions at http://www.openssh.com/portable.html#cvs or
> via Mercurial at http://hg.mindrot.org/openssh
>
> Running the regression tests supplied with Portable OpenSSH does not
> require installation and is a simply:
>
> $ ./configure && make tests
>
> Live testing on suitable non-production systems is also
> appreciated. Please send reports of success or failure to
> openssh-...@mindrot.org.
>
> Below is a summary of changes. More detail may be found in the ChangeLog
> in the portable OpenSSH tarballs.
>
> Thanks to the many people who contributed to this release.
>
> Changes since OpenSSH 6.4
> =========================
>
> This is a feature-focused release.
>
> New features:
>
> * ssh(1), sshd(8): Add support for key exchange using elliptic-curve
> Diffie Hellman in Daniel Bernstein's Curve25519. This key exchange
> method is the default when both the client and server support it.
>
> * ssh(1), sshd(8): Add support for Ed25519 as a public key type.
> Ed25519 is a elliptic curve signature scheme that offers
> better security than ECDSA and DSA and good performance. It may be
> used for both user and host keys.
>
> * Add a new private key format that uses a bcrypt KDF to better
> protect keys at rest. This format is used unconditionally for
> Ed25519 keys, but may be requested when generating or saving
> existing keys of other types via the -o ssh-keygen(1) option.
> We intend to make the new format the default in the near future.
> Details of the new format are in the PROTOCOL.key file.
>
> * ssh(1), sshd(8): Add a new transport cipher
> "chacha20...@openssh.com" that combines Daniel Bernstein's
> ChaCha20 stream cipher and Poly1305 MAC to build an authenticated
> encryption mode. Details are in the PROTOCOL.chacha20poly1305 file.
>
> * ssh(1), sshd(8): Refuse RSA keys from old proprietary clients and
> servers that use the obsolete RSA+MD5 signature scheme. It will
> still be possible to connect with these clients/servers but only
> DSA keys will be accepted, and OpenSSH will refuse connection
> entirely in a future release.
>
> * ssh(1), sshd(8): Refuse old proprietary clients and servers that
> use a weaker key exchange hash calculation.
>
> * ssh(1): Increase the size of the Diffie-Hellman groups requested
> for each symmetric key size. New values from NIST Special
> Publication 800-57 with the upper limit specified by RFC4419
>
> * ssh(1), ssh-agent(1): Support pkcs#11 tokes that only provide
> X.509 certs instead of raw public keys (requested as bz#1908).
>
> * ssh(1): Add a ssh_config(5) "Match" keyword that allows
> conditional configuration to be applied by matching on hostname,
> user and result of arbitrary commands.
>
> * ssh(1): Add support for client-side hostname canonicalisation
> using a set of DNS suffixes and rules in ssh_config(5). This
> allows unqualified names to be canonicalised to fully-qualified
> domain names to eliminate ambiguity when looking up keys in
> known_hosts or checking host certificate names.
>
> * sftp-server(8): Add the ability to whitelist and/or blacklist sftp
> protocol requests by name.
>
> * sftp-server(8): Add a sftp "fs...@openssh.com" to support calling
> fsync(2) on an open file handle.
>
> * sshd(8): Add a ssh_config(5) PermitTTY to disallow TTY allocation,
> mirroring the longstanding no-pty authorized_keys option.
>
> * ssh(1): Add a ssh_config ProxyUseFDPass option that supports the
> use of ProxyCommands that establish a connection and then pass a
> connected file descriptor back to ssh(1). This allows the
> ProxyCommand to exit rather than staying around to transfer data.
>
> Bugfixes:
>
> * ssh(1), sshd(8): Fix potential stack exhaustion caused by nested
> certificates.
>
> * ssh(1): bz#1211: make BindAddress work with UsePrivilegedPort.
>
> * sftp(1): bz#2137: fix the progress meter for resumed transfer.
>
> * ssh-add(1): bz#2187: do not request smartcard PIN when removing
> keys from ssh-agent.
>
> * sshd(8): bz#2139: fix re-exec fallback when original sshd binary
> cannot be executed.
>
> * ssh-keygen(1): Make relative-specified certificate expiry times
> relative to current time and not the validity start time.
>
> * sshd(8): bz#2161: fix AuthorizedKeysCommand inside a Match block.
>
> * sftp(1): bz#2129: symlinking a file would incorrectly canonicalise
> the target path.
>
> * ssh-agent(1): bz#2175: fix a use-after-free in the PKCS#11 agent
> helper executable.
>
> * sshd(8): Improve logging of sessions to include the user name,
> remote host and port, the session type (shell, command, etc.) and
> allocated TTY (if any).
>
> * sshd(8): bz#1297: tell the client (via a debug message) when
> their preferred listen address has been overridden by the
> server's GatewayPorts setting.
>
> * sshd(8): bz#2162: include report port in bad protocol banner
> message.
>
> * sftp(1): bz#2163: fix memory leak in error path in do_readdir()
>
> * sftp(1): bz#2171: don't leak file descriptor on error.
>
> * sshd(8): Include the local address and port in "Connection from
> ..." message (only shown at loglevel>=verbose)
>
> Portable OpenSSH:
>
> * Switch to a ChaCha20-based arc4random() PRNG for platforms that do
> not provide their own.
>
> * sshd(8): bz#2156: restore Linux oom_adj setting when handling
> SIGHUP to maintain behaviour over retart.
>
> * sshd(8): bz#2032: use local username in krb5_kuserok check rather
> than full client name which may be of form user@REALM.
>
> * ssh(1), sshd(8): Test for both the presence of ECC NID numbers in
> OpenSSL and that they actually work. Fedora (at least) has
> NID_secp521r1 that doesn't work.
>
> * bz#2173: use pkg-config --libs to include correct -L location for
> libedit.
>
> Reporting Bugs:
> ===============
>
> - Please read http://www.openssh.com/report.html
> Security bugs should be reported directly to ope...@openssh.com
>
> OpenSSH is brought to you by Markus Friedl, Niels Provos, Theo de Raadt,
> Kevin Steves, Damien Miller, Darren Tucker, Jason McIntyre, Tim Rice and
> Ben Lindstrom.
>
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-...@mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

Salutations,

Tested 1/23/2014 snapshot on Arch Linux 64-bit with following configure
options:
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--libexecdir=/usr/lib/ssh \
--sysconfdir=/etc/ssh \
--with-ldns \
--with-libedit \
--with-ssl-engine \
--with-pam \
--with-privsep-user=nobody \
--with-kerberos5=/usr \
--with-xauth=/usr/bin/xauth \
--with-mantype=man \
--with-md5-passwords \
--with-pid-dir=/run \

Passed all tests.

Regards,
Mark
--
Mark E. Lee <ma...@markelee.com>
signature.asc

Hisashi T Fujinaka

unread,
Jan 22, 2014, 9:56:34 PM1/22/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Thu, 23 Jan 2014, Darren Tucker wrote:

> On Thu, Jan 23, 2014 at 12:13 PM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
>> #1 0x00007f7ff62a11f8 in strnvis (mbdst=<optimized out>,
>> dlen=140187732525536, mbsrc=<optimized out>, flags=<optimized out>)
>> at /usr/src/lib/libc/gen/vis.c:655
>
> strnvis? interesting. Could you please try:
>
> ../../configure --with-cflags=-DBROKEN_STRNVIS && make clean && make tests

I had to make /var/empty, and then it appears to be hanging in "scp:
simple copy remote file to local file".

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Hisashi T Fujinaka

unread,
Jan 22, 2014, 10:25:07 PM1/22/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Wed, 22 Jan 2014, Hisashi T Fujinaka wrote:

> On Thu, 23 Jan 2014, Darren Tucker wrote:
>
>> On Thu, Jan 23, 2014 at 12:13 PM, Hisashi T Fujinaka <ht...@twofifty.com>
>> wrote:
>>> #1 0x00007f7ff62a11f8 in strnvis (mbdst=<optimized out>,
>>> dlen=140187732525536, mbsrc=<optimized out>, flags=<optimized out>)
>>> at /usr/src/lib/libc/gen/vis.c:655
>>
>> strnvis? interesting. Could you please try:
>>
>> ../../configure --with-cflags=-DBROKEN_STRNVIS && make clean && make tests
>
> I gave up on the file copy and here are the three fail logs.

Oh, I may have made a mistake. Is the git version the portable version?

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Hisashi T Fujinaka

unread,
Jan 22, 2014, 10:22:28 PM1/22/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Thu, 23 Jan 2014, Darren Tucker wrote:

> On Thu, Jan 23, 2014 at 12:13 PM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
>> #1 0x00007f7ff62a11f8 in strnvis (mbdst=<optimized out>,
>> dlen=140187732525536, mbsrc=<optimized out>, flags=<optimized out>)
>> at /usr/src/lib/libc/gen/vis.c:655
>
> strnvis? interesting. Could you please try:
>
> ../../configure --with-cflags=-DBROKEN_STRNVIS && make clean && make tests

I gave up on the file copy and here are the three fail logs.

failed-sshd.log
failed-ssh.log
failed-regress.log

Darren Tucker

unread,
Jan 22, 2014, 10:38:41 PM1/22/14
to Hisashi T Fujinaka, Damien Miller, OpenSSH Devel List
On Thu, Jan 23, 2014 at 2:25 PM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
> On Wed, 22 Jan 2014, Hisashi T Fujinaka wrote:
>> On Thu, 23 Jan 2014, Darren Tucker wrote:
[...]
>>> ../../configure --with-cflags=-DBROKEN_STRNVIS && make clean && make
>>> tests
>>
>>
>> I gave up on the file copy and here are the three fail logs.

"Killed by signal 2."

that's SIGINT. Was it working correctly, and did you ctrl-C'ed it?

> Oh, I may have made a mistake. Is the git version the portable version?

https://anongit.mindrot.org/openssh.git/ is the portable version.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement

Hisashi T Fujinaka

unread,
Jan 22, 2014, 10:41:25 PM1/22/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Thu, 23 Jan 2014, Darren Tucker wrote:

> On Thu, Jan 23, 2014 at 2:25 PM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
>> On Wed, 22 Jan 2014, Hisashi T Fujinaka wrote:
>>> On Thu, 23 Jan 2014, Darren Tucker wrote:
> [...]
>>>> ../../configure --with-cflags=-DBROKEN_STRNVIS && make clean && make
>>>> tests
>>>
>>>
>>> I gave up on the file copy and here are the three fail logs.
>
> "Killed by signal 2."
>
> that's SIGINT. Was it working correctly, and did you ctrl-C'ed it?

I gave up after waiting 15 minutes. The OSX version didn't take that
long so I thought it was hung.

>> Oh, I may have made a mistake. Is the git version the portable version?
>
> https://anongit.mindrot.org/openssh.git/ is the portable version.

Yep. That's the one I have.

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Loganaden Velvindron

unread,
Jan 22, 2014, 11:14:44 PM1/22/14
to Gerald Turner, OpenSSH Devel List
On Thu, Jan 23, 2014 at 1:54 AM, Gerald Turner <gtu...@unzane.com> wrote:
> Damien Miller <d...@mindrot.org> writes:
>> Running the regression tests supplied with Portable OpenSSH does not
>> require installation and is a simply:
>>
>> $ ./configure && make tests
>
> Tested openssh-SNAP-20140123 on Debian jessie/testing amd64 with OpenSSL
> 1.0.1f on two machines (one with AES-NI instructions), all tests passed
> and no warnings.
>
>> * ssh(1), sshd(8): Add support for Ed25519 as a public key type.
>> Ed25519 is a elliptic curve signature scheme that offers
>> better security than ECDSA and DSA and good performance. It may be
>> used for both user and host keys.
>
> Is there SSHFP support for Ed25519? I suppose not - looks like it would
> need Internet Drafts equivalent to RFC6090 (ECDSA) and RFC6594 (SSHFP).
> Currently Curve25519 has an I-D but not for Ed25519:

A draft for sshfp is being worked on.

>
> http://datatracker.ietf.org/doc/draft-josefsson-tls-curve25519/
>
> “This document only describes usage of additional curves for ephemeral
> key exchange (ECDHE), not for use with long-term keys embedded in
> PKIX certificates (ECDH_RSA and ECDH_ECDSA). This is because
> Curve25519 is not directly suitable for authentication with ECDSA,
> and thus not applicable for signing of e.g. PKIX certificates.”
>
> --
> Gerald Turner Email: gtu...@unzane.com JID: gtu...@unzane.com
> GPG: 0xFA8CD6D5 21D9 B2E8 7FE7 F19E 5F7D 4D0C 3FA0 810F FA8C D6D5
>
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-...@mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
>



--
This message is strictly personal and the opinions expressed do not
represent those of my employers, either past or present.

Nicholas Marriott

unread,
Jan 23, 2014, 3:33:03 AM1/23/14
to Darren Tucker, Damien Miller, OpenSSH Devel List, Hisashi T Fujinaka
Hi

When NetBSD added strnvis they swapped around the argument order.

On OpenBSD:

int strnvis(char *, const char *, size_t, int)

On NetBSD:

int strnvis(char *, size_t, const char *, int);

Don't ask me why.

Darren Tucker

unread,
Jan 23, 2014, 6:22:51 AM1/23/14
to Nicholas Marriott, Damien Miller, OpenSSH Devel List, Hisashi T Fujinaka
On Thu, Jan 23, 2014 at 08:33:03AM +0000, Nicholas Marriott wrote:
> Hi
>
> When NetBSD added strnvis they swapped around the argument order.
>
> On OpenBSD:
> int strnvis(char *, const char *, size_t, int)
>
> On NetBSD:
> int strnvis(char *, size_t, const char *, int);
>
> Don't ask me why.

Sigh. FreeBSD too. Seriously guys? The OpenBSD usage predates both
by >10 years.

http://www.freebsd.org/cgi/man.cgi?query=strnvis&sektion=3&n=1
"strnvis() [...] appeared in and[sic] FreeBSD 9.2."

http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44977
http://netbsd.gw.com/cgi-bin/man-cgi?strnvis++NetBSD-current
"strnvis(), [...] appeared in NetBSD 6.0"

http://www.openbsd.org/cgi-bin/man.cgi?query=strnvis&sektion=3
"The strnvis() function first appeared in OpenBSD 2.9".

For those keeping score, OpenBSD 2.9 was in 2001, NetBSD 6.0 was 2012 and
FreeBSD 9.2 was 2013.

Index: configure.ac
===================================================================
RCS file: /var/cvs/openssh/configure.ac,v
retrieving revision 1.558
diff -u -p -r1.558 configure.ac
--- configure.ac 22 Jan 2014 10:30:13 -0000 1.558
+++ configure.ac 23 Jan 2014 10:58:47 -0000
@@ -769,6 +769,8 @@ mips-sony-bsd|mips-sony-newsos4)
AC_DEFINE([SSH_TUN_PREPEND_AF], [1],
[Prepend the address family to IP tunnel traffic])
TEST_MALLOC_OPTIONS="AJRX"
+ AC_DEFINE([BROKEN_STRNVIS], [1],
+ [NetBSD strnvis argument order is swapped compared to OpenBSD])
;;
*-*-freebsd*)
check_for_libcrypt_later=1
@@ -777,7 +779,8 @@ mips-sony-bsd|mips-sony-newsos4)
AC_CHECK_HEADER([net/if_tap.h], ,
AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support]))
AC_DEFINE([BROKEN_GLOB], [1], [FreeBSD glob does not do what we need])
- AC_DEFINE([BROKEN_STRNVIS], [1], [FreeBSD strnvis does not do what we need])
+ AC_DEFINE([BROKEN_STRNVIS], [1],
+ [FreeBSD strnvis argument order is swapped compared to OpenBSD])
TEST_MALLOC_OPTIONS="AJRX"
;;
*-*-bsdi*)

Damien Miller

unread,
Jan 23, 2014, 7:02:36 AM1/23/14
to Darren Tucker, Nicholas Marriott, OpenSSH Devel List, Hisashi T Fujinaka
On Thu, 23 Jan 2014, Darren Tucker wrote:

> On Thu, Jan 23, 2014 at 08:33:03AM +0000, Nicholas Marriott wrote:
> > Hi
> >
> > When NetBSD added strnvis they swapped around the argument order.
> >
> > On OpenBSD:
> > int strnvis(char *, const char *, size_t, int)
> >
> > On NetBSD:
> > int strnvis(char *, size_t, const char *, int);
> >
> > Don't ask me why.
>
> Sigh. FreeBSD too. Seriously guys? The OpenBSD usage predates both
> by >10 years.

I get that the OpenBSD argument order is arguably a bit inconsistent
with other string functions (though hardly the worst wart in libc), but
the solution to this is either grudingly accept it or to import strnvis
_under a different name_, not to import it but silently introduce a
gaping, idiotic incompatibility that yields silent string corruption at
best, crashes in all likelihood and exploitable stack/heap overflows at
worst.

> For those keeping score, OpenBSD 2.9 was in 2001, NetBSD 6.0 was 2012 and
> FreeBSD 9.2 was 2013.

ok djm, for lack of a time machine and cluebat

Hisashi T Fujinaka

unread,
Jan 23, 2014, 11:24:41 AM1/23/14
to Darren Tucker, Nicholas Marriott, Damien Miller, OpenSSH Devel List
On Thu, 23 Jan 2014, Darren Tucker wrote:

So I did a git pull and I'm trying again. It appears to be getting
farther and right now I'm waiting for "scp: simple copy remote file to
local file".

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Hisashi T Fujinaka

unread,
Jan 23, 2014, 12:17:34 PM1/23/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
So I've been waiting over an hour. I think I can call it hung. Do you
have any further suggestions for me?

What I did was git pull; autoreconf; ./configure; make clean; make tests

mancha

unread,
Jan 23, 2014, 4:40:55 PM1/23/14
to openssh-...@mindrot.org
Damien Miller <djm <at> mindrot.org> writes:
> Hi,
>
> OpenSSH 6.5 is almost ready for release, so we would appreciate testing
> on as many platforms and systems as possible. This release contains
> some substantial new features and a number of bugfixes.
>
> Live testing on suitable non-production systems is also
> appreciated. Please send reports of success or failure to
> openssh-unix-dev <at> mindrot.org.

Hi.

Some results to add to the mix using openssh-SNAP-20140124:

1. System: Slackware 14.1 (w/ security patches thru 20140123)
Command: ./configure && make tests
Result: all tests passed(*)

(*) some tests were skipped because:
-unset "SUDO" variable
-Slackware doesn't ship a netcat suitable for ProxyCommand
-no setuid-allowed in regress dir

2. System: Slackware 14.1 (same as above + port of OpenBSD's nc)
Command: ./configure && SUDO=/usr/bin/sudo make tests
Result: all tests passed(*)

(*) some tests were skipped because:
-no setuid-allowed in regress dir

Is skipping the compilation of setuid-allowed.c intentional?

Finally, you asked for confirmation from Aris but I thought I'd
share I built an ssh client using libssh 0.6.0 and successfully
connect to SNAP-20140124's sshd using curve255...@libssh.org
KEX. Interop confirmed.

--mancha

Darren Tucker

unread,
Jan 23, 2014, 5:27:12 PM1/23/14
to Hisashi T Fujinaka, Damien Miller, OpenSSH Devel List
On Fri, Jan 24, 2014 at 4:17 AM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
> So I've been waiting over an hour. I think I can call it hung. Do you
> have any further suggestions for me?

Yeah, it's hung. It should complete in <1min.

> What I did was git pull; autoreconf; ./configure; make clean; make tests

That command line looks right. If you want to run a specific test you
can use "make tests LTESTS=scp" to skip the other tests.

The only other thing I can suggest is, while it's in the hung state,
grab copies of ssh.log, sshd.log and regress.log then run strace -p on
the two scp processes, ssh and sshd. Maybe that'll show what it's
waiting for.

I'm in the process of installing a VM to attempt to reproduce it but
got held up by http://gnats.netbsd.org/44069. I got past that but now
it panics when I try to bring up the network interface. If I can get
the VM up and reproduce it then I'll try to diagnose locally.

Thanks.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Hisashi T Fujinaka

unread,
Jan 23, 2014, 5:47:31 PM1/23/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Fri, 24 Jan 2014, Darren Tucker wrote:

> On Fri, Jan 24, 2014 at 4:17 AM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
>> So I've been waiting over an hour. I think I can call it hung. Do you
>> have any further suggestions for me?
>
> Yeah, it's hung. It should complete in <1min.
>
>> What I did was git pull; autoreconf; ./configure; make clean; make tests
>
> That command line looks right. If you want to run a specific test you
> can use "make tests LTESTS=scp" to skip the other tests.
>
> The only other thing I can suggest is, while it's in the hung state,
> grab copies of ssh.log, sshd.log and regress.log then run strace -p on
> the two scp processes, ssh and sshd. Maybe that'll show what it's
> waiting for.
>
> I'm in the process of installing a VM to attempt to reproduce it but
> got held up by http://gnats.netbsd.org/44069. I got past that but now
> it panics when I try to bring up the network interface. If I can get
> the VM up and reproduce it then I'll try to diagnose locally.

Cool, thanks. Let me know if there's anything else I can do on my end.
I'll be poking around in the processes.

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Hisashi T Fujinaka

unread,
Jan 23, 2014, 6:15:11 PM1/23/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Thu, 23 Jan 2014, Hisashi T Fujinaka wrote:

> On Fri, 24 Jan 2014, Darren Tucker wrote:
>
>> On Fri, Jan 24, 2014 at 4:17 AM, Hisashi T Fujinaka <ht...@twofifty.com>
>> wrote:
>>> So I've been waiting over an hour. I think I can call it hung. Do you
>>> have any further suggestions for me?
>>
>> Yeah, it's hung. It should complete in <1min.
>>
>>> What I did was git pull; autoreconf; ./configure; make clean; make tests
>>
>> That command line looks right. If you want to run a specific test you
>> can use "make tests LTESTS=scp" to skip the other tests.
>>
>> The only other thing I can suggest is, while it's in the hung state,
>> grab copies of ssh.log, sshd.log and regress.log then run strace -p on
>> the two scp processes, ssh and sshd. Maybe that'll show what it's
>> waiting for.
>>
>> I'm in the process of installing a VM to attempt to reproduce it but
>> got held up by http://gnats.netbsd.org/44069. I got past that but now
>> it panics when I try to bring up the network interface. If I can get
>> the VM up and reproduce it then I'll try to diagnose locally.
>
> Cool, thanks. Let me know if there's anything else I can do on my end.
> I'll be poking around in the processes.

Does this tell you anything?

21116 1 scp read(0x3, 0x7f7ff7b20000, 0x8000) = 32768
"\^?ELF\^B\^A\^A\0\0\0\0\0\0\0\0\0\^B\0>\0\^A\0\0\0pK@\0\0\0\0\0@\0\0\0\0\0\0\0\M-8\M-\\t\0\0\0\0\0\0\0\0\0@\08\0\t\0@\0'"
21116 1 scp write(0x6, 0x7f7ff7b20000, 0x8000) = 32768
"\^?ELF\^B\^A\^A\0\0\0\0\0\0\0\0\0\^B\0>\0\^A\0\0\0pK@\0\0\0\0\0@\0\0\0\0\0\0\0\M-8\M-\\t\0\0\0\0\0\0\0\0\0@\08\0\t\0@\0'"
21116 1 scp read(0x3, 0x7f7ff7b20000, 0x8000) = 32768
"\M^?H\M^I\M-CH\M^E\M-@\^O\M^D\M-=\0\0\0\M^KT$\^D\M^E\M-Rt&\^O\M-6\0\M^D\M-@\^O\M^H\M^M\0\0\0\M^A\M-z\0 \0\0wh\M^C\M-z\^At"
21116 1 scp write(0x6, 0x7f7ff7b20000, 0x8000) = 32768
"\M^?H\M^I\M-CH\M^E\M-@\^O\M^D\M-=\0\0\0\M^KT$\^D\M^E\M-Rt&\^O\M-6\0\M^D\M-@\^O\M^H\M^M\0\0\0\M^A\M-z\0 \0\0wh\M^C\M-z\^At"
21116 1 scp read(0x3, 0x7f7ff7b20000, 0x8000) = 32768
"\0\0\0\M^K}\0H\M^IT$\b\M-h\M-e\M-R\M^?\M^?H\M^KT$\b\M-i\\\M-~\M^?\M^?\M-8\240\^PB\0D\M^Kh\^XE\M^E\M-m\^O\M^D\M-f\M-~\M^?"
21116 1 scp write(0x6, 0x7f7ff7b20000, 0x8000) Err#35 EAGAIN
21116 1 scp poll(0x7f7fffffc180, 0x1, 0xffffffff) = 1
21116 1 scp write(0x6, 0x7f7ff7b20000, 0x8000) = 32768
"\0\0\0\M^K}\0H\M^IT$\b\M-h\M-e\M-R\M^?\M^?H\M^KT$\b\M-i\\\M-~\M^?\M^?\M-8\240\^PB\0D\M^Kh\^XE\M^E\M-m\^O\M^D\M-f\M-~\M^?"
21116 1 scp read(0x3, 0x7f7ff7b20000, 0x8000) = 32768
"\M-B8I\M^I\M-QI\M-A\M-A?M1\M-JI\M^I\M-QI\M-A\M-i\aM1\M-JI\^A\M-JL\^CT$@I\M^I\M-AI\M-A\M-A\^CH\M^I\M-AH\M-A\M-A-I1\M-IH"
21116 1 scp write(0x6, 0x7f7ff7b20000, 0x8000) Err#35 EAGAIN
21116 1 scp poll(0x7f7fffffc180, 0x1, 0xffffffff) = 1
21116 1 scp write(0x6, 0x7f7ff7b20000, 0x8000) = 32768
"\M-B8I\M^I\M-QI\M-A\M-A?M1\M-JI\M^I\M-QI\M-A\M-i\aM1\M-JI\^A\M-JL\^CT$@I\M^I\M-AI\M-A\M-A\^CH\M^I\M-AH\M-A\M-A-I1\M-IH"
21116 1 scp read(0x3, 0x7f7ff7b20000, 0x8000) = 32768
"cates are not supported\0%s: legacy ED25519 certificates are not supported\0\0\0\0\0\0\0Certificate invalid: not a host c"
21116 1 scp write(0x6, 0x7f7ff7b20000, 0x8000) = 32768
"cates are not supported\0%s: legacy ED25519 certificates are not supported\0\0\0\0\0\0\0Certificate invalid: not a host c"
21116 1 scp read(0x3, 0x7f7ff7b20000, 0x8000) = 32768
"\^_\0\0\0\M^R\0\0\0\^D\0\0\0\M-F\0\0\0\^E\0\0\0\M-v\0\0\0\M-_\0\0\0\M-!\0\0\0\M-L\0\0\0\^_\0\0\0\M^A\0\0\0\M-u\0\0\0\^N\0"
21116 1 scp write(0x6, 0x7f7ff7b20000, 0x8000) = 32768
"\^_\0\0\0\M^R\0\0\0\^D\0\0\0\M-F\0\0\0\^E\0\0\0\M-v\0\0\0\M-_\0\0\0\M-!\0\0\0\M-L\0\0\0\^_\0\0\0\M^A\0\0\0\M-u\0\0\0\^N\0"
21116 1 scp read(0x3, 0x7f7ff7b20000, 0x8000) = 32768
"\M->\0\0\0i\0\0\0\M^]\0\0\0\M-3\0\0\0\M->\0\0\0\b\0\0\0|\0\0\0*\0\0\0G\0\0\0\b\0\0\0\M-}\0\0\0\M-T\0\0\0\M-M\0\0\0\^N\0\0"
21116 1 scp write(0x6, 0x7f7ff7b20000, 0x8000) = 32768
"\M->\0\0\0i\0\0\0\M^]\0\0\0\M-3\0\0\0\M->\0\0\0\b\0\0\0|\0\0\0*\0\0\0G\0\0\0\b\0\0\0\M-}\0\0\0\M-T\0\0\0\M-M\0\0\0\^N\0\0"
21116 1 scp read(0x3, 0x7f7ff7b20000, 0x8000) = 32768
"\M-V\0\0\0\M-=\0\0\0\M^W\0\0\0z\0\0\0|\0\0\0u\0\0\0\M^F\0\0\0z\0\0\0%\0\0\0Z\0\0\0n\0\0\0|\0\0\0\M-e\0\0\0Q\0\0\0<\0\0\0"
21116 1 scp write(0x6, 0x7f7ff7b20000, 0x8000) Err#35 EAGAIN

Damien Miller

unread,
Jan 23, 2014, 7:04:01 PM1/23/14
to Hisashi T Fujinaka, OpenSSH Devel List, Darren Tucker
On Thu, 23 Jan 2014, Hisashi T Fujinaka wrote:

> > Cool, thanks. Let me know if there's anything else I can do on my end.
> > I'll be poking around in the processes.
>
> Does this tell you anything?
>
[snip]

It looks like it is copying as expected.

You don't happen to be running the tests on a slow NFS filesystem or
similar, do you?

-d

Hisashi T Fujinaka

unread,
Jan 23, 2014, 7:05:57 PM1/23/14
to Damien Miller, OpenSSH Devel List, Darren Tucker
On Fri, 24 Jan 2014, Damien Miller wrote:

> On Thu, 23 Jan 2014, Hisashi T Fujinaka wrote:
>
>>> Cool, thanks. Let me know if there's anything else I can do on my end.
>>> I'll be poking around in the processes.
>>
>> Does this tell you anything?
>>
> [snip]
>
> It looks like it is copying as expected.
>
> You don't happen to be running the tests on a slow NFS filesystem or
> similar, do you?

No, local SATA disk.

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Darren Tucker

unread,
Jan 24, 2014, 5:07:45 AM1/24/14
to Hisashi T Fujinaka, Damien Miller, OpenSSH Devel List
On Thu, Jan 23, 2014 at 04:05:57PM -0800, Hisashi T Fujinaka wrote:
[...]
> No, local SATA disk.

I'm stealing Damien's thunder here since he did most of the work
reproducing and figuring the out the problem, but since he seems to be
missing in action at the moment: we think we figured it out.

Short answer: please try the patch below.

Long answer:
atomicio is a wrapper function around read and write that ensures all of
the data intended to be read or written actually does. It does that by
passing a function pointer as its first argument, which it then calls for
the action. If the read or write returns EAGAIN, it uses poll() to wait
for the descriptor to become readable or writeable, which it decides by
looking at the function pointer. ccp uses atomicio.

What's happening is that in this case the passed function pointer is
not equal to atomicio's idea of of the address of the read function,
thus when we set the poll flags:

pfd.events = f == read ? POLLIN : POLLOUT;

it means that on the read side, when the buffer fills, it starts waiting
for it to be *writeable*. This doesn't happen and thus the the copy
stalls.

Why is the pointer different? It seems that enabling --stack-protector
or similar (which one did configure enable?) turns read() into a macro
that ends up calling a different function which presumably does some
extra checking.. Why doesn't this transform also apply to atomicio.o?
That part is not clear.

There doesn't seem to be any equivalent macro for write(), so inverting
the test seems to fix it for now. Longer term maybe we don't want to
use function pointers to pass what's essentially a boolean, but that
would be a larger change for another day after the release.

Thanks for your patience with this. It does seem like a genuine
problem, albeit with a somewhat obscure cause.

Index: atomicio.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/atomicio.c,v
retrieving revision 1.40
diff -u -p -r1.40 atomicio.c
--- atomicio.c 24 Sep 2010 12:15:11 -0000 1.40
+++ atomicio.c 24 Jan 2014 04:24:50 -0000
@@ -57,7 +57,7 @@ atomicio6(ssize_t (*f) (int, void *, siz
struct pollfd pfd;

pfd.fd = fd;
- pfd.events = f == read ? POLLIN : POLLOUT;
+ pfd.events = f == vwrite ? POLLOUT : POLLIN;
while (n > pos) {
res = (f) (fd, s + pos, n - pos);
switch (res) {

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Hisashi T Fujinaka

unread,
Jan 24, 2014, 11:54:40 AM1/24/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Fri, 24 Jan 2014, Darren Tucker wrote:

> I'm stealing Damien's thunder here since he did most of the work
> reproducing and figuring the out the problem, but since he seems to be
> missing in action at the moment: we think we figured it out.
>
> Short answer: please try the patch below.

> Index: atomicio.c
> ===================================================================
> RCS file: /home/dtucker/openssh/cvs/openssh/atomicio.c,v
> retrieving revision 1.40
> diff -u -p -r1.40 atomicio.c
> --- atomicio.c 24 Sep 2010 12:15:11 -0000 1.40
> +++ atomicio.c 24 Jan 2014 04:24:50 -0000
> @@ -57,7 +57,7 @@ atomicio6(ssize_t (*f) (int, void *, siz
> struct pollfd pfd;
>
> pfd.fd = fd;
> - pfd.events = f == read ? POLLIN : POLLOUT;
> + pfd.events = f == vwrite ? POLLOUT : POLLIN;
> while (n > pos) {
> res = (f) (fd, s + pos, n - pos);
> switch (res) {

I changed that one and also the one in atomiciov6 and I'm still getting
hangs. Actually, what I did was change one, got hangs, changed both, got
hangs. There are previous errors that might be part of it, like the
errors in malloc? I'm sure Damien's seen those, though.

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Damien Miller

unread,
Jan 24, 2014, 2:59:02 PM1/24/14
to Hisashi T Fujinaka, OpenSSH Devel List, Darren Tucker
On Fri, 24 Jan 2014, Hisashi T Fujinaka wrote:

> I changed that one and also the one in atomiciov6 and I'm still getting
> hangs. Actually, what I did was change one, got hangs, changed both, got
> hangs. There are previous errors that might be part of it, like the
> errors in malloc? I'm sure Damien's seen those, though.

You'll probably need this patch too, to make sure you are testing the
right scp - our regress tests were incorrectly testing the system one
rather than the one that was just built:


commit b0e0f760b861676a3fe5c40133b270713d5321a9
Author: Damien Miller <d...@mindrot.org>
Date: Fri Jan 24 14:27:04 2014 +1100

- (djm) [Makefile.in regress/scp-ssh-wrapper.sh regress/scp.sh] Make
the scp regress test actually test the built scp rather than the one
in $PATH. ok dtucker@

diff --git a/ChangeLog b/ChangeLog
index e352892..d928479 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+20130124
+ - (djm) [Makefile.in regress/scp-ssh-wrapper.sh regress/scp.sh] Make
+ the scp regress test actually test the built scp rather than the one
+ in $PATH. ok dtucker@
+
20130123
- (tim) [session.c] Improve error reporting on set_id().
- (dtucker) [configure.ac] NetBSD's (and FreeBSD's) strnvis is gratuitously
diff --git a/Makefile.in b/Makefile.in
index f5dd3b8..e3dfab2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.350 2014/01/17 05:47:04 djm Exp $
+# $Id: Makefile.in,v 1.351 2014/01/24 03:27:04 djm Exp $

# uncomment if you run a non bourne compatable shell. Ie. csh
#SHELL = @SH@
@@ -411,6 +411,7 @@ regress/setuid-allowed$(EXEEXT): $(srcdir)/regress/setuid-allowed.c
tests interop-tests: $(TARGETS) regress/modpipe$(EXEEXT)
BUILDDIR=`pwd`; \
TEST_SHELL="@TEST_SHELL@"; \
+ TEST_SSH_SCP="$${BUILDDIR}/scp"; \
TEST_SSH_SSH="$${BUILDDIR}/ssh"; \
TEST_SSH_SSHD="$${BUILDDIR}/sshd"; \
TEST_SSH_SSHAGENT="$${BUILDDIR}/ssh-agent"; \
@@ -434,6 +435,7 @@ tests interop-tests: $(TARGETS) regress/modpipe$(EXEEXT)
PATH="$${BUILDDIR}:$${PATH}" \
TEST_ENV=MALLOC_OPTIONS="@TEST_MALLOC_OPTIONS@" \
TEST_SHELL="$${TEST_SHELL}" \
+ TEST_SSH_SCP="$${TEST_SSH_SCP}" \
TEST_SSH_SSH="$${TEST_SSH_SSH}" \
TEST_SSH_SSHD="$${TEST_SSH_SSHD}" \
TEST_SSH_SSHAGENT="$${TEST_SSH_SSHAGENT}" \
diff --git a/regress/scp-ssh-wrapper.sh b/regress/scp-ssh-wrapper.sh
index d1005a9..c63bc2b 100644
--- a/regress/scp-ssh-wrapper.sh
+++ b/regress/scp-ssh-wrapper.sh
@@ -17,7 +17,7 @@ printname () {
}

# Discard all but last argument. We use arg later.
-while test "$1" != ""; do
+while test "x$1" != "x"; do
arg="$1"
shift
done
@@ -52,6 +52,8 @@ badserver_4)
echo "X"
;;
*)
- exec $arg
+ set -- $arg
+ shift
+ exec $SCP "$@"
;;
esac
diff --git a/regress/scp.sh b/regress/scp.sh
index 29c5b35..c2da2a8 100644
--- a/regress/scp.sh
+++ b/regress/scp.sh
@@ -20,6 +20,7 @@ SRC=`dirname ${SCRIPT}`
cp ${SRC}/scp-ssh-wrapper.sh ${OBJ}/scp-ssh-wrapper.scp
chmod 755 ${OBJ}/scp-ssh-wrapper.scp
scpopts="-q -S ${OBJ}/scp-ssh-wrapper.scp"
+export SCP # used in scp-ssh-wrapper.scp

scpclean() {
rm -rf ${COPY} ${COPY2} ${DIR} ${DIR2}

Hisashi T Fujinaka

unread,
Jan 24, 2014, 7:18:33 PM1/24/14
to Damien Miller, Darren Tucker, OpenSSH Devel List
On Sat, 25 Jan 2014, Damien Miller wrote:

> You'll probably need this patch too, to make sure you are testing the
> right scp - our regress tests were incorrectly testing the system one
> rather than the one that was just built:
>
>
> commit b0e0f760b861676a3fe5c40133b270713d5321a9

I think I'm doing something wrong because I'm still stuck at the copy.
Maybe I can get it to dump a core file.

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Damien Miller

unread,
Jan 24, 2014, 8:13:37 PM1/24/14
to Hisashi T Fujinaka, OpenSSH Devel List, Darren Tucker


On Fri, 24 Jan 2014, Hisashi T Fujinaka wrote:

> On Sat, 25 Jan 2014, Damien Miller wrote:
>
> > You'll probably need this patch too, to make sure you are testing the
> > right scp - our regress tests were incorrectly testing the system one
> > rather than the one that was just built:
> >
> >
> > commit b0e0f760b861676a3fe5c40133b270713d5321a9
>
> I think I'm doing something wrong because I'm still stuck at the copy.
> Maybe I can get it to dump a core file.

There will be two sftp processes run in the test - see if you can get
a core and ktrace from each. I used something like this (patch from
memory):


Index: regress/scp-ssh-wrapper.sh
===================================================================
RCS file: /var/cvs/openssh/regress/scp-ssh-wrapper.sh,v
retrieving revision 1.4
diff -u -p -r1.4 scp-ssh-wrapper.sh
--- regress/scp-ssh-wrapper.sh 24 Jan 2014 03:27:06 -0000 1.4
+++ regress/scp-ssh-wrapper.sh 25 Jan 2014 01:12:30 -0000
@@ -54,6 +54,6 @@ badserver_4)
*)
set -- $arg
shift
- exec $SCP "$@"
+ exec ktruss -o /tmp/scp-remote.ktrace $SCP "$@"
;;
esac
Index: regress/scp.sh
===================================================================
RCS file: /var/cvs/openssh/regress/scp.sh,v
retrieving revision 1.13
diff -u -p -r1.13 scp.sh
--- regress/scp.sh 24 Jan 2014 03:27:06 -0000 1.13
+++ regress/scp.sh 25 Jan 2014 01:13:12 -0000
@@ -29,63 +29,63 @@ scpclean() {

verbose "$tid: simple copy local file to local file"
scpclean
-$SCP $scpopts ${DATA} ${COPY} || fail "copy failed"
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts ${DATA} ${COPY} || fail "copy failed"
cmp ${DATA} ${COPY} || fail "corrupted copy"

verbose "$tid: simple copy local file to remote file"
scpclean
-$SCP $scpopts ${DATA} somehost:${COPY} || fail "copy failed"
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts ${DATA} somehost:${COPY} || fail "copy failed"
cmp ${DATA} ${COPY} || fail "corrupted copy"

verbose "$tid: simple copy remote file to local file"
scpclean
-$SCP $scpopts somehost:${DATA} ${COPY} || fail "copy failed"
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts somehost:${DATA} ${COPY} || fail "copy failed"
cmp ${DATA} ${COPY} || fail "corrupted copy"

verbose "$tid: simple copy local file to remote dir"
scpclean
cp ${DATA} ${COPY}
-$SCP $scpopts ${COPY} somehost:${DIR} || fail "copy failed"
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts ${COPY} somehost:${DIR} || fail "copy failed"
cmp ${COPY} ${DIR}/copy || fail "corrupted copy"

verbose "$tid: simple copy local file to local dir"
scpclean
cp ${DATA} ${COPY}
-$SCP $scpopts ${COPY} ${DIR} || fail "copy failed"
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts ${COPY} ${DIR} || fail "copy failed"
cmp ${COPY} ${DIR}/copy || fail "corrupted copy"

verbose "$tid: simple copy remote file to local dir"
scpclean
cp ${DATA} ${COPY}
-$SCP $scpopts somehost:${COPY} ${DIR} || fail "copy failed"
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts somehost:${COPY} ${DIR} || fail "copy failed"
cmp ${COPY} ${DIR}/copy || fail "corrupted copy"

verbose "$tid: recursive local dir to remote dir"
scpclean
rm -rf ${DIR2}
cp ${DATA} ${DIR}/copy
-$SCP $scpopts -r ${DIR} somehost:${DIR2} || fail "copy failed"
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts -r ${DIR} somehost:${DIR2} || fail "copy failed"
diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"

verbose "$tid: recursive local dir to local dir"
scpclean
rm -rf ${DIR2}
cp ${DATA} ${DIR}/copy
-$SCP $scpopts -r ${DIR} ${DIR2} || fail "copy failed"
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts -r ${DIR} ${DIR2} || fail "copy failed"
diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"

verbose "$tid: recursive remote dir to local dir"
scpclean
rm -rf ${DIR2}
cp ${DATA} ${DIR}/copy
-$SCP $scpopts -r somehost:${DIR} ${DIR2} || fail "copy failed"
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts -r somehost:${DIR} ${DIR2} || fail "copy failed"
diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"

verbose "$tid: shell metacharacters"
scpclean
(cd ${DIR} && \
touch '`touch metachartest`' && \
-$SCP $scpopts *metachar* ${DIR2} 2>/dev/null; \
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts *metachar* ${DIR2} 2>/dev/null; \
[ ! -f metachartest ] ) || fail "shell metacharacters"

if [ ! -z "$SUDO" ]; then
@@ -119,7 +119,7 @@ verbose "$tid: detect non-directory targ
scpclean
echo a > ${COPY}
echo b > ${COPY2}
-$SCP $scpopts ${DATA} ${COPY} ${COPY2}
+ktruss -o /tmp/scp-local.ktrace $SCP $scpopts ${DATA} ${COPY} ${COPY2}
cmp ${COPY} ${COPY2} >/dev/null && fail "corrupt target"

scpclean

Hisashi T Fujinaka

unread,
Jan 24, 2014, 8:26:01 PM1/24/14
to Damien Miller, OpenSSH Devel List, Darren Tucker
>> I think I'm doing something wrong because I'm still stuck at the copy.
>> Maybe I can get it to dump a core file.

Duh. No wonder I was getting nothing. I was looking in the wrong directory.

Here's what I have before the last patch.

htodd@mara:~/openssh2 > gdb scp regress/scp.core
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/htodd/openssh2/scp...done.
[New process 1]
Core was generated by `scp'.
Program terminated with signal 3, Quit.
#0 0x00007f7ff623b06a in poll () from /usr/lib/libc.so.12
(gdb) bt
#0 0x00007f7ff623b06a in poll () from /usr/lib/libc.so.12
#1 0x0000000000407f6d in atomicio6 (f=0x4027d3 <read>, fd=0, _s=0x7f7ff7b32000, n=32768, cb=0x402801 <scpio>,
cb_arg=0x7f7fffffbcb0) at atomicio.c:68
#2 0x00000000004039ee in sink (argc=<optimized out>, argv=<optimized out>) at scp.c:1107
#3 0x0000000000403d15 in sink (argc=<optimized out>, argv=<optimized out>) at scp.c:1071
#4 0x00000000004055ee in main (argc=<optimized out>, argv=<optimized out>) at scp.c:497
(gdb)

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Damien Miller

unread,
Jan 24, 2014, 9:24:43 PM1/24/14
to Hisashi T Fujinaka, OpenSSH Devel List, Darren Tucker
On Fri, 24 Jan 2014, Hisashi T Fujinaka wrote:

> > > I think I'm doing something wrong because I'm still stuck at the copy.
> > > Maybe I can get it to dump a core file.
>
> Duh. No wonder I was getting nothing. I was looking in the wrong directory.
>
> Here's what I have before the last patch.

Right - we know it is hanging in poll because pfd.events is being
set incorrectly when -fstack-protector redirects the 'read' function.
Darren's patch should fix that by testing against write instead.

If you are able to get gdb attached to each, then the following
info would help:

The test that is running and, for each scp process (there are two, one
started from scp.sh and another from scp-ssh-wrapper.sh) via gdb:

'up' until you are in atomicio6()
print f
print read
print write
print pfd.events

Hisashi T Fujinaka

unread,
Jan 24, 2014, 10:55:54 PM1/24/14
to Damien Miller, OpenSSH Devel List, Darren Tucker
On Sat, 25 Jan 2014, Damien Miller wrote:

> On Fri, 24 Jan 2014, Hisashi T Fujinaka wrote:
>
>>>> I think I'm doing something wrong because I'm still stuck at the copy.
>>>> Maybe I can get it to dump a core file.
>>
>> Duh. No wonder I was getting nothing. I was looking in the wrong directory.
>>
>> Here's what I have before the last patch.
>
> Right - we know it is hanging in poll because pfd.events is being
> set incorrectly when -fstack-protector redirects the 'read' function.
> Darren's patch should fix that by testing against write instead.
>
> If you are able to get gdb attached to each, then the following
> info would help:
>
> The test that is running and, for each scp process (there are two, one
> started from scp.sh and another from scp-ssh-wrapper.sh) via gdb:
>
> 'up' until you are in atomicio6()
> print f
> print read
> print write
> print pfd.events

I may have done this incorrectly, but here's what I saw.

ra:~/openssh > ps auxw | grep ssh
root 773 0.0 0.0 57544 3012 ? Is 8:15PM 0:00.01 /usr/sbin/sshd
root 780 0.0 0.1 76624 5952 ? Is 8:15PM 0:00.02 sshd: htodd [priv]
htodd 1041 0.0 0.0 76624 4152 ? S 8:15PM 0:01.38 sshd: htodd@pts/0 (sshd)
htodd 1045 0.0 0.0 19532 2452 ? Is 8:15PM 0:00.22 ssh-agent
htodd 804 0.0 0.0 13304 1524 pts/1 I+ 5:35PM 0:00.00 sh /home/htodd/openssh/regress/test-exec.sh /home/htodd/openssh/reg
htodd 8150 0.0 0.0 19344 2400 pts/1 I+ 5:35PM 0:00.00 /home/htodd/openssh/scp -q -S /home/htodd/openssh/regress/scp-ssh-w
htodd 26374 0.0 0.0 19344 2364 pts/1 I+ 5:35PM 0:00.00 /home/htodd/openssh/scp -t /home/htodd/openssh/regress/copy
htodd 21579 0.0 0.0 2240 48 pts/2 R+ 7:51PM 0:00.00 grep ssh
htodd@mara:~/openssh > gdb ssh
ssh ssh-agent ssh-keyscan ssh-pkcs11-helper
ssh-add ssh-keygen ssh-keysign sshd
htodd@mara:~/openssh > gdb ssh 8150
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/htodd/openssh/ssh...done.
Attaching to program: /home/htodd/openssh/ssh, process 8150
Reading symbols from /usr/libexec/ld.elf_so...Reading symbols from /usr/libdata/debug/libexec/ld.elf_so.debug...done.
done.
Loaded symbols for /usr/libexec/ld.elf_so
0x00007f7ff623b06a in .rtld_start () from /usr/libexec/ld.elf_so
(gdb) up
#1 0x0000000000407f6d in ssh_confirm_remote_forward (type=4203424, seq=<optimized out>, ctxt=0x6) at ssh.c:1230
1230 if (++remote_forward_confirms_received == options.num_remote_forwards) {
(gdb) up
#2 0x0000000000010000 in ?? ()
(gdb) up
#3 0x0000000000000000 in ?? ()
(gdb) up
Initial frame selected; you cannot go up.
(gdb) down
#2 0x0000000000010000 in ?? ()
(gdb) down
#1 0x0000000000407f6d in ssh_confirm_remote_forward (type=4203424, seq=<optimized out>, ctxt=0x6) at ssh.c:1230
1230 if (++remote_forward_confirms_received == options.num_remote_forwards) {
(gdb) print read
Cannot access memory at address 0x43fe00
(gdb) print write
$1 = {<text variable, no debug info>} 0x7f7ff624474a <write>
(gdb) q
A debugging session is active.

Inferior 1 [process 8150] will be detached.

Quit anyway? (y or n) y
Detaching from program: /home/htodd/openssh/ssh, process 8150
htodd@mara:~/openssh > gdb ssh 26374
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/htodd/openssh/ssh...done.
Attaching to program: /home/htodd/openssh/ssh, process 26374
Reading symbols from /usr/libexec/ld.elf_so...Reading symbols from /usr/libdata/debug/libexec/ld.elf_so.debug...done.
done.
Loaded symbols for /usr/libexec/ld.elf_so
0x00007f7ff623b06a in .rtld_start () from /usr/libexec/ld.elf_so
(gdb) up
#1 0x0000000000407f6d in ssh_confirm_remote_forward (type=4204499, seq=<optimized out>, ctxt=0x0) at ssh.c:1230
1230 if (++remote_forward_confirms_received == options.num_remote_forwards) {
(gdb) print read
Cannot access memory at address 0x43fe00
(gdb) print write
$1 = {<text variable, no debug info>} 0x7f7ff624474a <write>
(gdb) print pfd.events
No symbol "pfd" in current context.
(gdb) q
A debugging session is active.

Inferior 1 [process 26374] will be detached.

Quit anyway? (y or n) y
Detaching from program: /home/htodd/openssh/ssh, process 26374
htodd@mara:~/openssh >

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Darren Tucker

unread,
Jan 24, 2014, 11:14:57 PM1/24/14
to Hisashi T Fujinaka, Damien Miller, OpenSSH Devel List
Maybe there's something wrapping write() on your system too? Try adding
this to the start of atomicio.c:atomicio6():

printf(stderr, "read %x write %x argument %x\n", read, vwrite, f);

then compile it and run a small scp:

$ ./scp testfile localhost:/tmp/
read b73eced0 write b73ecf50 argument b73eced0

The patch below makes the first argument to atomicio an int rather than
a function pointer.

On the plus side: it also allows the removal of some hacks around
vwrite/writev. On the minus side: it's a large change albeit mostly
mechanical.

Index: atomicio.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/atomicio.c,v
retrieving revision 1.40
diff -u -p -r1.40 atomicio.c
--- atomicio.c 24 Sep 2010 12:15:11 -0000 1.40
+++ atomicio.c 25 Jan 2014 04:04:41 -0000
@@ -45,10 +45,10 @@
#include "atomicio.h"

/*
- * ensure all of data on socket comes through. f==read || f==vwrite
+ * ensure all of data on socket comes through.
*/
size_t
-atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n,
+atomicio6(int operation, int fd, void *_s, size_t n,
int (*cb)(void *, size_t), void *cb_arg)
{
char *s = _s;
@@ -57,9 +57,12 @@ atomicio6(ssize_t (*f) (int, void *, siz
struct pollfd pfd;

pfd.fd = fd;
- pfd.events = f == read ? POLLIN : POLLOUT;
+ pfd.events = operation == ATOMICIO_READ ? POLLIN : POLLOUT;
while (n > pos) {
- res = (f) (fd, s + pos, n - pos);
+ if (operation == ATOMICIO_READ)
+ res = read(fd, s + pos, n - pos);
+ else
+ res = write(fd, s + pos, n - pos);
switch (res) {
case -1:
if (errno == EINTR)
@@ -84,17 +87,16 @@ atomicio6(ssize_t (*f) (int, void *, siz
}

size_t
-atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
+atomicio(int operation, int fd, void *_s, size_t n)
{
- return atomicio6(f, fd, _s, n, NULL, NULL);
+ return atomicio6(operation, fd, _s, n, NULL, NULL);
}

/*
- * ensure all of data on socket comes through. f==readv || f==writev
+ * ensure all of data on socket comes through.
*/
size_t
-atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd,
- const struct iovec *_iov, int iovcnt,
+atomiciov6(int operation, int fd, const struct iovec *_iov, int iovcnt,
int (*cb)(void *, size_t), void *cb_arg)
{
size_t pos = 0, rem;
@@ -109,20 +111,20 @@ atomiciov6(ssize_t (*f) (int, const stru
/* Make a copy of the iov array because we may modify it below */
memcpy(iov, _iov, iovcnt * sizeof(*_iov));

-#ifndef BROKEN_READV_COMPARISON
pfd.fd = fd;
- pfd.events = f == readv ? POLLIN : POLLOUT;
-#endif
+ pfd.events = operation == ATOMICIO_READ ? POLLIN : POLLOUT;
+
for (; iovcnt > 0 && iov[0].iov_len > 0;) {
- res = (f) (fd, iov, iovcnt);
+ if (operation == ATOMICIO_READ)
+ res = readv(fd, iov, iovcnt);
+ else
+ res = writev(fd, iov, iovcnt);
switch (res) {
case -1:
if (errno == EINTR)
continue;
if (errno == EAGAIN || errno == EWOULDBLOCK) {
-#ifndef BROKEN_READV_COMPARISON
(void)poll(&pfd, 1, -1);
-#endif
continue;
}
return 0;
@@ -158,8 +160,8 @@ atomiciov6(ssize_t (*f) (int, const stru
}

size_t
-atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd,
+atomiciov(int operation, int fd,
const struct iovec *_iov, int iovcnt)
{
- return atomiciov6(f, fd, _iov, iovcnt, NULL, NULL);
+ return atomiciov6(operation, fd, _iov, iovcnt, NULL, NULL);
}
Index: atomicio.h
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/atomicio.h,v
retrieving revision 1.11
diff -u -p -r1.11 atomicio.h
--- atomicio.h 24 Sep 2010 12:15:11 -0000 1.11
+++ atomicio.h 25 Jan 2014 03:54:08 -0000
@@ -29,23 +29,21 @@
#ifndef _ATOMICIO_H
#define _ATOMICIO_H

+#define ATOMICIO_READ 0
+#define ATOMICIO_WRITE 1
+
/*
* Ensure all of data on socket comes through. f==read || f==vwrite
*/
-size_t
-atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n,
+size_t atomicio6(int operation, int fd, void *_s, size_t n,
int (*cb)(void *, size_t), void *);
-size_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t);
-
-#define vwrite (ssize_t (*)(int, void *, size_t))write
+size_t atomicio(int operation, int, void *, size_t);

/*
* ensure all of data on socket comes through. f==readv || f==writev
*/
-size_t
-atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd,
+size_t atomiciov6(int operation, int fd,
const struct iovec *_iov, int iovcnt, int (*cb)(void *, size_t), void *);
-size_t atomiciov(ssize_t (*)(int, const struct iovec *, int),
- int, const struct iovec *, int);
+size_t atomiciov(int operation, int, const struct iovec *, int);

#endif /* _ATOMICIO_H */
Index: auth2.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/auth2.c,v
retrieving revision 1.159
diff -u -p -r1.159 auth2.c
--- auth2.c 1 Jun 2013 21:41:51 -0000 1.159
+++ auth2.c 25 Jan 2014 03:54:07 -0000
@@ -126,7 +126,7 @@ auth2_read_banner(void)

len = (size_t)st.st_size; /* truncate */
banner = xmalloc(len + 1);
- n = atomicio(read, fd, banner, len);
+ n = atomicio(ATOMICIO_READ, fd, banner, len);
close(fd);

if (n != len) {
Index: authfd.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/authfd.c,v
retrieving revision 1.88
diff -u -p -r1.88 authfd.c
--- authfd.c 29 Dec 2013 06:49:56 -0000 1.88
+++ authfd.c 25 Jan 2014 03:54:11 -0000
@@ -134,8 +134,8 @@ ssh_request_reply(AuthenticationConnecti
put_u32(buf, len);

/* Send the length and then the packet to the agent. */
- if (atomicio(vwrite, auth->fd, buf, 4) != 4 ||
- atomicio(vwrite, auth->fd, buffer_ptr(request),
+ if (atomicio(ATOMICIO_WRITE, auth->fd, buf, 4) != 4 ||
+ atomicio(ATOMICIO_WRITE, auth->fd, buffer_ptr(request),
buffer_len(request)) != buffer_len(request)) {
error("Error writing to authentication socket.");
return 0;
@@ -144,7 +144,7 @@ ssh_request_reply(AuthenticationConnecti
* Wait for response from the agent. First read the length of the
* response packet.
*/
- if (atomicio(read, auth->fd, buf, 4) != 4) {
+ if (atomicio(ATOMICIO_READ, auth->fd, buf, 4) != 4) {
error("Error reading response length from authentication socket.");
return 0;
}
@@ -160,7 +160,7 @@ ssh_request_reply(AuthenticationConnecti
l = len;
if (l > sizeof(buf))
l = sizeof(buf);
- if (atomicio(read, auth->fd, buf, l) != l) {
+ if (atomicio(ATOMICIO_READ, auth->fd, buf, l) != l) {
error("Error reading response from authentication socket.");
return 0;
}
Index: authfile.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/authfile.c,v
retrieving revision 1.106
diff -u -p -r1.106 authfile.c
--- authfile.c 29 Dec 2013 06:50:15 -0000 1.106
+++ authfile.c 25 Jan 2014 03:54:12 -0000
@@ -568,7 +568,7 @@ key_save_private_blob(Buffer *keybuf, co
error("open %s failed: %s.", filename, strerror(errno));
return 0;
}
- if (atomicio(vwrite, fd, buffer_ptr(keybuf),
+ if (atomicio(ATOMICIO_WRITE, fd, buffer_ptr(keybuf),
buffer_len(keybuf)) != buffer_len(keybuf)) {
error("write to key file %s failed: %s", filename,
strerror(errno));
@@ -696,7 +696,7 @@ key_load_file(int fd, const char *filena
}
buffer_clear(blob);
for (;;) {
- if ((len = atomicio(read, fd, buf, sizeof(buf))) == 0) {
+ if ((len = atomicio(ATOMICIO_READ, fd, buf, sizeof(buf))) == 0) {
if (errno == EPIPE)
break;
debug("%s: read from key file %.200s%sfailed: %.100s",
Index: clientloop.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/clientloop.c,v
retrieving revision 1.245
diff -u -p -r1.245 clientloop.c
--- clientloop.c 21 Nov 2013 02:57:15 -0000 1.245
+++ clientloop.c 25 Jan 2014 03:54:08 -0000
@@ -687,10 +687,10 @@ client_suspend_self(Buffer *bin, Buffer
{
/* Flush stdout and stderr buffers. */
if (buffer_len(bout) > 0)
- atomicio(vwrite, fileno(stdout), buffer_ptr(bout),
+ atomicio(ATOMICIO_WRITE, fileno(stdout), buffer_ptr(bout),
buffer_len(bout));
if (buffer_len(berr) > 0)
- atomicio(vwrite, fileno(stderr), buffer_ptr(berr),
+ atomicio(ATOMICIO_WRITE, fileno(stderr), buffer_ptr(berr),
buffer_len(berr));

leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
@@ -1714,7 +1714,7 @@ client_loop(int have_pty, int escape_cha

/* Output any buffered data for stdout. */
if (buffer_len(&stdout_buffer) > 0) {
- len = atomicio(vwrite, fileno(stdout),
+ len = atomicio(ATOMICIO_WRITE, fileno(stdout),
buffer_ptr(&stdout_buffer), buffer_len(&stdout_buffer));
if (len < 0 || (u_int)len != buffer_len(&stdout_buffer))
error("Write failed flushing stdout buffer.");
@@ -1724,7 +1724,7 @@ client_loop(int have_pty, int escape_cha

/* Output any buffered data for stderr. */
if (buffer_len(&stderr_buffer) > 0) {
- len = atomicio(vwrite, fileno(stderr),
+ len = atomicio(ATOMICIO_WRITE, fileno(stderr),
buffer_ptr(&stderr_buffer), buffer_len(&stderr_buffer));
if (len < 0 || (u_int)len != buffer_len(&stderr_buffer))
error("Write failed flushing stderr buffer.");
Index: entropy.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/entropy.c,v
retrieving revision 1.63
diff -u -p -r1.63 entropy.c
--- entropy.c 30 Mar 2012 00:34:27 -0000 1.63
+++ entropy.c 25 Jan 2014 03:54:07 -0000
@@ -130,7 +130,7 @@ reopen:
msg[0] = 0x02;
msg[1] = len;

- if (atomicio(vwrite, fd, msg, sizeof(msg)) != sizeof(msg)) {
+ if (atomicio(ATOMICIO_WRITE, fd, msg, sizeof(msg)) != sizeof(msg)) {
if (errno == EPIPE && errors < 10) {
close(fd);
errors++;
@@ -141,7 +141,7 @@ reopen:
goto done;
}

- if (atomicio(read, fd, buf, len) != (size_t)len) {
+ if (atomicio(ATOMICIO_READ, fd, buf, len) != (size_t)len) {
if (errno == EPIPE && errors < 10) {
close(fd);
errors++;
Index: loginrec.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/loginrec.c,v
retrieving revision 1.94
diff -u -p -r1.94 loginrec.c
--- loginrec.c 17 Jan 2014 01:23:24 -0000 1.94
+++ loginrec.c 25 Jan 2014 03:54:08 -0000
@@ -886,7 +886,7 @@ utmp_write_direct(struct logininfo *li,
* If the new ut_line is empty but the old one is not
* and ut_line and ut_name match, preserve the old ut_line.
*/
- if (atomicio(read, fd, &old_ut, sizeof(old_ut)) == sizeof(old_ut) &&
+ if (atomicio(ATOMICIO_READ, fd, &old_ut, sizeof(old_ut)) == sizeof(old_ut) &&
(ut->ut_host[0] == '\0') && (old_ut.ut_host[0] != '\0') &&
(strncmp(old_ut.ut_line, ut->ut_line, sizeof(ut->ut_line)) == 0) &&
(strncmp(old_ut.ut_name, ut->ut_name, sizeof(ut->ut_name)) == 0))
@@ -903,7 +903,7 @@ utmp_write_direct(struct logininfo *li,
close(fd);
return (0);
}
- if (atomicio(vwrite, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
+ if (atomicio(ATOMICIO_WRITE, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
logit("%s: error writing %s: %s", __func__,
UTMP_FILE, strerror(errno));
close(fd);
@@ -1097,7 +1097,7 @@ wtmp_write(struct logininfo *li, struct
return (0);
}
if (fstat(fd, &buf) == 0)
- if (atomicio(vwrite, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
+ if (atomicio(ATOMICIO_WRITE, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
ftruncate(fd, buf.st_size);
logit("%s: problem writing %s: %s", __func__,
WTMP_FILE, strerror(errno));
@@ -1205,7 +1205,7 @@ wtmp_get_entry(struct logininfo *li)
}

while (!found) {
- if (atomicio(read, fd, &ut, sizeof(ut)) != sizeof(ut)) {
+ if (atomicio(ATOMICIO_READ, fd, &ut, sizeof(ut)) != sizeof(ut)) {
logit("%s: read of %s failed: %s", __func__,
WTMP_FILE, strerror(errno));
close (fd);
@@ -1270,7 +1270,7 @@ wtmpx_write(struct logininfo *li, struct
}

if (fstat(fd, &buf) == 0)
- if (atomicio(vwrite, fd, utx, sizeof(*utx)) != sizeof(*utx)) {
+ if (atomicio(ATOMICIO_WRITE, fd, utx, sizeof(*utx)) != sizeof(*utx)) {
ftruncate(fd, buf.st_size);
logit("%s: problem writing %s: %s", __func__,
WTMPX_FILE, strerror(errno));
@@ -1370,7 +1370,7 @@ wtmpx_get_entry(struct logininfo *li)
}

while (!found) {
- if (atomicio(read, fd, &utx, sizeof(utx)) != sizeof(utx)) {
+ if (atomicio(ATOMICIO_READ, fd, &utx, sizeof(utx)) != sizeof(utx)) {
logit("%s: read of %s failed: %s", __func__,
WTMPX_FILE, strerror(errno));
close (fd);
@@ -1548,7 +1548,7 @@ lastlog_write_entry(struct logininfo *li
return (0);

/* write the entry */
- if (atomicio(vwrite, fd, &last, sizeof(last)) != sizeof(last)) {
+ if (atomicio(ATOMICIO_WRITE, fd, &last, sizeof(last)) != sizeof(last)) {
close(fd);
logit("%s: Error writing to %s: %s", __func__,
LASTLOG_FILE, strerror(errno));
@@ -1591,7 +1591,7 @@ lastlog_get_entry(struct logininfo *li)
if (!lastlog_openseek(li, &fd, O_RDONLY))
return (0);

- ret = atomicio(read, fd, &last, sizeof(last));
+ ret = atomicio(ATOMICIO_READ, fd, &last, sizeof(last));
close(fd);

switch (ret) {
@@ -1716,7 +1716,7 @@ record_failed_login(const char *username
#endif
}

- if (atomicio(vwrite, fd, &ut, sizeof(ut)) != sizeof(ut))
+ if (atomicio(ATOMICIO_WRITE, fd, &ut, sizeof(ut)) != sizeof(ut))
error("Failed to write to %s: %s", _PATH_BTMP,
strerror(errno));

Index: monitor.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/monitor.c,v
retrieving revision 1.166
diff -u -p -r1.166 monitor.c
--- monitor.c 7 Nov 2013 02:32:52 -0000 1.166
+++ monitor.c 25 Jan 2014 03:54:07 -0000
@@ -520,7 +520,7 @@ monitor_read_log(struct monitor *pmonito

/* Read length */
buffer_append_space(&logmsg, 4);
- if (atomicio(read, pmonitor->m_log_recvfd,
+ if (atomicio(ATOMICIO_READ, pmonitor->m_log_recvfd,
buffer_ptr(&logmsg), buffer_len(&logmsg)) != buffer_len(&logmsg)) {
if (errno == EPIPE) {
buffer_free(&logmsg);
@@ -538,7 +538,7 @@ monitor_read_log(struct monitor *pmonito
/* Read severity, message */
buffer_clear(&logmsg);
buffer_append_space(&logmsg, len);
- if (atomicio(read, pmonitor->m_log_recvfd,
+ if (atomicio(ATOMICIO_READ, pmonitor->m_log_recvfd,
buffer_ptr(&logmsg), buffer_len(&logmsg)) != buffer_len(&logmsg))
fatal("%s: log fd read: %s", __func__, strerror(errno));

Index: monitor_wrap.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/monitor_wrap.c,v
retrieving revision 1.95
diff -u -p -r1.95 monitor_wrap.c
--- monitor_wrap.c 7 Nov 2013 02:35:39 -0000 1.95
+++ monitor_wrap.c 25 Jan 2014 03:54:12 -0000
@@ -108,7 +108,7 @@ mm_log_handler(LogLevel level, const cha
buffer_put_int(&log_msg, level);
buffer_put_cstring(&log_msg, msg);
put_u32(buffer_ptr(&log_msg), buffer_len(&log_msg) - 4);
- if (atomicio(vwrite, mon->m_log_sendfd, buffer_ptr(&log_msg),
+ if (atomicio(ATOMICIO_WRITE, mon->m_log_sendfd, buffer_ptr(&log_msg),
buffer_len(&log_msg)) != buffer_len(&log_msg))
fatal("%s: write: %s", __func__, strerror(errno));
buffer_free(&log_msg);
@@ -134,9 +134,9 @@ mm_request_send(int sock, enum monitor_r

put_u32(buf, mlen + 1);
buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */
- if (atomicio(vwrite, sock, buf, sizeof(buf)) != sizeof(buf))
+ if (atomicio(ATOMICIO_WRITE, sock, buf, sizeof(buf)) != sizeof(buf))
fatal("%s: write: %s", __func__, strerror(errno));
- if (atomicio(vwrite, sock, buffer_ptr(m), mlen) != mlen)
+ if (atomicio(ATOMICIO_WRITE, sock, buffer_ptr(m), mlen) != mlen)
fatal("%s: write: %s", __func__, strerror(errno));
}

@@ -148,7 +148,7 @@ mm_request_receive(int sock, Buffer *m)

debug3("%s entering", __func__);

- if (atomicio(read, sock, buf, sizeof(buf)) != sizeof(buf)) {
+ if (atomicio(ATOMICIO_READ, sock, buf, sizeof(buf)) != sizeof(buf)) {
if (errno == EPIPE)
cleanup_exit(255);
fatal("%s: read: %s", __func__, strerror(errno));
@@ -158,7 +158,7 @@ mm_request_receive(int sock, Buffer *m)
fatal("%s: read: bad msg_len %d", __func__, msg_len);
buffer_clear(m);
buffer_append_space(m, msg_len);
- if (atomicio(read, sock, buffer_ptr(m), msg_len) != msg_len)
+ if (atomicio(ATOMICIO_READ, sock, buffer_ptr(m), msg_len) != msg_len)
fatal("%s: read: %s", __func__, strerror(errno));
}

Index: msg.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/msg.c,v
retrieving revision 1.16
diff -u -p -r1.16 msg.c
--- msg.c 5 Aug 2006 02:39:40 -0000 1.16
+++ msg.c 25 Jan 2014 03:54:06 -0000
@@ -50,11 +50,11 @@ ssh_msg_send(int fd, u_char type, Buffer

put_u32(buf, mlen + 1);
buf[4] = type; /* 1st byte of payload is mesg-type */
- if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf)) {
+ if (atomicio(ATOMICIO_WRITE, fd, buf, sizeof(buf)) != sizeof(buf)) {
error("ssh_msg_send: write");
return (-1);
}
- if (atomicio(vwrite, fd, buffer_ptr(m), mlen) != mlen) {
+ if (atomicio(ATOMICIO_WRITE, fd, buffer_ptr(m), mlen) != mlen) {
error("ssh_msg_send: write");
return (-1);
}
@@ -69,7 +69,7 @@ ssh_msg_recv(int fd, Buffer *m)

debug3("ssh_msg_recv entering");

- if (atomicio(read, fd, buf, sizeof(buf)) != sizeof(buf)) {
+ if (atomicio(ATOMICIO_READ, fd, buf, sizeof(buf)) != sizeof(buf)) {
if (errno != EPIPE)
error("ssh_msg_recv: read: header");
return (-1);
@@ -81,7 +81,7 @@ ssh_msg_recv(int fd, Buffer *m)
}
buffer_clear(m);
buffer_append_space(m, msg_len);
- if (atomicio(read, fd, buffer_ptr(m), msg_len) != msg_len) {
+ if (atomicio(ATOMICIO_READ, fd, buffer_ptr(m), msg_len) != msg_len) {
error("ssh_msg_recv: read: %s", strerror(errno));
return (-1);
}
Index: progressmeter.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/progressmeter.c,v
retrieving revision 1.41
diff -u -p -r1.41 progressmeter.c
--- progressmeter.c 9 Oct 2013 23:25:10 -0000 1.41
+++ progressmeter.c 25 Jan 2014 03:54:09 -0000
@@ -223,7 +223,7 @@ refresh_progress_meter(void)
strlcat(buf, " ", win_size);
}

- atomicio(vwrite, STDOUT_FILENO, buf, win_size - 1);
+ atomicio(ATOMICIO_WRITE, STDOUT_FILENO, buf, win_size - 1);
last_update = now;
}

@@ -280,7 +280,7 @@ stop_progress_meter(void)
if (cur_pos != end_pos)
refresh_progress_meter();

- atomicio(vwrite, STDOUT_FILENO, "\n", 1);
+ atomicio(ATOMICIO_WRITE, STDOUT_FILENO, "\n", 1);
}

/*ARGSUSED*/
Index: roaming.h
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/roaming.h,v
retrieving revision 1.5
diff -u -p -r1.5 roaming.h
--- roaming.h 18 Dec 2011 23:52:52 -0000 1.5
+++ roaming.h 25 Jan 2014 03:54:06 -0000
@@ -34,7 +34,7 @@ void roaming_reply(int, u_int32_t, void
void set_out_buffer_size(size_t);
ssize_t roaming_write(int, const void *, size_t, int *);
ssize_t roaming_read(int, void *, size_t, int *);
-size_t roaming_atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t);
+size_t roaming_atomicio(int, int, void *, size_t);
u_int64_t get_recv_bytes(void);
u_int64_t get_sent_bytes(void);
void roam_set_bytes(u_int64_t, u_int64_t);
Index: roaming_common.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/roaming_common.c,v
retrieving revision 1.11
diff -u -p -r1.11 roaming_common.c
--- roaming_common.c 9 Jan 2014 23:58:53 -0000 1.11
+++ roaming_common.c 25 Jan 2014 03:54:12 -0000
@@ -183,14 +183,14 @@ roaming_read(int fd, void *buf, size_t c
}

size_t
-roaming_atomicio(ssize_t(*f)(int, void*, size_t), int fd, void *buf,
+roaming_atomicio(int op, int fd, void *buf,
size_t count)
{
- size_t ret = atomicio(f, fd, buf, count);
+ size_t ret = atomicio(op, fd, buf, count);

- if (f == vwrite && ret > 0 && !resume_in_progress) {
+ if (op == ATOMICIO_WRITE && ret > 0 && !resume_in_progress) {
write_bytes += ret;
- } else if (f == read && ret > 0 && !resume_in_progress) {
+ } else if (op == ATOMICIO_WRITE && ret > 0 && !resume_in_progress) {
read_bytes += ret;
}
return ret;
@@ -212,11 +212,11 @@ resend_bytes(int fd, u_int64_t *offset)
fatal("Needed to resend more data than in the cache");
if (out_last < needed) {
int chunkend = needed - out_last;
- atomicio(vwrite, fd, out_buf + out_buf_size - chunkend,
+ atomicio(ATOMICIO_WRITE, fd, out_buf + out_buf_size - chunkend,
chunkend);
- atomicio(vwrite, fd, out_buf, out_last);
+ atomicio(ATOMICIO_WRITE, fd, out_buf, out_last);
} else {
- atomicio(vwrite, fd, out_buf + (out_last - needed), needed);
+ atomicio(ATOMICIO_WRITE, fd, out_buf + (out_last - needed), needed);
}
}

Index: scp.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/scp.c,v
retrieving revision 1.198
diff -u -p -r1.198 scp.c
--- scp.c 21 Nov 2013 02:56:49 -0000 1.198
+++ scp.c 25 Jan 2014 03:54:06 -0000
@@ -564,7 +564,7 @@ do_times(int fd, int verb, const struct
(long long)sb->st_mtime, (long long)sb->st_atime);
fprintf(stderr, "Sending file timestamps: %s", buf);
}
- (void) atomicio(vwrite, fd, buf, strlen(buf));
+ (void) atomicio(ATOMICIO_WRITE, fd, buf, strlen(buf));
return (response());
}

@@ -802,7 +802,7 @@ syserr: run_err("%s: %s", name, strerr
if (verbose_mode) {
fprintf(stderr, "Sending file modes: %s", buf);
}
- (void) atomicio(vwrite, remout, buf, strlen(buf));
+ (void) atomicio(ATOMICIO_WRITE, remout, buf, strlen(buf));
if (response() < 0)
goto next;
if ((bp = allocbuf(&buffer, fd, COPY_BUFLEN)) == NULL) {
@@ -820,16 +820,16 @@ next: if (fd != -1) {
if (i + (off_t)amt > stb.st_size)
amt = stb.st_size - i;
if (!haderr) {
- if (atomicio(read, fd, bp->buf, amt) != amt)
+ if (atomicio(ATOMICIO_READ, fd, bp->buf, amt) != amt)
haderr = errno;
}
/* Keep writing after error to retain sync */
if (haderr) {
- (void)atomicio(vwrite, remout, bp->buf, amt);
+ (void)atomicio(ATOMICIO_WRITE, remout, bp->buf, amt);
continue;
}
- if (atomicio6(vwrite, remout, bp->buf, amt, scpio,
- &statbytes) != amt)
+ if (atomicio6(ATOMICIO_WRITE, remout, bp->buf, amt,
+ scpio, &statbytes) != amt)
haderr = errno;
}
unset_nonblock(remout);
@@ -842,7 +842,7 @@ next: if (fd != -1) {
fd = -1;
}
if (!haderr)
- (void) atomicio(vwrite, remout, "", 1);
+ (void) atomicio(ATOMICIO_WRITE, remout, "", 1);
else
run_err("%s: %s", name, strerror(haderr));
(void) response();
@@ -875,7 +875,7 @@ rsource(char *name, struct stat *statp)
(u_int) (statp->st_mode & FILEMODEMASK), 0, last);
if (verbose_mode)
fprintf(stderr, "Entering directory: %s", path);
- (void) atomicio(vwrite, remout, path, strlen(path));
+ (void) atomicio(ATOMICIO_WRITE, remout, path, strlen(path));
if (response() < 0) {
closedir(dirp);
return;
@@ -894,7 +894,7 @@ rsource(char *name, struct stat *statp)
source(1, vect);
}
(void) closedir(dirp);
- (void) atomicio(vwrite, remout, "E\n", 2);
+ (void) atomicio(ATOMICIO_WRITE, remout, "E\n", 2);
(void) response();
}

@@ -933,17 +933,17 @@ sink(int argc, char **argv)
if (targetshouldbedirectory)
verifydir(targ);

- (void) atomicio(vwrite, remout, "", 1);
+ (void) atomicio(ATOMICIO_WRITE, remout, "", 1);
if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode))
targisdir = 1;
for (first = 1;; first = 0) {
cp = buf;
- if (atomicio(read, remin, cp, 1) != 1)
+ if (atomicio(ATOMICIO_READ, remin, cp, 1) != 1)
return;
if (*cp++ == '\n')
SCREWUP("unexpected <newline>");
do {
- if (atomicio(read, remin, &ch, sizeof(ch)) != sizeof(ch))
+ if (atomicio(ATOMICIO_READ, remin, &ch, sizeof(ch)) != sizeof(ch))
SCREWUP("lost connection");
*cp++ = ch;
} while (cp < &buf[sizeof(buf) - 1] && ch != '\n');
@@ -953,7 +953,7 @@ sink(int argc, char **argv)

if (buf[0] == '\01' || buf[0] == '\02') {
if (iamremote == 0)
- (void) atomicio(vwrite, STDERR_FILENO,
+ (void) atomicio(ATOMICIO_WRITE, STDERR_FILENO,
buf + 1, strlen(buf + 1));
if (buf[0] == '\02')
exit(1);
@@ -961,7 +961,7 @@ sink(int argc, char **argv)
continue;
}
if (buf[0] == 'E') {
- (void) atomicio(vwrite, remout, "", 1);
+ (void) atomicio(ATOMICIO_WRITE, remout, "", 1);
return;
}
if (ch == '\n')
@@ -997,7 +997,7 @@ sink(int argc, char **argv)
if (!cp || *cp++ != '\0' || atime.tv_usec < 0 ||
atime.tv_usec > 999999)
SCREWUP("atime.usec not delimited");
- (void) atomicio(vwrite, remout, "", 1);
+ (void) atomicio(ATOMICIO_WRITE, remout, "", 1);
continue;
}
if (*cp != 'C' && *cp != 'D') {
@@ -1086,7 +1086,7 @@ sink(int argc, char **argv)
bad: run_err("%s: %s", np, strerror(errno));
continue;
}
- (void) atomicio(vwrite, remout, "", 1);
+ (void) atomicio(ATOMICIO_WRITE, remout, "", 1);
if ((bp = allocbuf(&buffer, ofd, COPY_BUFLEN)) == NULL) {
(void) close(ofd);
continue;
@@ -1104,7 +1104,7 @@ bad: run_err("%s: %s", np, strerror(er
amt = size - i;
count += amt;
do {
- j = atomicio6(read, remin, cp, amt,
+ j = atomicio6(ATOMICIO_READ, remin, cp, amt,
scpio, &statbytes);
if (j == 0) {
run_err("%s", j != EPIPE ?
@@ -1119,7 +1119,7 @@ bad: run_err("%s: %s", np, strerror(er
if (count == bp->cnt) {
/* Keep reading so we stay sync'd up. */
if (wrerr == NO) {
- if (atomicio(vwrite, ofd, bp->buf,
+ if (atomicio(ATOMICIO_WRITE, ofd, bp->buf,
count) != count) {
wrerr = YES;
wrerrno = errno;
@@ -1133,7 +1133,7 @@ bad: run_err("%s: %s", np, strerror(er
if (showprogress)
stop_progress_meter();
if (count != 0 && wrerr == NO &&
- atomicio(vwrite, ofd, bp->buf, count) != count) {
+ atomicio(ATOMICIO_WRITE, ofd, bp->buf, count) != count) {
wrerr = YES;
wrerrno = errno;
}
@@ -1183,7 +1183,7 @@ bad: run_err("%s: %s", np, strerror(er
run_err("%s: %s", np, strerror(wrerrno));
break;
case NO:
- (void) atomicio(vwrite, remout, "", 1);
+ (void) atomicio(ATOMICIO_WRITE, remout, "", 1);
break;
case DISPLAYED:
break;
@@ -1199,7 +1199,7 @@ response(void)
{
char ch, *cp, resp, rbuf[2048];

- if (atomicio(read, remin, &resp, sizeof(resp)) != sizeof(resp))
+ if (atomicio(ATOMICIO_READ, remin, &resp, sizeof(resp)) != sizeof(resp))
lostconn(0);

cp = rbuf;
@@ -1212,13 +1212,13 @@ response(void)
case 1: /* error, followed by error msg */
case 2: /* fatal error, "" */
do {
- if (atomicio(read, remin, &ch, sizeof(ch)) != sizeof(ch))
+ if (atomicio(ATOMICIO_READ, remin, &ch, sizeof(ch)) != sizeof(ch))
lostconn(0);
*cp++ = ch;
} while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n');

if (!iamremote)
- (void) atomicio(vwrite, STDERR_FILENO, rbuf, cp - rbuf);
+ (void) atomicio(ATOMICIO_WRITE, STDERR_FILENO, rbuf, cp - rbuf);
++errs;
if (resp == 1)
return (-1);
Index: sftp-client.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/sftp-client.c,v
retrieving revision 1.126
diff -u -p -r1.126 sftp-client.c
--- sftp-client.c 17 Jan 2014 05:29:46 -0000 1.126
+++ sftp-client.c 25 Jan 2014 03:57:54 -0000
@@ -113,7 +113,7 @@ send_msg(struct sftp_conn *conn, Buffer
iov[1].iov_base = buffer_ptr(m);
iov[1].iov_len = buffer_len(m);

- if (atomiciov6(writev, conn->fd_out, iov, 2,
+ if (atomiciov6(ATOMICIO_WRITE, conn->fd_out, iov, 2,
conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_out) !=
buffer_len(m) + sizeof(mlen))
fatal("Couldn't send packet: %s", strerror(errno));
@@ -127,7 +127,7 @@ get_msg(struct sftp_conn *conn, Buffer *
u_int msg_len;

buffer_append_space(m, 4);
- if (atomicio6(read, conn->fd_in, buffer_ptr(m), 4,
+ if (atomicio6(ATOMICIO_READ, conn->fd_in, buffer_ptr(m), 4,
conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_in) != 4) {
if (errno == EPIPE)
fatal("Connection closed");
@@ -140,7 +140,7 @@ get_msg(struct sftp_conn *conn, Buffer *
fatal("Received message too long %u", msg_len);

buffer_append_space(m, msg_len);
- if (atomicio6(read, conn->fd_in, buffer_ptr(m), msg_len,
+ if (atomicio6(ATOMICIO_READ, conn->fd_in, buffer_ptr(m), msg_len,
conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_in)
!= msg_len) {
if (errno == EPIPE)
@@ -1194,7 +1194,7 @@ do_download(struct sftp_conn *conn, char
fatal("Received more data than asked for "
"%u > %u", len, req->len);
if ((lseek(local_fd, req->offset, SEEK_SET) == -1 ||
- atomicio(vwrite, local_fd, data, len) != len) &&
+ atomicio(ATOMICIO_WRITE, local_fd, data, len) != len) &&
!write_error) {
write_errno = errno;
write_error = 1;
Index: ssh-keygen.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/ssh-keygen.c,v
retrieving revision 1.258
diff -u -p -r1.258 ssh-keygen.c
--- ssh-keygen.c 7 Dec 2013 00:24:02 -0000 1.258
+++ ssh-keygen.c 25 Jan 2014 03:54:06 -0000
@@ -2109,7 +2109,7 @@ do_gen_krl(struct passwd *pw, int updati
fatal("Couldn't generate KRL");
if ((fd = open(identity_file, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1)
fatal("open %s: %s", identity_file, strerror(errno));
- if (atomicio(vwrite, fd, buffer_ptr(&kbuf), buffer_len(&kbuf)) !=
+ if (atomicio(ATOMICIO_WRITE, fd, buffer_ptr(&kbuf), buffer_len(&kbuf)) !=
buffer_len(&kbuf))
fatal("write %s: %s", identity_file, strerror(errno));
close(fd);
Index: ssh-keyscan.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/ssh-keyscan.c,v
retrieving revision 1.110
diff -u -p -r1.110 ssh-keyscan.c
--- ssh-keyscan.c 7 Dec 2013 00:24:02 -0000 1.110
+++ ssh-keyscan.c 25 Jan 2014 03:54:07 -0000
@@ -412,7 +412,7 @@ congreet(int s)
bufsiz = sizeof(buf);
cp = buf;
while (bufsiz-- &&
- (n = atomicio(read, s, cp, 1)) == 1 && *cp != '\n') {
+ (n = atomicio(ATOMICIO_READ, s, cp, 1)) == 1 && *cp != '\n') {
if (*cp == '\r')
*cp = '\n';
cp++;
@@ -465,7 +465,7 @@ congreet(int s)
confree(s);
return;
}
- if (atomicio(vwrite, s, buf, n) != (size_t)n) {
+ if (atomicio(ATOMICIO_WRITE, s, buf, n) != (size_t)n) {
error("write (%s): %s", c->c_name, strerror(errno));
confree(s);
return;
@@ -489,7 +489,7 @@ conread(int s)
congreet(s);
return;
}
- n = atomicio(read, s, c->c_data + c->c_off, c->c_len - c->c_off);
+ n = atomicio(ATOMICIO_READ, s, c->c_data + c->c_off, c->c_len - c->c_off);
if (n == 0) {
error("read (%s): %s", c->c_name, strerror(errno));
confree(s);
Index: ssh-pkcs11-client.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/ssh-pkcs11-client.c,v
retrieving revision 1.6
diff -u -p -r1.6 ssh-pkcs11-client.c
--- ssh-pkcs11-client.c 1 Jun 2013 21:31:19 -0000 1.6
+++ ssh-pkcs11-client.c 25 Jan 2014 03:54:08 -0000
@@ -52,8 +52,8 @@ send_msg(Buffer *m)
int mlen = buffer_len(m);

put_u32(buf, mlen);
- if (atomicio(vwrite, fd, buf, 4) != 4 ||
- atomicio(vwrite, fd, buffer_ptr(m),
+ if (atomicio(ATOMICIO_WRITE, fd, buf, 4) != 4 ||
+ atomicio(ATOMICIO_WRITE, fd, buffer_ptr(m),
buffer_len(m)) != buffer_len(m))
error("write to helper failed");
buffer_consume(m, mlen);
@@ -65,7 +65,7 @@ recv_msg(Buffer *m)
u_int l, len;
u_char buf[1024];

- if ((len = atomicio(read, fd, buf, 4)) != 4) {
+ if ((len = atomicio(ATOMICIO_READ, fd, buf, 4)) != 4) {
error("read from helper failed: %u", len);
return (0); /* XXX */
}
@@ -78,7 +78,7 @@ recv_msg(Buffer *m)
l = len;
if (l > sizeof(buf))
l = sizeof(buf);
- if (atomicio(read, fd, buf, l) != l) {
+ if (atomicio(ATOMICIO_READ, fd, buf, l) != l) {
error("response from helper failed.");
return (0); /* XXX */
}
Index: sshconnect.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/sshconnect.c,v
retrieving revision 1.217
diff -u -p -r1.217 sshconnect.c
--- sshconnect.c 9 Jan 2014 23:59:24 -0000 1.217
+++ sshconnect.c 25 Jan 2014 03:54:12 -0000
@@ -522,7 +522,7 @@ send_client_banner(int connection_out, i
xasprintf(&client_version_string, "SSH-%d.%d-%.100s\n",
PROTOCOL_MAJOR_1, minor1, SSH_VERSION);
}
- if (roaming_atomicio(vwrite, connection_out, client_version_string,
+ if (roaming_atomicio(ATOMICIO_WRITE, connection_out, client_version_string,
strlen(client_version_string)) != strlen(client_version_string))
fatal("write: %.100s", strerror(errno));
chop(client_version_string);
@@ -582,7 +582,7 @@ ssh_exchange_identification(int timeout_
}
}

- len = roaming_atomicio(read, connection_in, &buf[i], 1);
+ len = roaming_atomicio(ATOMICIO_READ, connection_in, &buf[i], 1);

if (len != 1 && errno == EPIPE)
fatal("ssh_exchange_identification: "
Index: sshd.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/sshd.c,v
retrieving revision 1.441
diff -u -p -r1.441 sshd.c
--- sshd.c 17 Jan 2014 05:47:04 -0000 1.441
+++ sshd.c 25 Jan 2014 03:54:06 -0000
@@ -441,7 +441,7 @@ sshd_exchange_identification(int sock_in
options.version_addendum, newline);

/* Send our protocol version identification. */
- if (roaming_atomicio(vwrite, sock_out, server_version_string,
+ if (roaming_atomicio(ATOMICIO_WRITE, sock_out, server_version_string,
strlen(server_version_string))
!= strlen(server_version_string)) {
logit("Could not write ident string to %s", get_remote_ipaddr());
@@ -451,7 +451,7 @@ sshd_exchange_identification(int sock_in
/* Read other sides version identification. */
memset(buf, 0, sizeof(buf));
for (i = 0; i < sizeof(buf) - 1; i++) {
- if (roaming_atomicio(read, sock_in, &buf[i], 1) != 1) {
+ if (roaming_atomicio(ATOMICIO_READ, sock_in, &buf[i], 1) != 1) {
logit("Did not receive identification string from %s",
get_remote_ipaddr());
cleanup_exit(255);
@@ -479,7 +479,7 @@ sshd_exchange_identification(int sock_in
if (sscanf(client_version_string, "SSH-%d.%d-%[^\n]\n",
&remote_major, &remote_minor, remote_version) != 3) {
s = "Protocol mismatch.\n";
- (void) atomicio(vwrite, sock_out, s, strlen(s));
+ (void) atomicio(ATOMICIO_WRITE, sock_out, s, strlen(s));
logit("Bad protocol version identification '%.100s' "
"from %s port %d", client_version_string,
get_remote_ipaddr(), get_remote_port());
@@ -548,7 +548,7 @@ sshd_exchange_identification(int sock_in

if (mismatch) {
s = "Protocol major versions differ.\n";
- (void) atomicio(vwrite, sock_out, s, strlen(s));
+ (void) atomicio(ATOMICIO_WRITE, sock_out, s, strlen(s));
close(sock_in);
close(sock_out);
logit("Protocol major versions differ for %s: %.200s vs. %.200s",

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Damien Miller

unread,
Jan 24, 2014, 11:51:31 PM1/24/14
to Darren Tucker, OpenSSH Devel List, Hisashi T Fujinaka
On Sat, 25 Jan 2014, Darren Tucker wrote:

> Maybe there's something wrapping write() on your system too? Try adding
> this to the start of atomicio.c:atomicio6():
>
> printf(stderr, "read %x write %x argument %x\n", read, vwrite, f);
>
> then compile it and run a small scp:
>
> $ ./scp testfile localhost:/tmp/
> read b73eced0 write b73ecf50 argument b73eced0
>
> The patch below makes the first argument to atomicio an int rather than
> a function pointer.
>
> On the plus side: it also allows the removal of some hacks around
> vwrite/writev. On the minus side: it's a large change albeit mostly
> mechanical.

IMO it would be better to s/atomicio[(v]*/_/ - i.e. do a separate
atomicio_read and atomicio_write (that could use the flags internally).

-d

Hisashi T Fujinaka

unread,
Jan 24, 2014, 11:52:19 PM1/24/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Sat, 25 Jan 2014, Darren Tucker wrote:

> Maybe there's something wrapping write() on your system too? Try adding
> this to the start of atomicio.c:atomicio6():
>
> printf(stderr, "read %x write %x argument %x\n", read, vwrite, f);
>
> then compile it and run a small scp:
>
> $ ./scp testfile localhost:/tmp/
> read b73eced0 write b73ecf50 argument b73eced0
>
> The patch below makes the first argument to atomicio an int rather than
> a function pointer.
>
> On the plus side: it also allows the removal of some hacks around
> vwrite/writev. On the minus side: it's a large change albeit mostly
> mechanical.

I tried building after applying the patch, but I think I started in the wrong
place? I think I started with a fresh git clone.

Also, the scp told me it couldn't find /usr/local/bin/ssh. I'm guessing
there are environment variables I need.

gcc -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -fstack-protector-all -I. -I. -DSSHDIR=\"/usr/local/etc\" -D_PATH_SSH_PROGRAM=\"/usr/local/bin/ssh\" -D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/local/libexec/ssh-askpass\" -D_PATH_SFTP_SERVER=\"/usr/local/libexec/sftp-server\" -D_PATH_SSH_KEY_SIGN=\"/usr/local/libexec/ssh-keysign\" -D_PATH_SSH_PKCS11_HELPER=\"/usr/local/libexec/ssh-pkcs11-helper\" -D_PATH_SSH_PIDDIR=\"/var/run\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -DHAVE_CONFIG_H -c atomicio.c
atomicio.c: In function 'atomicio6':
atomicio.c:59:57: error: 'vwrite' undeclared (first use in this function)
atomicio.c:59:57: note: each undeclared identifier is reported only once for each function it appears in
atomicio.c:59:65: error: 'f' undeclared (first use in this function)
atomicio.c:59:2: warning: passing argument 1 of 'printf' from incompatible pointer type
/usr/include/stdio.h:249:6: note: expected 'const char * __restrict__' but argument is of type 'struct FILE *'
*** Error code 1



--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Darren Tucker

unread,
Jan 25, 2014, 12:07:09 AM1/25/14
to Hisashi T Fujinaka, Damien Miller, OpenSSH Devel List
On Sat, Jan 25, 2014 at 3:52 PM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
> On Sat, 25 Jan 2014, Darren Tucker wrote:
>
>> Maybe there's something wrapping write() on your system too? Try adding
>> this to the start of atomicio.c:atomicio6():
>>
>> printf(stderr, "read %x write %x argument %x\n", read, vwrite, f);
>>
>> then compile it and run a small scp:
>>
>> $ ./scp testfile localhost:/tmp/
>> read b73eced0 write b73ecf50 argument b73eced0
>>
>> The patch below makes the first argument to atomicio an int rather than
>> a function pointer.
>>
>> On the plus side: it also allows the removal of some hacks around
>> vwrite/writev. On the minus side: it's a large change albeit mostly
>> mechanical.
>
>
> I tried building after applying the patch, but I think I started in the
> wrong place? I think I started with a fresh git clone.

I think you started with a tree which had one of the changes I
suggested upthread ( where I suggest changing the line to:

pfd.events = f == vwrite ? POLLOUT : POLLIN;

> Also, the scp told me it couldn't find /usr/local/bin/ssh. I'm guessing
> there are environment variables I need.

you can work around that with "./configure --prefix=/usr" for testing,
but don't do "make install" unless you really want to replace the
system binaries in /usr/{bin,sbin}

> atomicio.c:59:57: error: 'vwrite' undeclared (first use in this function)

"vwrite" doesn't appear in the unmodified version of atomicio.c except
in a comment.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Hisashi T Fujinaka

unread,
Jan 25, 2014, 12:25:10 AM1/25/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On Sat, 25 Jan 2014, Darren Tucker wrote:

> On Sat, Jan 25, 2014 at 3:52 PM, Hisashi T Fujinaka <ht...@twofifty.com> wrote:
>> On Sat, 25 Jan 2014, Darren Tucker wrote:
>>
>>> Maybe there's something wrapping write() on your system too? Try adding
>>> this to the start of atomicio.c:atomicio6():
>>>
>>> printf(stderr, "read %x write %x argument %x\n", read, vwrite, f);
>>>
>>> then compile it and run a small scp:
>>>
>>> $ ./scp testfile localhost:/tmp/
>>> read b73eced0 write b73ecf50 argument b73eced0
>>>
>>> The patch below makes the first argument to atomicio an int rather than
>>> a function pointer.
>>>
>>> On the plus side: it also allows the removal of some hacks around
>>> vwrite/writev. On the minus side: it's a large change albeit mostly
>>> mechanical.
>>
>>
>> I tried building after applying the patch, but I think I started in the
>> wrong place? I think I started with a fresh git clone.
>
> I think you started with a tree which had one of the changes I
> suggested upthread ( where I suggest changing the line to:
>
> pfd.events = f == vwrite ? POLLOUT : POLLIN;

I don't see that in my current tree.

>> Also, the scp told me it couldn't find /usr/local/bin/ssh. I'm guessing
>> there are environment variables I need.
>
> you can work around that with "./configure --prefix=/usr" for testing,
> but don't do "make install" unless you really want to replace the
> system binaries in /usr/{bin,sbin}

Wouldn't that test my local ssh?

>> atomicio.c:59:57: error: 'vwrite' undeclared (first use in this function)
>
> "vwrite" doesn't appear in the unmodified version of atomicio.c except
> in a comment.

I'm confused. Should I start with a clean tree or a modified tree? And
which patches should I use? I have a lot in my email at this point.

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Damien Miller

unread,
Jan 25, 2014, 1:04:28 AM1/25/14
to Hisashi T Fujinaka, OpenSSH Devel List, Darren Tucker
On Fri, 24 Jan 2014, Hisashi T Fujinaka wrote:

> I'm confused. Should I start with a clean tree or a modified tree? And
> which patches should I use? I have a lot in my email at this point.

If I checkout the current git or CVS head and apply this then the scp
test passes on NetBSD 6.1.3 where it was hanging previously:

Index: atomicio.c
===================================================================
RCS file: /var/cvs/openssh/atomicio.c,v
retrieving revision 1.40
diff -u -r1.40 atomicio.c
--- atomicio.c 24 Sep 2010 12:15:11 -0000 1.40
+++ atomicio.c 25 Jan 2014 06:03:19 -0000
@@ -57,7 +57,7 @@
struct pollfd pfd;

pfd.fd = fd;
- pfd.events = f == read ? POLLIN : POLLOUT;
+ pfd.events = f == vwrite ? POLLOUT : POLLIN;
while (n > pos) {
res = (f) (fd, s + pos, n - pos);
switch (res) {

Hisashi T Fujinaka

unread,
Jan 25, 2014, 1:38:19 AM1/25/14
to Damien Miller, OpenSSH Devel List, Darren Tucker
On Sat, 25 Jan 2014, Damien Miller wrote:

> On Fri, 24 Jan 2014, Hisashi T Fujinaka wrote:
>
>> I'm confused. Should I start with a clean tree or a modified tree? And
>> which patches should I use? I have a lot in my email at this point.
>
> If I checkout the current git or CVS head and apply this then the scp
> test passes on NetBSD 6.1.3 where it was hanging previously:
>
> Index: atomicio.c
> ===================================================================
> RCS file: /var/cvs/openssh/atomicio.c,v
> retrieving revision 1.40
> diff -u -r1.40 atomicio.c
> --- atomicio.c 24 Sep 2010 12:15:11 -0000 1.40
> +++ atomicio.c 25 Jan 2014 06:03:19 -0000
> @@ -57,7 +57,7 @@
> struct pollfd pfd;
>
> pfd.fd = fd;
> - pfd.events = f == read ? POLLIN : POLLOUT;
> + pfd.events = f == vwrite ? POLLOUT : POLLIN;
> while (n > pos) {
> res = (f) (fd, s + pos, n - pos);
> switch (res) {

Weird. Fresh checkout, patch applied, and I got it to pass. Is there any
particular log file that people are posting afterwards?

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Damien Miller

unread,
Jan 25, 2014, 1:44:28 AM1/25/14
to Hisashi T Fujinaka, OpenSSH Devel List, Darren Tucker
On Fri, 24 Jan 2014, Hisashi T Fujinaka wrote:

> Weird. Fresh checkout, patch applied, and I got it to pass. Is there any
> particular log file that people are posting afterwards?

No - I've swum through enough logs and debug traces on this to last a
while :/

-d

Hisashi T Fujinaka

unread,
Jan 25, 2014, 1:45:33 AM1/25/14
to Damien Miller, OpenSSH Devel List, Darren Tucker
On Sat, 25 Jan 2014, Damien Miller wrote:

> On Fri, 24 Jan 2014, Hisashi T Fujinaka wrote:
>
>> Weird. Fresh checkout, patch applied, and I got it to pass. Is there any
>> particular log file that people are posting afterwards?
>
> No - I've swum through enough logs and debug traces on this to last a
> while :/

Heh. Thanks for all the help and I hope it was useful to more than just
me. There has to be at least a half-dozen people running NetBSD. :)

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Damien Miller

unread,
Jan 25, 2014, 6:44:09 AM1/25/14
to Hisashi T Fujinaka, OpenSSH Devel List, Darren Tucker
On Fri, 24 Jan 2014, Hisashi T Fujinaka wrote:

> Heh. Thanks for all the help and I hope it was useful to more than just
> me. There has to be at least a half-dozen people running NetBSD. :)

No problem - apart from the bugs on NetBSD, I found some bugs in the scp
regress test along the way.

-d

Morham

unread,
Jan 25, 2014, 7:25:50 PM1/25/14
to openssh-...@mindrot.org
On 1/25/2014 3:44 AM, Damien Miller wrote:

> No problem - apart from the bugs on NetBSD, I found some bugs in the scp
> regress test along the way.

One thing in the forwarding.sh test that could bear a notice in the
script as a reminder to forgetful/senile/frazzled/overworked admins is
the port range(s) used for the test. ClamAV's clamd service is often
configured to use TCP port 3310, and this will cause the forwarding test
to "hang" briefly and fail with a "corrupt file", when in actual fact,
the file has zero bytes because the transfer never starts.

The GNU "cmp" tool spits out an extra diagnostic complaining about
premature EOF as well.

See the attached for a proposed patch to clarify the problem as well as
shift the base port range, which is an admittedly arbitrarily chosen one.

=M=
forwarding_nullfile.patch.gz

Tom Christensen

unread,
Jan 26, 2014, 8:04:12 AM1/26/14
to Damien Miller, openssh-...@mindrot.org
On 17/01/14 01:26, Damien Miller wrote:
> Hi,
>
> OpenSSH 6.5 is almost ready for release, so we would appreciate testing
> on as many platforms and systems as possible. This release contains
> some substantial new features and a number of bugfixes.
>
I tried building from git HEAD (603b8f4) but ran into a few issues.

It fails to build out of the box on Solaris 2.6:
gmake[1]: Entering directory
`/export/home/tgc/buildpkg/openssh/src/openssh-git/openbsd-compat'
gcc -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare
-Wformat-security -Wno-pointer-sign -fno-strict-aliasing
-D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -fstack-protector-all
-I. -I.. -I. -I./.. -I/usr/tgcware/include -DHAVE_CONFIG_H -c arc4random.c
In file included from ../includes.h:174,
from arc4random.c:27:
../openbsd-compat/openbsd-compat.h:124: error: conflicting types for
'inet_ntop'
/usr/include/resolv.h:303: error: previous declaration of 'inet_ntop'
was here
gmake[1]: *** [arc4random.o] Error 1

The problem is that configure does not detect that inet_ntop is in
libresolv.
...
checking for inet_ntop... no
...
$ nm /usr/lib/libresolv.so|grep inet_ntop
[264] | 42144| 83|FUNC |GLOB |0 |12 |inet_ntop
[153] | 0| 0|FILE |LOCL |0 |ABS |inet_ntop.c
[154] | 42228| 104|FUNC |LOCL |0 |12 |inet_ntop4
[155] | 42332| 504|FUNC |LOCL |0 |12 |inet_ntop6
$ grep inet_ntop /usr/include/resolv.h
const char *inet_ntop __P((int af, const void *src, char *dst, size_t s));
$

I modified configure.ac to detect inet_ntop and the build completes and
it passes the testsuite.

I also gave it a try on IRIX and found issues there aswell.

During configure I get this error:
./configure[10160]: ==: unknown test operator
This is a typo in configure.ac, in the pie test.

There is still the generic IRIX issue with killpg() only being supported
when explicitly using BSD signal semantics.
Details are here:
http://permalink.gmane.org/gmane.network.openssh.devel/19422
I'm using kill(0, SIGTERM) instead as kill(2) indicates it should work
the same.

On IRIX 6.5.22 it builds out of the box using MIPSpro 7.4.4m (CC=c99).
The testsuite runs until:
env passing over multiplexed connection
Where is seems to hang, or atleast 10 minutes later there has been no
further activity in the logs.

On IRIX 6.2 it builds out of the box using MIPSpro 7.3 (7.3.1.2m).
The testsuite runs until:
test stderr data transfer: proto 2 ()
Where it hangs and does not get any further, this is the same as
previous releases.

On IRIX 5.3 the compilation fails using gcc 3.4.6:
gcc -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare
-Wformat-security -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv
-fno-builtin-memset -std=gnu99 -I. -I.. -I. -I./..
-I/usr/tgcware/include/openssl -I/usr/tgcware/include -DHAVE_CONFIG_H -c
bcrypt_pbkdf.c
In file included from bcrypt_pbkdf.c:34:
../crypto_api.h:17: error: syntax error before "crypto_uint32"
../crypto_api.h:17: warning: type defaults to `int' in declaration of
`crypto_uint32'
../crypto_api.h:17: warning: data definition has no type or storage class
bcrypt_pbkdf.c: In function `bcrypt_hash':
bcrypt_pbkdf.c:70: error: `uint32_t' undeclared (first use in this function)
bcrypt_pbkdf.c:70: error: (Each undeclared identifier is reported only once
bcrypt_pbkdf.c:70: error: for each function it appears in.)
bcrypt_pbkdf.c:70: error: syntax error before "cdata"
bcrypt_pbkdf.c:72: error: `uint16_t' undeclared (first use in this function)
bcrypt_pbkdf.c:72: error: syntax error before "j"
bcrypt_pbkdf.c:84: error: `j' undeclared (first use in this function)
bcrypt_pbkdf.c:86: error: `cdata' undeclared (first use in this function)
bcrypt_pbkdf.c:89: error: `uint64_t' undeclared (first use in this function)
bcrypt_pbkdf.c: In function `bcrypt_pbkdf':
bcrypt_pbkdf.c:115: error: `uint32_t' undeclared (first use in this
function)
bcrypt_pbkdf.c:115: error: syntax error before "count"
bcrypt_pbkdf.c:134: error: `count' undeclared (first use in this function)
make[1]: *** [bcrypt_pbkdf.o] Error 1
make[1]: Leaving directory
`/usr/people/tgc/buildpkg/openssh/src/openssh-git/openbsd-compat'

It's the same issue with poly1305.c

For building with gcc < 4.5 adding #include <inttypes.h> is necessary,
while gcc 4.5 and later provides <stdint.h> on platforms that lack it.
Unfortunately on IRIX 5.3 <inttypes.h> conflicts with <sys/types.h> when
using the SGI compiler which means building with gcc is now the only
option since the source seems to rely on being able to include
<sys/types.h> unconditionally.

Once I got the build to complete using gcc 4.5.3, it ends up failling
some of the rekey tests.

$ cat failed-regress.log
trace: client rekey chacha20...@openssh.com
diffie-hellman-group-exchange-sha1
FAIL: ssh failed (-oRekeyLimit=256k
-oCiphers=chacha20...@openssh.com
-oKexAlgorithms=diffie-hellman-group-exchange-sha1)

trace: client rekey chacha20...@openssh.com
diffie-hellman-group-exchange-sha1
FAIL: ssh failed (-oRekeyLimit=256k
-oCiphers=chacha20...@openssh.com
-oKexAlgorithms=diffie-hellman-group-exchange-sha1)
FAIL: corrupted copy (-oRekeyLimit=256k
-oCiphers=chacha20...@openssh.com
-oKexAlgorithms=diffie-hellman-group-exchange-sha1)

trace: -1 rekeying(s)
FAIL: no rekeying occured (-oRekeyLimit=256k
-oCiphers=chacha20...@openssh.com
-oKexAlgorithms=diffie-hellman-group-exchange-sha1)

trace: client rekey chacha20...@openssh.com
diffie-hellman-group-exchange-sha256
FAIL: ssh failed (-oRekeyLimit=256k
-oCiphers=chacha20...@openssh.com
-oKexAlgorithms=diffie-hellman-group-exchange-sha256)

trace: client rekey chacha20...@openssh.com
diffie-hellman-group-exchange-sha256
FAIL: ssh failed (-oRekeyLimit=256k
-oCiphers=chacha20...@openssh.com
-oKexAlgorithms=diffie-hellman-group-exchange-sha256)
FAIL: corrupted copy (-oRekeyLimit=256k
-oCiphers=chacha20...@openssh.com
-oKexAlgorithms=diffie-hellman-group-exchange-sha256)

trace: -1 rekeying(s)
FAIL: no rekeying occured (-oRekeyLimit=256k
-oCiphers=chacha20...@openssh.com
-oKexAlgorithms=diffie-hellman-group-exchange-sha256)

The failed-* logs are here:
http://www.jupiterrise.com/tmp/

If I skip the rekey tests the testsuite runs until:
test stderr data transfer: proto 2 ()
Where it hangs and does not get any further, this is the same as
previous releases.

None of these issues will prevent me from using openssh on IRIX, basic
functionality is still okay.

-tgc

Damien Miller

unread,
Jan 26, 2014, 6:50:45 PM1/26/14
to Tom Christensen, openssh-...@mindrot.org
On Sun, 26 Jan 2014, Tom Christensen wrote:

> I modified configure.ac to detect inet_ntop and the build completes and it
> passes the testsuite.
...
> There is still the generic IRIX issue with killpg() only being supported when
> explicitly using BSD signal semantics.
> Details are here:
> http://permalink.gmane.org/gmane.network.openssh.devel/19422
> I'm using kill(0, SIGTERM) instead as kill(2) indicates it should work the
> same.

Do you have diffs for these changes?

> In file included from bcrypt_pbkdf.c:34:
> ../crypto_api.h:17: error: syntax error before "crypto_uint32"
> ../crypto_api.h:17: warning: type defaults to `int' in declaration of
> `crypto_uint32'
> ../crypto_api.h:17: warning: data definition has no type or storage class
> bcrypt_pbkdf.c: In function `bcrypt_hash':
> bcrypt_pbkdf.c:70: error: `uint32_t' undeclared (first use in this function)

I think Darren was looking at something related to the C99 int types
last week.

-d

Carson Gaspar

unread,
Jan 26, 2014, 7:48:37 PM1/26/14
to openssh-...@mindrot.org
SNAP 20140127 - All test pass on Solaris 11.1 (SRU 15) with Solaris
Studio 12.3

Darren Tucker

unread,
Jan 26, 2014, 8:43:40 PM1/26/14
to Damien Miller, Tom Christensen, OpenSSH Devel List
On Mon, Jan 27, 2014 at 10:50 AM, Damien Miller <d...@mindrot.org> wrote:
>> In file included from bcrypt_pbkdf.c:34:
>> ../crypto_api.h:17: error: syntax error before "crypto_uint32"
>> ../crypto_api.h:17: warning: type defaults to `int' in declaration of
>> `crypto_uint32'
>> ../crypto_api.h:17: warning: data definition has no type or storage class
>> bcrypt_pbkdf.c: In function `bcrypt_hash':
>> bcrypt_pbkdf.c:70: error: `uint32_t' undeclared (first use in this function)
>
> I think Darren was looking at something related to the C99 int types
> last week.

Should have been fixed by
https://anongit.mindrot.org/openssh.git/commit/defines.h?id=355f861022be7b23d3009fae8f3c9f6f7fc685f7
and
https://anongit.mindrot.org/openssh.git/commit/defines.h?id=355f861022be7b23d3009fae8f3c9f6f7fc685f7
.

How old was the snapshot you were testing?

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Darren Tucker

unread,
Jan 27, 2014, 5:23:40 AM1/27/14
to Damien Miller, Tom Christensen, OpenSSH Devel List
On Mon, Jan 27, 2014 at 12:43 PM, Darren Tucker <dtu...@zip.com.au> wrote:
> On Mon, Jan 27, 2014 at 10:50 AM, Damien Miller <d...@mindrot.org> wrote:
>>> In file included from bcrypt_pbkdf.c:34:
>>> ../crypto_api.h:17: error: syntax error before "crypto_uint32"
>>> ../crypto_api.h:17: warning: type defaults to `int' in declaration of
>>> `crypto_uint32'
>>> ../crypto_api.h:17: warning: data definition has no type or storage class
>>> bcrypt_pbkdf.c: In function `bcrypt_hash':
>>> bcrypt_pbkdf.c:70: error: `uint32_t' undeclared (first use in this function)
>>
>> I think Darren was looking at something related to the C99 int types
>> last week.
>
> Should have been fixed by
> https://anongit.mindrot.org/openssh.git/commit/defines.h?id=355f861022be7b23d3009fae8f3c9f6f7fc685f7
> and

the second one should have been
https://anongit.mindrot.org/openssh.git/commit/defines.h?id=acad351a5b1c37de9130c9c1710445cc45a7f6b9

anyway, I dug out my old sparc and I was able to reproduce that error
message with the tree before those commits and build successfully with
the most current one, so I'm pretty sure this has been fixed.

Tom G. Christensen

unread,
Jan 27, 2014, 6:23:00 AM1/27/14
to Damien Miller, openssh-...@mindrot.org
On 27/01/14 00:50, Damien Miller wrote:
> On Sun, 26 Jan 2014, Tom Christensen wrote:
>
>> I modified configure.ac to detect inet_ntop and the build completes and it
>> passes the testsuite.
> ...
>> There is still the generic IRIX issue with killpg() only being supported when
>> explicitly using BSD signal semantics.
>> Details are here:
>> http://permalink.gmane.org/gmane.network.openssh.devel/19422
>> I'm using kill(0, SIGTERM) instead as kill(2) indicates it should work the
>> same.
>
> Do you have diffs for these changes?
>
Sorry, but the inet_ntop change was just a hack, not a proper solution.
For correctness such a change should be looking for inet_ntop in both
libresolv and libnsl (for Solaris 8-10).
Note though that Solaris 7 does not declare this function in the headers.

For killpg vs. kill I'm just patching sshd.c, changing the single use of
killpg to kill.
I don't know if this is universally acceptable and I only know of IRIX
which has this issue. It might not actually cause any problems to use
killpg, but as the manpage says results can be unpredictable.

-tgc

Damien Miller

unread,
Jan 27, 2014, 7:11:19 AM1/27/14
to Tom G. Christensen, openssh-...@mindrot.org
On Mon, 27 Jan 2014, Tom G. Christensen wrote:

> Sorry, but the inet_ntop change was just a hack, not a proper solution.
> For correctness such a change should be looking for inet_ntop in both
> libresolv and libnsl (for Solaris 8-10).
> Note though that Solaris 7 does not declare this function in the headers.
>
> For killpg vs. kill I'm just patching sshd.c, changing the single use of
> killpg to kill.
> I don't know if this is universally acceptable and I only know of IRIX which
> has this issue. It might not actually cause any problems to use killpg, but as
> the manpage says results can be unpredictable.

Could you try this? You'll need to run autoreconf.

AFAIK it's actually better to use kill(0, ...) than killpg(0, ...).
My copy of susv3 says:

> int killpg(pid_t pgrp, int sig);
> ...
> If pgrp is less than or equal to 1, the behavior of killpg() is undefined.

This code was only added relatively recently, with AuthorizedKeysCommand.
It should be safe to change.

-d

Index: configure.ac
===================================================================
RCS file: /var/cvs/openssh/configure.ac,v
retrieving revision 1.564
diff -u -p -r1.564 configure.ac
--- configure.ac 25 Jan 2014 22:46:54 -0000 1.564
+++ configure.ac 27 Jan 2014 12:05:32 -0000
@@ -1240,6 +1240,9 @@ AC_SEARCH_LIBS([openpty], [util bsd])
AC_SEARCH_LIBS([updwtmp], [util bsd])
AC_CHECK_FUNCS([fmt_scaled scan_scaled login logout openpty updwtmp logwtmp])

+# On some platforms, inet_ntop may be found in libresolv or libnsl.
+AC_SEARCH_LIBS([inet_ntop], [resolv nsl])
+
AC_FUNC_STRFTIME

# Check for ALTDIRFUNC glob() extension
Index: sshd.c
===================================================================
RCS file: /var/cvs/openssh/sshd.c,v
retrieving revision 1.441
diff -u -p -r1.441 sshd.c
--- sshd.c 17 Jan 2014 05:47:04 -0000 1.441
+++ sshd.c 27 Jan 2014 12:07:47 -0000
@@ -372,7 +372,7 @@ grace_alarm_handler(int sig)
*/
if (getpgid(0) == getpid()) {
signal(SIGTERM, SIG_IGN);
- killpg(0, SIGTERM);
+ kill(0, SIGTERM);
}

/* Log error and exit. */

Tom G. Christensen

unread,
Jan 27, 2014, 8:36:44 AM1/27/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On 27/01/14 11:23, Darren Tucker wrote:
> On Mon, Jan 27, 2014 at 12:43 PM, Darren Tucker <dtu...@zip.com.au> wrote:
>> On Mon, Jan 27, 2014 at 10:50 AM, Damien Miller <d...@mindrot.org> wrote:
>>>> In file included from bcrypt_pbkdf.c:34:
>>>> ../crypto_api.h:17: error: syntax error before "crypto_uint32"
>>>> ../crypto_api.h:17: warning: type defaults to `int' in declaration of
>>>> `crypto_uint32'
>>>> ../crypto_api.h:17: warning: data definition has no type or storage class
>>>> bcrypt_pbkdf.c: In function `bcrypt_hash':
>>>> bcrypt_pbkdf.c:70: error: `uint32_t' undeclared (first use in this function)
>>>
>>> I think Darren was looking at something related to the C99 int types
>>> last week.
>>
>> Should have been fixed by
>> https://anongit.mindrot.org/openssh.git/commit/defines.h?id=355f861022be7b23d3009fae8f3c9f6f7fc685f7
>> and
>
> the second one should have been
> https://anongit.mindrot.org/openssh.git/commit/defines.h?id=acad351a5b1c37de9130c9c1710445cc45a7f6b9
>
> anyway, I dug out my old sparc and I was able to reproduce that error
> message with the tree before those commits and build successfully with
> the most current one, so I'm pretty sure this has been fixed.
>
As I stated in the original mail, testing was done with gitrev 603b8f4
which is well after those changes.

What old Solaris is missing is u_intXX_t, however IRIX 5.3 has both
u_intXX_t (defined in <sys/types.h>) and uintXX_t (defined in <inttypes.h>).
Unfortunately those headers cannot be included at the same time when
using the SGI compiler.

So this is the real problem:
checking for inttypes.h... no
...
checking for uintXX_t types in inttypes.h... yes
...

It should not be looking for uintXX_t in inttypes.h if the header is
unuseable (ie. ac_cv_header_inttypes_h=no).

Also even if inttypes.h is available and defines uintXX_t, the source
does not seem to make consistent use of it (only used in roaming_*.c).

I modified configure.ac to skip the check for uintXX_t in inttypes.h and
now it works with the SGI compiler.
There's an unrelated include issue which prevents a complete build but
the original problem is gone.

-tgc

Tom G. Christensen

unread,
Jan 27, 2014, 2:38:36 PM1/27/14
to Damien Miller, openssh-...@mindrot.org
On 27/01/14 13:11, Damien Miller wrote:
> Could you try this? You'll need to run autoreconf.
>
<snip patch>

I tested on sparc-sun-solaris2.[678] and in all cases inet_ntop is
correctly detected.
On Solaris 7 I got the expected warning about the missing prototype.

I'm however seeing errors in the rekey test on sparc-sun-solaris2.[67],
the same three errors I got on IRIX 5.3.
Something is iffy with that since those same tests passes on
i386-pc-solaris2.6.
Could there be some timing/performance issue causing those failures? The
3 hosts that fail those tests are also the slowest hosts (USII 336/400
Mhz, and MIPS R4600PC/133).
My sparc-sun-solaris2.8 host is a zone on a 4x900Mhz USIII system and it
passes the testsuite fine, the i386-pc-solaris2.6 host is a VM running
on an i7-2600 cpu.

-tgc

Damien Miller

unread,
Jan 27, 2014, 5:56:43 PM1/27/14
to Tom G. Christensen, openssh-...@mindrot.org
On Mon, 27 Jan 2014, Tom G. Christensen wrote:

> On 27/01/14 13:11, Damien Miller wrote:
> > Could you try this? You'll need to run autoreconf.
> >
> <snip patch>
>
> I tested on sparc-sun-solaris2.[678] and in all cases inet_ntop is correctly
> detected.
> On Solaris 7 I got the expected warning about the missing prototype.

Thanks.

> I'm however seeing errors in the rekey test on sparc-sun-solaris2.[67], the
> same three errors I got on IRIX 5.3.
> Something is iffy with that since those same tests passes on
> i386-pc-solaris2.6.
> Could there be some timing/performance issue causing those failures? The 3
> hosts that fail those tests are also the slowest hosts (USII 336/400 Mhz, and
> MIPS R4600PC/133).
> My sparc-sun-solaris2.8 host is a zone on a 4x900Mhz USIII system and it
> passes the testsuite fine, the i386-pc-solaris2.6 host is a VM running on an
> i7-2600 cpu.

There might be some clues as to what went wrong in regress/failed*.log

-d

Darren Tucker

unread,
Jan 27, 2014, 6:20:21 PM1/27/14
to Tom G. Christensen, Damien Miller, OpenSSH Devel List
On Tue, Jan 28, 2014 at 6:38 AM, Tom G. Christensen <t...@jupiterrise.com> wrote:
[...]
> Could there be some timing/performance issue causing those failures?

It's possible. We try to not make the tests timing-sensitive where
possible but some of them are inherently racy.

The slowest machine I've run the tests on is either a 166MHz powerpc
or a 170 MHz sparc. On the sparcs at least, building openssl with gcc
-mv8 or better makes a huge difference because it enables the hardware
multiply, and DH does a lot of multiplies.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement

Tom G. Christensen

unread,
Jan 28, 2014, 5:54:17 AM1/28/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On 28/01/14 00:20, Darren Tucker wrote:
> On Tue, Jan 28, 2014 at 6:38 AM, Tom G. Christensen <t...@jupiterrise.com> wrote:
> [...]
>> Could there be some timing/performance issue causing those failures?
>
> It's possible. We try to not make the tests timing-sensitive where
> possible but some of them are inherently racy.
>
> The slowest machine I've run the tests on is either a 166MHz powerpc
> or a 170 MHz sparc. On the sparcs at least, building openssl with gcc
> -mv8 or better makes a huge difference because it enables the hardware
> multiply, and DH does a lot of multiplies.
>

Good call.

I rebuilt openssl with sparcv8 on the Solaris 7 host, and now it can
complete the rekey test.
I guess there is a timeout somewhere that causes the test to fail if it
takes too long to do the math.
I'm not sure I can get much more performance out of the IRIX 5.3 host,
so if there is a way to avoid or extend this timeout that would be nice.

-tgc

Damien Miller

unread,
Jan 28, 2014, 6:17:39 AM1/28/14
to Tom G. Christensen, OpenSSH Devel List, Darren Tucker
On Tue, 28 Jan 2014, Tom G. Christensen wrote:

> Good call.
>
> I rebuilt openssl with sparcv8 on the Solaris 7 host, and now it can
> complete the rekey test. I guess there is a timeout somewhere that
> causes the test to fail if it takes too long to do the math. I'm not
> sure I can get much more performance out of the IRIX 5.3 host, so if
> there is a way to avoid or extend this timeout that would be nice.

OpenSSL does ship MIPS assembler bits for its bignum code, though I
have no idea under what circumstances it is activated.

As for altering the test to take longer - you could try increasing
the 'sleep 3' statements in rekey.sh to something longer and see
if that helps. Unfortunately, this is a more fiddly one to avoid the
races on.

btw, if you want to re-run a single test you can do:

make tests LTESTS=rekey

from the top level directory

-d

Tom G. Christensen

unread,
Jan 28, 2014, 9:28:55 AM1/28/14
to Damien Miller, OpenSSH Devel List, Darren Tucker
On 28/01/14 12:17, Damien Miller wrote:
> As for altering the test to take longer - you could try increasing
> the 'sleep 3' statements in rekey.sh to something longer and see
> if that helps. Unfortunately, this is a more fiddly one to avoid the
> races on.
>
AFAICT the two tests that fail are run through the ssh_data_rekeying
function which does not include a sleep.

The failed tests:
client rekey chacha20...@openssh.com
diffie-hellman-group-exchange-sha1
client rekey chacha20...@openssh.com
diffie-hellman-group-exchange-sha256

See also http://jupiterrise.com/tmp where the failed-* logs are.

-tgc

Petr Lautrbach

unread,
Jan 28, 2014, 9:51:29 AM1/28/14
to openssh-...@mindrot.org
Hi,

regress/agent.sh reports wrong exit codes when some of tests fail:

run test agent.sh ...
agent fwd proto 1 failed (exit code 0)
agent fwd proto 2 failed (exit code 0)
failed simple agent test

It's probably due to using $? value in error message after
"if [ $? -ne 0 ]; then"
which sets $? to 0.

With the attached patch, the output would look like:
run test agent.sh ...
agent fwd proto 1 failed (exit code 255)
agent fwd proto 2 failed (exit code 255)
failed simple agent test


I noticed it when I'd run "make tests" by an user, who runs ssh-agent with a static socket from .bashrc:
eval `ssh-agent -a /tmp/plautrba/.ssh-agent.sock`

In this case, the agent.sh always fails, but I consider this more as a configuration issue than
a real bug in test suite.

However, with the standard .bashrc I can confirm that "make tests" passes on RHEL-7 Beta.

Thanks,

Petr
--
Petr Lautrbach
Security Technologies
Red Hat

Better technology. Faster innovation. Powered by community collaboration.
See how it works at redhat.com.
agent.sh.patch
signature.asc

Tim Rice

unread,
Jan 28, 2014, 1:29:31 PM1/28/14
to Petr Lautrbach, openssh-...@mindrot.org
On Tue, 28 Jan 2014, Petr Lautrbach wrote:

> Hi,
>
> regress/agent.sh reports wrong exit codes when some of tests fail:
>
> run test agent.sh ...
> agent fwd proto 1 failed (exit code 0)
> agent fwd proto 2 failed (exit code 0)
> failed simple agent test
>
> It's probably due to using $? value in error message after
> "if [ $? -ne 0 ]; then"
> which sets $? to 0.

Thanks for spotting this. I've commited your patch and also fixed
the same problem in agent-ptrace.sh.


--
Tim Rice Multitalents
t...@multitalents.net

Damien Miller

unread,
Jan 28, 2014, 5:50:40 PM1/28/14
to Tom G. Christensen, OpenSSH Devel List, Darren Tucker
On Tue, 28 Jan 2014, Tom G. Christensen wrote:

> On 28/01/14 12:17, Damien Miller wrote:
> > As for altering the test to take longer - you could try increasing
> > the 'sleep 3' statements in rekey.sh to something longer and see
> > if that helps. Unfortunately, this is a more fiddly one to avoid the
> > races on.
> >
> AFAICT the two tests that fail are run through the ssh_data_rekeying function
> which does not include a sleep.
>
> The failed tests:
> client rekey chacha20...@openssh.com diffie-hellman-group-exchange-sha1
> client rekey chacha20...@openssh.com
> diffie-hellman-group-exchange-sha256
>
> See also http://jupiterrise.com/tmp where the failed-* logs are.

It shows the client getting a "Write failed: broken pipe" on the socket to
the server and the last message on the server being "debug1:
SSH2_MSG_KEX_DH_GEX_GROUP sent [preauth]".

I suspect the server might be silently crashing in packet.c:packet_write_wait
or possibly dh.c:dh_gen_key. These are usually a little tricky to debug.

The way I usually start is by sprinkling logit() statements though these
functions to see where it gets to.

-d

Tom G. Christensen

unread,
Jan 29, 2014, 3:28:08 AM1/29/14
to Damien Miller, openssh-...@mindrot.org
On 26/01/14 14:04, Tom Christensen wrote:
> During configure I get this error:
> ./configure[10160]: ==: unknown test operator
> This is a typo in configure.ac, in the pie test.
>

Patch attached.

-tgc



0001-configure.ac-use-for-shell-test-and-not.patch

Tom G. Christensen

unread,
Jan 29, 2014, 3:32:22 AM1/29/14
to Darren Tucker, Damien Miller, OpenSSH Devel List
On 27/01/14 14:36, Tom G. Christensen wrote:
> So this is the real problem:
> checking for inttypes.h... no
> ...
> checking for uintXX_t types in inttypes.h... yes
> ...
>
> It should not be looking for uintXX_t in inttypes.h if the header is
> unuseable (ie. ac_cv_header_inttypes_h=no).
>
Patch attached.
It will avoid the extra testing for types in headers we already know are
not available.
This follows the style already found in configure.ac.

It fixes the build on IRIX 5.3 when using the SGI compiler, and a quick
test on CentOS 6.5 verifies that it makes no difference there.

> Also even if inttypes.h is available and defines uintXX_t, the source does not seem to make consistent use of it (only used in roaming_*.c).

This part I've not touched.
There is some inconsistence in the use of <stdint.h> and <inttypes.h>.
In includes.h <stdint.h> is always included if HAVE_STDINT_H is true, in
which case it makes no sense that poly1305.c also includes it.
The roaming_c*.c files check for HAVE_INTTYPES_H and includes it if
available, but relies on includes.h otherwise.

Should includes.h simply check HAVE_INTTYPES_H? perhaps only if
HAVE_STDINT_H is not defined?

-tgc
0002-configure.ac-only-look-for-types-in-useable-headers.patch

Damien Miller

unread,
Jan 29, 2014, 5:01:45 AM1/29/14
to Tom G. Christensen, openssh-...@mindrot.org
applied - thanks

Damien Miller

unread,
Jan 29, 2014, 6:21:55 PM1/29/14
to Tom G. Christensen, OpenSSH Devel List, Darren Tucker
On Wed, 29 Jan 2014, Tom G. Christensen wrote:

> Patch attached.
> It will avoid the extra testing for types in headers we already know are not
> available.
> This follows the style already found in configure.ac.

Applied - thanks

-d

Damien Miller

unread,
Jan 29, 2014, 6:42:20 PM1/29/14
to Tom G. Christensen, Darren Tucker, OpenSSH Devel List
On Tue, 28 Jan 2014, Tom G. Christensen wrote:

> On 28/01/14 12:17, Damien Miller wrote:
> > As for altering the test to take longer - you could try increasing
> > the 'sleep 3' statements in rekey.sh to something longer and see
> > if that helps. Unfortunately, this is a more fiddly one to avoid the
> > races on.
> >
> AFAICT the two tests that fail are run through the ssh_data_rekeying function
> which does not include a sleep.
>
> The failed tests:
> client rekey chacha20...@openssh.com diffie-hellman-group-exchange-sha1
> client rekey chacha20...@openssh.com
> diffie-hellman-group-exchange-sha256
>
> See also http://jupiterrise.com/tmp where the failed-* logs are.

Darren and I just talked about this and we have a theory of
what is going wrong. chacha20...@openssh.com demands the
most key material from the key exchange and thus causes the
diffie-hellman-group-exchange-* methods to select their largest and most
computationally expensive DH groups.

So your poor machine is trying to do these 8kbit modular exponentiations
and they are taking too long for the tests' default LoginGraceTime of
two minutes.

Unfortunately we don't have a good way to report this, as the login
grace stuff runs as a SIGALARM handler and Irix doesn't have a
signal-safe fprintf or syslog_r.

Fortunately, working around this in the test is easy:

Index: regress/test-exec.sh
===================================================================
RCS file: /var/cvs/openssh/regress/test-exec.sh,v
retrieving revision 1.61
diff -u -p -r1.61 test-exec.sh
--- regress/test-exec.sh 9 Nov 2013 05:55:03 -0000 1.61
+++ regress/test-exec.sh 29 Jan 2014 23:37:41 -0000
@@ -328,6 +328,7 @@ cat << EOF > $OBJ/sshd_config
StrictModes no
Port $PORT
Protocol 2,1
+ LoginGraceTime 15m
AddressFamily inet
ListenAddress 127.0.0.1
#ListenAddress ::1

Please let us know if this works.

-d

Damien Miller

unread,
Jan 29, 2014, 7:11:10 PM1/29/14
to Tom G. Christensen, OpenSSH Devel List, Darren Tucker
On Thu, 30 Jan 2014, Damien Miller wrote:

> Fortunately, working around this in the test is easy:

here's a better patch that doesn't break login-timeout

Index: regress/login-timeout.sh
===================================================================
RCS file: /var/cvs/openssh/regress/login-timeout.sh,v
retrieving revision 1.7
diff -u -p -r1.7 login-timeout.sh
--- regress/login-timeout.sh 17 May 2013 10:41:07 -0000 1.7
+++ regress/login-timeout.sh 29 Jan 2014 23:55:26 -0000
@@ -4,6 +4,8 @@
tid="connect after login grace timeout"

trace "test login grace with privsep"
+cp $OBJ/sshd_config $OBJ/sshd_config.orig
+grep -vi LoginGraceTime $OBJ/sshd_config.orig > $OBJ/sshd_config
echo "LoginGraceTime 10s" >> $OBJ/sshd_config
echo "MaxStartups 1" >> $OBJ/sshd_config
start_sshd
Index: regress/test-exec.sh
===================================================================
RCS file: /var/cvs/openssh/regress/test-exec.sh,v
retrieving revision 1.61
diff -u -p -r1.61 test-exec.sh
--- regress/test-exec.sh 9 Nov 2013 05:55:03 -0000 1.61
+++ regress/test-exec.sh 29 Jan 2014 23:55:26 -0000
@@ -328,6 +328,7 @@ cat << EOF > $OBJ/sshd_config
StrictModes no
Port $PORT
Protocol 2,1
+ LoginGraceTime 15m
AddressFamily inet
ListenAddress 127.0.0.1
#ListenAddress ::1
It is loading more messages.
0 new messages