[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrVWkW16Y7hOq-mA1auJjRXmwiAUfAGurK0-2bOdbZu_dA@mail.gmail.com>
Date: Wed, 7 May 2014 16:45:10 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: David Miller <davem@...emloft.net>,
"Jorge Boncompte [DTI2]" <jorge@...2.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Vivek Goyal <vgoyal@...hat.com>,
Simo Sorce <ssorce@...hat.com>,
"security@...nel.org" <security@...nel.org>,
Network Development <netdev@...r.kernel.org>,
"Serge E. Hallyn" <serge@...lyn.com>
Subject: Re: [PATCH 5/5] net: Use netlink_ns_capable to verify the permisions
of netlink messages
On Wed, May 7, 2014 at 4:34 PM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> On Wed, May 7, 2014 at 4:01 PM, Andy Lutomirski <luto@...capital.net> wrote:
>>
>> I agree that it should, but it doesn't, and if these patches get
>> backported, things will break. OTOH, if the patches don't get
>> backported, things may still break, and we have a possibly rather
>> severe unfixed vulnerability.
>
> How did this *use* to work? It looks like it drops permissions after
> the bind(), so the actual _IO_ must have always been done without
> permissions, no?
>
> Is it just a bind-time permission check that is now failing, because
> it uses the credentials associated with the socket open? If so, I'd
> suggest unding just the ns-capable change for bind(), and make that
> one always use the current process effective one.
>
> If you're a suid application, you're not doing "bind()" on random file
> descriptors that were passed to you. It's really just read/write that
> need to be careful.
>
It looks like Zebra is mucking with its effective set. It creates the
socket w/o effective caps, raises them to bind (no clue why), lowers
them post-bind, then raises them again to sendto. Presumably the new
checks cause the sendto to fail b/c the socket()-time credentials were
insufficient.
I don't see why it bound w/ elevated permissions, since I don't think
this is important. And it never connected at all.
Hence my suggestion that we check permissions at connect time instead
of socket() time and that we just check send-time permissions on an
unconnected socket. Yes, this is awful. TBH, I don't think that
f_cred really ought to exist in an ideal world -- you either should or
should not be able to open something, but the privileges you had when
you opened it shouldn't make any difference other than determining
whether open works. I don't think my ideal is going to happen,
though.
--Andy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists