From owner-svn-src-head@FreeBSD.ORG Wed Aug 20 15:35:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50DCD49E; Wed, 20 Aug 2014 15:35:03 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BE473D82; Wed, 20 Aug 2014 15:35:02 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id n3so6887099wiv.0 for ; Wed, 20 Aug 2014 08:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=jfQibsJhSg4uGNyaYCuwM8Qw81X8c6UFmgYNk3w+Ayo=; b=bpA49jW9VbRdZLt0J1TvF2iIfNbIoVCaMAtigOdzZ9YoMYa43CVdouef/zz//e3aFH 4cBFTghIe1/P+6KLC/u5rzOgAsHIn9k5M0MTPmVWdcYGwzJyRXCi+Q8cnFbgAgXE3g9x ksyc3DC9x91aB5vTfo/4Q0cU4FK6T1Jfw70wU2/YB/9sU0tmZfZbin076dHvf7fbp8TW 8YV8i15vPEMpcTQ4CUMHHUTP9I8FU1yjzqSaj9QI1nqXMo5bA5TEdbcP1O+Qcw0KzHrA Y0do3dpdQnVfCWWos4FqQnSUS+kmcg/Yfzqjr4/canae0DbunWBhDurIUSAmtD0mlplS 8pug== X-Received: by 10.180.73.109 with SMTP id k13mr15744073wiv.11.1408548900614; Wed, 20 Aug 2014 08:35:00 -0700 (PDT) Received: from [172.16.1.30] (39.Red-2-136-52.dynamicIP.rima-tde.net. [2.136.52.39]) by mx.google.com with ESMTPSA id kw1sm59397401wjb.19.2014.08.20.08.34.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Aug 2014 08:34:59 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <53F4C022.5050804@FreeBSD.org> Date: Wed, 20 Aug 2014 17:34:58 +0200 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Bryan Drewery , 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> <53F4BEB1.6070000@FreeBSD.org> In-Reply-To: <53F4BEB1.6070000@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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:35:03 -0000 On 20/08/14 17:28, Bryan Drewery wrote: > On 8/20/2014 10:19 AM, Roger Pau Monné 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. >>>>> Due to the change in ld(1) behaviour of not copying NEEDED entries >>>>> from direct dependencies into the link results, the order becomes >>>>> reversed. >>>>> >>>>> The libthr must appear before libc to properly interpose libc symbols >>>>> and provide working rtld locks implementation. The symptom was sshd >>>>> hanging on rtld bind lock during nested symbol binding from a signal >>>>> handler. >>>>> >>>>> 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 >>>>> ============================================================================== >>>>> --- head/secure/usr.sbin/sshd/Makefile Sun Apr 27 05:19:01 2014 (r265002) >>>>> +++ head/secure/usr.sbin/sshd/Makefile Sun Apr 27 05:28:14 2014 (r265003) >>>>> @@ -57,6 +57,16 @@ CFLAGS+= -DNONE_CIPHER_ENABLED >>>>> DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} >>>>> LDADD+= -lcrypt -lcrypto -lz >>>>> >>>>> +# 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. Put >>>>> +# the threading library last on the linker command line, just before >>>>> +# the -lc added by a compiler driver. >>>>> +.if ${MK_KERBEROS_SUPPORT} != "no" >>>>> +DPADD+= ${LIBPTHREAD} >>>>> +LDADD+= -lpthread >>>>> +.endif >>>>> + >>>>> .if defined(LOCALBASE) >>>>> CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" >>>>> .endif >>>> >>>> Hello, >>>> >>>> This change makes the following simple test program fail on the second >>>> assert. The problem is that sa_handler == SIG_DFL, and sa_flags == >>>> SA_SIGINFO, which according to the sigaction(9) man page is not >>>> 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 ? >> >> 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. >> >> Roger. >> > > Does it fail if you do not connect with ssh? Right, it works fine from the serial console, fails when executed from ssh. Roger.