From owner-svn-src-all@FreeBSD.ORG Sat Dec 24 13:39:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E6E7106564A; Sat, 24 Dec 2011 13:39:22 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 556798FC15; Sat, 24 Dec 2011 13:39:20 +0000 (UTC) Received: by eekc50 with SMTP id c50so11825951eek.13 for ; Sat, 24 Dec 2011 05:39:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=kFzl7VGCILCREQvCeHfVKP0BZ3KYfN0p1dbRWPJ1Oxk=; b=lgGGP825AD0kYM0gVsejd8aJ1faOQJlo5xlYJUUVhLS5vu7h/A+zlVO4jZVx4oUXqd iLaKr65UusbCb5Cyy3CCq6uTn6StpAP3tSN4O5yQ27n1QbFXPir2eoyVxgibW+P8KVrO LJQqJn/PpFwhjc4Twvi24Txfr0ZgIN1mdI3bU= Received: by 10.213.10.143 with SMTP id p15mr549890ebp.95.1324732248576; Sat, 24 Dec 2011 05:10:48 -0800 (PST) Received: from [192.168.119.6] (gate19.robnet.pl. [194.105.132.219]) by mx.google.com with ESMTPS id y12sm61589496eeb.11.2011.12.24.05.10.39 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 24 Dec 2011 05:10:43 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <20111224105045.GA11127@vniz.net> Date: Sat, 24 Dec 2011 14:10:37 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <8E5EE6FA-7BA1-4590-843A-F5C3C0493E5B@FreeBSD.org> References: <201112231500.pBNF0c0O071712@svn.freebsd.org> <201112231058.46642.jhb@freebsd.org> <201112231122.34436.jhb@freebsd.org> <20111223120644.75fe944d@kan.dyndns.org> <20111223175143.GJ50300@deviant.kiev.zoral.com.ua> <20111224100509.GA98136@vniz.net> <20111224103948.GA10939@vniz.net> <20111224105045.GA11127@vniz.net> To: Andrey Chernov X-Mailer: Apple Mail (2.1251.1) Cc: src-committers@FreeBSD.ORG, Xin LI , John Baldwin , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, Colin Percival , Kostik Belousov , Alexander Kabaev 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: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2011 13:39:22 -0000 Wiadomo=B6=E6 napisana przez Andrey Chernov w dniu 24 gru 2011, o godz. = 11:50: > On Sat, Dec 24, 2011 at 02:45:21AM -0800, Xin LI wrote: >> On Sat, Dec 24, 2011 at 2:39 AM, Andrey Chernov = wrote: >>> On Sat, Dec 24, 2011 at 02:26:20AM -0800, Xin LI wrote: >>>> chroot(2) can create legitimate and secure environment where = dlopen(2) >>>> is safe and necessary. >>>=20 >>> Yes, so ischroot() check can be used only into that places where = libc's >>> libc_dlopen() currently used, i.e. placed into libc_dlopen() itself. >>=20 >> So it's Okay to break NSS in chroot jail? >=20 > We need general solution. We simple can't count all possible and = future=20 > ftpd's arround the world and insert = __FreeBSD_libc_enter_restricted_mode()=20 > into them. I even not mention other programs that may use chroot() = too. If=20 > some component like auth is critical for chroot, it should be = restricted=20 > in general scope. How about adding a check in dlopen(3) to make sure the file being opened is owned either by us (getuid(3)) or root and is not writable by anyone = else?=