[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrXv8SVUDSF+uH=KLe1GSPofKugbOnOj9Andi=HCkDOjmA@mail.gmail.com>
Date: Thu, 22 Aug 2013 13:58:47 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Willy Tarreau <w@....eu>,
"security@...nel.org" <security@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Oleg Nesterov <oleg@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>,
Linux FS Devel <linux-fsdevel@...r.kernel.org>,
Brad Spengler <spender@...ecurity.net>
Subject: Re: [PATCH v2] vfs: Tighten up linkat(..., AT_EMPTY_PATH)
On Thu, Aug 22, 2013 at 1:54 PM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> On Thu, Aug 22, 2013 at 1:48 PM, Andy Lutomirski <luto@...capital.net> wrote:
>>
>> Sure. But aren't they always last?
>
> What do you mean? I'd say that the /proc lookup is always *innermost*.
> Which means that it certainly cannot bail out, since there are many
> levels of nesting outside of it.
I was thinking iteratively, so I said "last" instead of "innermost".
>
>> With the current code structure, trying to enforce some kind of
>> security restriction in the middle of lookup seems really unpleasant.
>
> If it's conditional (ie "linkat behaves differently from openat"), it
> certainly means that we'd have to pass in that info in annoying ways.
>
Hmm. That depends on whether things like I_LINKABLE should be
considered. We might also want to ban open("/proc/self/fd/3", O_RDWR)
if !CAP_DAC_READ_SEARCH and fd wasn't opened with O_RDWR. Both of
those will require passing information in or out.
I'll see how nasty this ends up being. (This may take awhile -- I'm
not at all familiar with this code, and this is at best a minor side
project for me.)
--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists