From owner-freebsd-current@freebsd.org Mon Jun 13 07:44:16 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0A63AF1DFC for ; Mon, 13 Jun 2016 07:44:16 +0000 (UTC) (envelope-from florian.ermisch@alumni.tu-berlin.de) Received: from mail-2.alumni.tu-berlin.de (mail-2.alumni.tu-berlin.de [130.149.5.29]) (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 9688C2E16; Mon, 13 Jun 2016 07:44:16 +0000 (UTC) (envelope-from florian.ermisch@alumni.tu-berlin.de) X-tubIT-Incoming-IP: 78.52.138.248 Received: from x4e348af8.dyn.telefonica.de ([78.52.138.248] helo=unknown806C1B08767B) by mailbox.alumni.tu-berlin.de (exim-4.84_2) with esmtpsa [TLSv1.2:DHE-RSA-AES256-SHA:256] id 1bCMXX-0003rp-6I; Mon, 13 Jun 2016 09:44:07 +0200 In-Reply-To: References: <20160611103834.GA75085@lyxys.ka.sub.org> <1F5A9247-7C98-483C-A4BD-4A3D54208B3D@alumni.tu-berlin.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: The OpenBSD pledge From: Florian Ermisch Date: Mon, 13 Jun 2016 09:44:01 +0200 To: Alan Somers , Domagoj Stolfa , Wolfgang Zenker CC: FreeBSD CURRENT Message-ID: <87672BA7-6724-45EB-B173-920DCEC39564@alumni.tu-berlin.de> X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 07:44:17 -0000 Am 11. Juni 2016 18:31:25 MESZ, schrieb Alan Somers : > On Sat, Jun 11, 2016 at 5:32 AM, Domagoj Stolfa > wrote: > > Yes, it would maybe make sense to do so. I am not too familiar with > > capsicum(4), but glancing over it, it might be possible. If > anything, it > > would allow for code reuse from the OpenBSD ports and increased > portability > > in the future. Maybe the people who have worked with capsicum(4) or > have > > developed it could give some more insight on this. > > > > I don't see how it would be possible. Capsicum is all about file > descriptors. When you call cap_enter(), you give up the ability to > access global namespaces. For example, you can no longer open files > (except using openat(2) for files in a subdirectory of a directory > which is already opened). OTOH, pledge is all about sycalls. When > you pledge, you give up the ability to use certain syscalls, > regardless of what file descriptors they might involve. So for > example, a program that uses pledge(2) to prohibit networking syscalls > can't simply replace pledge(2) with cap_enter(2), because it may need > to open files after pledging. > > -Alan Thanks for the clarification, Alan. So pledge(2) would, if implemented in FreeBSD, complement capsicum. They would only overlap around file descriptors, where capsicum could enforce a processes pledge like to only ever write to one file which is its logfile. Florian