Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966805AbbBCRuN (ORCPT ); Tue, 3 Feb 2015 12:50:13 -0500 Received: from smtp101.biz.mail.bf1.yahoo.com ([98.139.221.60]:34464 "EHLO smtp101.biz.mail.bf1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966392AbbBCRuJ (ORCPT ); Tue, 3 Feb 2015 12:50:09 -0500 X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 2cKf2icVM1nXGXvlpQP4.vyx_9THvjeBjv7z.wXe6mqzS5q kT8SpK0rgsMY_ktR1n8iccwpWlrPEh9sl4kEsLsiXSHwTAxlYH44YPjTuFVY wTdQ_UkBYBLgTw7fMNLrDFUZpqVrF.KmXZ7p5vODZkCkLY5mBwbD_1ys5ism o7uwr36MfrRRpDCRTHRBSDseXyeyJAV.mkbKjONrdVs9JiZD8ophURm1Rj.. rTsiuAyFtuYkCjMPy6Xf4CNhOaJN7yIAD.fqHW7C3_lfdrurzY3jyWXZYadL fW.BDSQ.9h9k7JeGUynZDTpwrfxHZfKRuziuX5bsPpEMWUiLu42rg.3OuXwv YtsaGKfoq7.Amo4zWmR016tlWAXORiTzyozI9nE9ZaqHH2YlKC0SVuZEVCzN EVCSWqJF3DjWrWEQ4FgU95PKEM5hu.WP4Oyvh5oLV9syUV85j6TogncXiqk7 AFr2aWmq697tNfJn9lf_JIggG.kQ7jPr.kkSEvgEyqBQuAc.xuLgN6ORDUh4 Jz00zBgCKUm4TRAMu9N_3jjaK X-Yahoo-SMTP: OIJXglSswBDfgLtXluJ6wiAYv6_cnw-- Message-ID: <54D10A50.5030707@schaufler-ca.com> Date: Tue, 03 Feb 2015 09:50:08 -0800 From: Casey Schaufler User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Serge E. Hallyn" CC: Andy Lutomirski , Serge Hallyn , Christoph Lameter , Serge Hallyn , Jonathan Corbet , Aaron Jones , "Ted Ts'o" , LSM List , "linux-kernel@vger.kernel.org" , Andrew Morton , Casey Schaufler Subject: Re: [capabilities] Allow normal inheritance for a configurable set of capabilities References: <54CFB9B8.8020701@schaufler-ca.com> <20150202180806.GE24351@ubuntumail> <54CFE3E8.2030402@schaufler-ca.com> <20150203155122.GD2923@mail.hallyn.com> <54D0F94D.3050704@schaufler-ca.com> <20150203172837.GC4748@mail.hallyn.com> In-Reply-To: <20150203172837.GC4748@mail.hallyn.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3406 Lines: 67 On 2/3/2015 9:28 AM, Serge E. Hallyn wrote: > Quoting Casey Schaufler (casey@schaufler-ca.com): >> On 2/3/2015 7:51 AM, Serge E. Hallyn wrote: >>> Quoting Casey Schaufler (casey@schaufler-ca.com): >>>> On 2/2/2015 12:37 PM, Andy Lutomirski wrote: >>>>> On Mon, Feb 2, 2015 at 10:08 AM, Serge Hallyn wrote: >>>>>> Quoting Casey Schaufler (casey@schaufler-ca.com): >>>>>>> I'm game to participate in such an effort. The POSIX scheme >>>>>>> is workable, but given that it's 20 years old and hasn't >>>>>>> developed real traction it's hard to call it successful. >>>>>> Over the years we've several times discussed possible reasons for this >>>>>> and how to help. I personally think it's two things: 1. lack of >>>>>> toolchain and fs support. The fact that we cannot to this day enable >>>>>> ping using capabilities by default because of cpio, tar and non-xattr >>>>>> filesystems is disheartening. 2. It's hard for users and applications >>>>>> to know what caps they need. yes the API is a bear to use, but we can >>>>>> hide that behind fancier libraries. But using capabilities requires too >>>>>> much in-depth knowledge of precisely what caps you might need for >>>>>> whatever operations library may now do when you asked for something. >>>>> None of this could address the problem here, though: if I hold a >>>>> capability and I want to pass that capability to an exec'd helper, I >>>>> shouldn't need the fs's help to do this. >>>> One of the holes in the 1003.1e spec is what to do with a program file >>>> that does not have a capability set attached to it. The two options are >>>> drop all capabilities and leave the capabilities alone. The latter gives >>>> you what you're asking for. The former is arguably safer. >>> Hm, so if we were to change that, what should we do in the case of (a) >>> an fs which doesn't support xattrs, >> You have two choices, really. The first is to treat the files on that >> filesystem as having no xattrs, thus they have the inheritable behavior. >> The alternative is to default to some value for the filesystem (Smack >> does this) which may or may not be provided in the mount options. >> >>> (2) expanding a tarball/cpio which >>> didn't have xattrs (should tar/cpio fill them in with empty sets?), >>> and >> Files get no capability sets, hence the inheriting behavior. >> >>> (3) do we add a default empty set in the case of an fs mounted with >>> NOSUID? >> No, I think that is the opposite of what NOSUID is trying to do. >> For the capability behavior to match the setuid bit behavior all >> files will be inheriting, as if they had no capability set. It would >> be safer to pretend there is an empty set, but that's not what >> NOSUID does. >> >>> It's an interesting notion. >> It's what we did in Trusted Irix. It made life much easier. > Is there any chance you'd have time to write a patch to implement this? Woof. I'll at least take a look. > > (I wasn't going to ask bc I assumed not, but heck maybe you're bored > on a desert island or snowed in and just looking for an excuse to hack :) Not at all bored, but I think this could be important. > > -serge > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/