From owner-freebsd-security@FreeBSD.ORG Thu Dec 29 20:15:33 2011 Return-Path: Delivered-To: freebsd-security@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0019F106566B; Thu, 29 Dec 2011 20:15:32 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id D1CC68FC0C; Thu, 29 Dec 2011 20:15:32 +0000 (UTC) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 68BF3110E8; Thu, 29 Dec 2011 12:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1325189732; bh=Wn2gnZkM+/JW7vp9zxOamBfY3Mvj9XnCLO+NICf4UD4=; h=Message-ID:Date:From:Reply-To:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=lkIlp8jmFI5icktW5kHOXhgtCC6VGZNAVE4lJL0480lyZVxMBcHxXfI3RfgT97SWo AjZmbYaHkGtI592F5E+3Zty+/30t0Ccl1GwX88RKcnPPJIv5b1N4WKLMQdauE9McfN 8RvQUob5fYTf5qIqmu0vaogII5ji3AeTFll4JJbE= Message-ID: <4EFCCA63.5070409@delphij.net> Date: Thu, 29 Dec 2011 12:15:31 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Andrey Chernov , d@delphij.net, John Baldwin , freebsd-security@FreeBSD.ORG, Doug Barton References: <201112231500.pBNF0c0O071712@svn.freebsd.org> <4EF6444F.6090708@FreeBSD.org> <201112290939.53665.jhb@freebsd.org> <4EFCB0C9.6090608@delphij.net> <20111229183606.GA48785@vniz.net> <4EFCBC60.3080607@delphij.net> <20111229194229.GA49908@vniz.net> In-Reply-To: <20111229194229.GA49908@vniz.net> X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r228843 - head/contrib/telnet/libtelnet head/crypto/heimdal/appl/telnet/libtelnet head/include head/lib/libc/gen head/lib/libc/iconv head/lib/libc/include head/lib/libc/net head/libexec... X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2011 20:15:33 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/29/11 11:42, Andrey Chernov wrote: > On Thu, Dec 29, 2011 at 11:15:44AM -0800, Xin Li wrote: >> Would you please elaborate how this would be less ugly (e.g. with >> a patch)? > > Why doing a patch if you apparently don't care? ) Ok now you don't have to do a patch. I had asked because sometimes a patch would better describe what would be done, especially for abstract concepts like ugliness of code. As Alfred recently posted in a different thread, you may have a great idea in your mind but without the same background knowledge it's sometimes hard for others to understand it. > In few words, it less ugly because it 1) will be public API, 2) > will restrict all possibe future dlopen() usage (f.e. someday tar, > which used in some ftpds, can use dlopen() to load its formats > etc.) > >> We discussed a change like this but IIRC it was rejected because >> the affected surface is too broad and we wanted to limit it to >> just the implicit dlopen()s to avoid breaking legitimate >> applications. > > Instead of total disabling we can (by calling rtld function) > restrict dlopen() in ftpd() to absolute path of know safe > directories list like "/etc" "/lib" "/usr/lib" etc. This just came back to the origin!! These "safe" locations are never necessarily be safe inside a chroot environment and the issue was exactly loading a library underneath /lib/. I just realized that someone have removed some details from my advisory draft by the way. To clarify: the chroot issue is not about the usual usage of chroot, but the fact that many chroot setups are not safe (e.g. "recommended" practice is to create a user writable directory under the chroot root with everything else read-only). Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk78ymMACgkQOfuToMruuMDKhgCffQHNVz8y3IhnXp18m6OW7/LZ FrMAn0SgW++iSd7d8LsAql/1y1tX8MjV =zzYY -----END PGP SIGNATURE-----