From owner-svn-src-head@FreeBSD.ORG Wed Aug 20 15:28:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA4501AE for ; Wed, 20 Aug 2014 15:28:57 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88D133C94 for ; Wed, 20 Aug 2014 15:28:57 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s7KFSvpr051400 for ; Wed, 20 Aug 2014 15:28:57 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s7KFSvl1051399 for svn-src-head@freebsd.org; Wed, 20 Aug 2014 15:28:57 GMT (envelope-from bdrewery) Received: (qmail 3273 invoked from network); 20 Aug 2014 10:28:53 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 20 Aug 2014 10:28:53 -0500 Message-ID: <53F4BEB1.6070000@FreeBSD.org> Date: Wed, 20 Aug 2014 10:28:49 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: =?windows-1252?Q?Roger_Pau_Monn=E9?= , Konstantin Belousov Subject: Re: svn commit: r265003 - head/secure/usr.sbin/sshd References: <201404270528.s3R5SEIm054377@svn.freebsd.org> <53F4B381.5010205@FreeBSD.org> <20140820151310.GB2737@kib.kiev.ua> <53F4BC9B.3090405@FreeBSD.org> In-Reply-To: <53F4BC9B.3090405@FreeBSD.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V5PmQs8sINARv3nlhRmJccjCeIVW9a5DX" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Aug 2014 15:28:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --V5PmQs8sINARv3nlhRmJccjCeIVW9a5DX Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/20/2014 10:19 AM, Roger Pau Monn=E9 wrote: > On 20/08/14 17:13, Konstantin Belousov wrote: >> On Wed, Aug 20, 2014 at 04:41:05PM +0200, Roger Pau Monn?? wrote: >>> On 27/04/14 07:28, Konstantin Belousov wrote: >>>> Author: kib >>>> Date: Sun Apr 27 05:28:14 2014 >>>> New Revision: 265003 >>>> URL: http://svnweb.freebsd.org/changeset/base/265003 >>>> >>>> Log: >>>> Fix order of libthr and libc in the global dso list for sshd, by >>>> explicitely linking main binary with -lpthread. Before, libthr >>>> appeared in the list due to dependency of one of the kerberos libs= =2E >>>> Due to the change in ld(1) behaviour of not copying NEEDED entries= >>>> from direct dependencies into the link results, the order becomes >>>> reversed. >>>> =20 >>>> The libthr must appear before libc to properly interpose libc symb= ols >>>> and provide working rtld locks implementation. The symptom was ss= hd >>>> hanging on rtld bind lock during nested symbol binding from a sign= al >>>> handler. >>>> =20 >>>> Approved by: des (openssh maintainer) >>>> Sponsored by: The FreeBSD Foundation >>>> MFC after: 1 week >>>> >>>> Modified: >>>> head/secure/usr.sbin/sshd/Makefile >>>> >>>> Modified: head/secure/usr.sbin/sshd/Makefile >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- head/secure/usr.sbin/sshd/Makefile Sun Apr 27 05:19:01 2014 (r26= 5002) >>>> +++ head/secure/usr.sbin/sshd/Makefile Sun Apr 27 05:28:14 2014 (r26= 5003) >>>> @@ -57,6 +57,16 @@ CFLAGS+=3D -DNONE_CIPHER_ENABLED >>>> DPADD+=3D ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} >>>> LDADD+=3D -lcrypt -lcrypto -lz >>>> =20 >>>> +# Fix the order of NEEDED entries for libthr and libc. The libthr >>>> +# needs to interpose libc symbols, leaving the libthr loading as >>>> +# dependency of krb causes reversed order and broken interposing. P= ut >>>> +# the threading library last on the linker command line, just befor= e >>>> +# the -lc added by a compiler driver. >>>> +.if ${MK_KERBEROS_SUPPORT} !=3D "no" >>>> +DPADD+=3D ${LIBPTHREAD} >>>> +LDADD+=3D -lpthread >>>> +.endif >>>> + >>>> .if defined(LOCALBASE) >>>> CFLAGS+=3D -DXAUTH_PATH=3D\"${LOCALBASE}/bin/xauth\" >>>> .endif >>> >>> Hello, >>> >>> This change makes the following simple test program fail on the secon= d=20 >>> assert. The problem is that sa_handler =3D=3D SIG_DFL, and sa_flags =3D= =3D=20 >>> SA_SIGINFO, which according to the sigaction(9) man page is not=20 >>> possible. With this change reverted the test is successful. >> I do not quite follow. >> >> What are the relations between sshd and your test program ? >> Should the test be run somehow specially ? >=20 > No, and frankly that's what I don't understand. I compile this simple > test with `cc -o test test.c`. It fails with this commit applied, and > succeeds without it. >=20 > Roger. >=20 Does it fail if you do not connect with ssh? --=20 Regards, Bryan Drewery --V5PmQs8sINARv3nlhRmJccjCeIVW9a5DX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJT9L6yAAoJEDXXcbtuRpfPG4oH/0h8fOidMsPLrwCBZTnuHwwW kFcDkUJXc9LbIXIMD9IUhocfPDzO0aBXgeWHFiBDy97Ilizk0sfHjYNXHTdJD3tV eFtAOJTmyJOkYe1w1/e2/mxPQZyGJc8oPluH3c/BRf2sEn6rE/U28TeEKao+AMHt v9vdt0HyKyjrbRGEXBwqZlUM6faSsvnB4lf4polAbZt2t2Y3r/yhiTcE01pYXDxn DkLGq3wPSzY+7MFR80plBIs3KQKpaBDLkSuK6r1UuFawumRnIaSIvAjiSRQBLM85 nVZVj3gvlQux1V77gC8v9IfJLH50rHd+T6J2PESVbh6MMH0tnn7m7a+LAduyQ5Q= =5rg9 -----END PGP SIGNATURE----- --V5PmQs8sINARv3nlhRmJccjCeIVW9a5DX--