From: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
To: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: David Herrmann
<dh.herrmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>,
Tom Gundersen <teg-B22kvLQNl6c@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
One Thousand Gnomes
<gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>,
Jiri Kosina <jkosina-AlSwsSmVLrQ@public.gmane.org>,
Linux API <linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Daniel Mack <daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org>,
Djalal Harouni <tixxdz-Umm1ozX2/EEdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH v4 00/14] Add kdbus implementation
Date: Sun, 5 Apr 2015 15:46:30 +0200 [thread overview]
Message-ID: <20150405134630.GA29698@kroah.com> (raw)
In-Reply-To: <FFF43E89-B796-4BDE-893A-5CC2AE77AED7-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
On Sun, Apr 05, 2015 at 07:09:16AM -0500, Eric W. Biederman wrote:
>
>
> On April 3, 2015 6:51:34 AM CDT, David Herrmann <dh.herrmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >Hi
> >
> >On Tue, Mar 31, 2015 at 8:29 PM, Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
> >wrote:
> >> On Tue, Mar 31, 2015 at 8:10 AM, Tom Gundersen <teg-B22kvLQNl6c@public.gmane.org> wrote:
> >>> On Tue, Mar 31, 2015 at 3:58 PM, Andy Lutomirski
> ><luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org> wrote:
> >>>>
> >>>> IOW you're taking something that you dislike aspects of and shoving
> >>>> most of it in the kernel. That guarantees us an API in the kernel
> >>>> that even the creators don't really like. This is, IMO, very
> >>>> unfortunate.
> >>>
> >>> This is a misrepresentation of what David wrote. We do want this API
> >>> regardless of dbus1 compatibility, but compatibility is by itself a
> >>> sufficient motivation. A further motivation is reliable
> >introspection,
> >>> since this meta-data allows listing current peers on the bus and
> >>> showing their identities. That's hugely useful to make the bus
> >>> transparent to admins.
> >>
> >> I've heard the following use cases for per-connection metadata:
> >>
> >> - Authenticating to dbus1 services.
> >
> >Not necessarily authentication, but we need to support the legacy API,
> >for whatever reason it was used by old applications. But..
> >
> >> - Identifying connected users for admin diagnostics.
> >>
> >> I've heard the following use cases for per-message metadata:
> >>
> >> - Logging.
> >>
> >> - Authenticating to kdbus services that want this style of
> >authentication.
> >
> >..please note that authentication on DBus has always been done with
> >per-message metadata (see polkit history). However, this had to be
> >reverted some years ago as it is racy (it used /proc for that, which
> >can be exploited by exec'ing setuid binaries). However, the
> >per-message metadata authentication worked very well for _years_
> >(minus the race..), so this is already a well-established scheme. With
> >kdbus we can finally implement this in a race-free manner.
> >
> >[...]
> >> This is simply not okay for a modern interface, and in my opinion the
> >> kernel should not carry code to support new APIs with weakly defined
> >> security semantics. It's important that one be able to tell what the
> >> security implications of one's code is without cross-referencing with
> >> the implementation of the server's you're interacting with.
> >
> >Again, I disagree. Our concepts are established and used on UDS and
> >DBus for decades.
> >
> >Yes, we provide two ways to retrieve metadata, but the kernel offers
> >several more paths to gather that information. Just because those APIs
> >are available does not mean they should be used for authentication. We
> >mandate per-message metadata. If applications use per-connection
> >metadata, /proc, netlink, or random data, they're doing it wrong.
> >
> >Furthermore, dbus provides pretty complete and straightforward
> >libraries which hide that from you. If you use glib, qt or sd-bus, you
> >don't even need to deal with all that.
> >
> >> To top that off, the kdbus policy mechanism has truly bizarre effects
> >> with respect to services that have unique ids and well-known names.
> >> That, too, is apparently for compatibility.
> >>
> >> This all feels to me like a total of about four people are going to
> >> understand the tangle that is kdbus security, and that's bad. I
> >think
> >> that the kernel should insist that new security-critical mechanisms
> >> make sense and be hard to misuse. The current design of kdbus, in
> >> contrast, feel like it will be very hard to use correctly.
> >
> >Native kdbus clients are authenticated with their credentials at time
> >of method call. Legacy clients will always have their credentials at
> >time of connect in effect. No fallbacks, no choices. It's a simple
> >question whether it's a legacy client or not.
> >Sounds simple to me.
>
> So I just took a slightly deeper look and the user namespace bits are wrong. Both in implementation
> and in design.
>
> Passing "capabilities" to user space for reasons of authentication is wrong and a maintenance nightmare. Further the capabilities maintainer Serge Hallyn has not been copied.
I don't understand, where are passed that are not already exported today
through /proc/ already? kdbus gathers this information in a race-free
way, unlike having to dig this out of proc and hope that nothing has
changed underneath you.
> There are several other pieces of information in your meta data like cmdline that I have similar concerns about, but are I am less familiar with, and have looked at less.
Again, cmdline is also exported today, why is passing that somehow not
acceptable?
> Which leads my to conclude that in its current form kdbus is inappropriate for inclusion in the kernel.
Ah, so we should also remove those fields from /proc/ today as well, and
just break all of userspace that relies on it today? Again, kdbus is
just doing the same thing that userspace is doing today, but in a
race-free manner.
> The code is dangerously and inappropriately wrong and comes with a huge maintenance obligation to people outside of kdbus.
How so? Please explain.
Oh, and please wrap your email properly, reading it this way is a
horrible experience, you know better than that...
greg k-h
WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: David Herrmann <dh.herrmann@gmail.com>,
Andy Lutomirski <luto@amacapital.net>,
Tom Gundersen <teg@jklm.no>, Arnd Bergmann <arnd@arndb.de>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Jiri Kosina <jkosina@suse.cz>,
Linux API <linux-api@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Daniel Mack <daniel@zonque.org>,
Djalal Harouni <tixxdz@opendz.org>
Subject: Re: [PATCH v4 00/14] Add kdbus implementation
Date: Sun, 5 Apr 2015 15:46:30 +0200 [thread overview]
Message-ID: <20150405134630.GA29698@kroah.com> (raw)
In-Reply-To: <FFF43E89-B796-4BDE-893A-5CC2AE77AED7@xmission.com>
On Sun, Apr 05, 2015 at 07:09:16AM -0500, Eric W. Biederman wrote:
>
>
> On April 3, 2015 6:51:34 AM CDT, David Herrmann <dh.herrmann@gmail.com> wrote:
> >Hi
> >
> >On Tue, Mar 31, 2015 at 8:29 PM, Andy Lutomirski <luto@amacapital.net>
> >wrote:
> >> On Tue, Mar 31, 2015 at 8:10 AM, Tom Gundersen <teg@jklm.no> wrote:
> >>> On Tue, Mar 31, 2015 at 3:58 PM, Andy Lutomirski
> ><luto@amacapital.net> wrote:
> >>>>
> >>>> IOW you're taking something that you dislike aspects of and shoving
> >>>> most of it in the kernel. That guarantees us an API in the kernel
> >>>> that even the creators don't really like. This is, IMO, very
> >>>> unfortunate.
> >>>
> >>> This is a misrepresentation of what David wrote. We do want this API
> >>> regardless of dbus1 compatibility, but compatibility is by itself a
> >>> sufficient motivation. A further motivation is reliable
> >introspection,
> >>> since this meta-data allows listing current peers on the bus and
> >>> showing their identities. That's hugely useful to make the bus
> >>> transparent to admins.
> >>
> >> I've heard the following use cases for per-connection metadata:
> >>
> >> - Authenticating to dbus1 services.
> >
> >Not necessarily authentication, but we need to support the legacy API,
> >for whatever reason it was used by old applications. But..
> >
> >> - Identifying connected users for admin diagnostics.
> >>
> >> I've heard the following use cases for per-message metadata:
> >>
> >> - Logging.
> >>
> >> - Authenticating to kdbus services that want this style of
> >authentication.
> >
> >..please note that authentication on DBus has always been done with
> >per-message metadata (see polkit history). However, this had to be
> >reverted some years ago as it is racy (it used /proc for that, which
> >can be exploited by exec'ing setuid binaries). However, the
> >per-message metadata authentication worked very well for _years_
> >(minus the race..), so this is already a well-established scheme. With
> >kdbus we can finally implement this in a race-free manner.
> >
> >[...]
> >> This is simply not okay for a modern interface, and in my opinion the
> >> kernel should not carry code to support new APIs with weakly defined
> >> security semantics. It's important that one be able to tell what the
> >> security implications of one's code is without cross-referencing with
> >> the implementation of the server's you're interacting with.
> >
> >Again, I disagree. Our concepts are established and used on UDS and
> >DBus for decades.
> >
> >Yes, we provide two ways to retrieve metadata, but the kernel offers
> >several more paths to gather that information. Just because those APIs
> >are available does not mean they should be used for authentication. We
> >mandate per-message metadata. If applications use per-connection
> >metadata, /proc, netlink, or random data, they're doing it wrong.
> >
> >Furthermore, dbus provides pretty complete and straightforward
> >libraries which hide that from you. If you use glib, qt or sd-bus, you
> >don't even need to deal with all that.
> >
> >> To top that off, the kdbus policy mechanism has truly bizarre effects
> >> with respect to services that have unique ids and well-known names.
> >> That, too, is apparently for compatibility.
> >>
> >> This all feels to me like a total of about four people are going to
> >> understand the tangle that is kdbus security, and that's bad. I
> >think
> >> that the kernel should insist that new security-critical mechanisms
> >> make sense and be hard to misuse. The current design of kdbus, in
> >> contrast, feel like it will be very hard to use correctly.
> >
> >Native kdbus clients are authenticated with their credentials at time
> >of method call. Legacy clients will always have their credentials at
> >time of connect in effect. No fallbacks, no choices. It's a simple
> >question whether it's a legacy client or not.
> >Sounds simple to me.
>
> So I just took a slightly deeper look and the user namespace bits are wrong. Both in implementation
> and in design.
>
> Passing "capabilities" to user space for reasons of authentication is wrong and a maintenance nightmare. Further the capabilities maintainer Serge Hallyn has not been copied.
I don't understand, where are passed that are not already exported today
through /proc/ already? kdbus gathers this information in a race-free
way, unlike having to dig this out of proc and hope that nothing has
changed underneath you.
> There are several other pieces of information in your meta data like cmdline that I have similar concerns about, but are I am less familiar with, and have looked at less.
Again, cmdline is also exported today, why is passing that somehow not
acceptable?
> Which leads my to conclude that in its current form kdbus is inappropriate for inclusion in the kernel.
Ah, so we should also remove those fields from /proc/ today as well, and
just break all of userspace that relies on it today? Again, kdbus is
just doing the same thing that userspace is doing today, but in a
race-free manner.
> The code is dangerously and inappropriately wrong and comes with a huge maintenance obligation to people outside of kdbus.
How so? Please explain.
Oh, and please wrap your email properly, reading it this way is a
horrible experience, you know better than that...
greg k-h
next prev parent reply other threads:[~2015-04-05 13:46 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-09 13:09 [PATCH v4 00/14] Add kdbus implementation Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 02/14] kdbus: add uapi header file Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 05/14] kdbus: add connection, queue handling and message validation code Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 06/14] kdbus: add node and filesystem implementation Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 07/14] kdbus: add code to gather metadata Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 08/14] kdbus: add code for notifications and matches Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 09/14] kdbus: add code for buses, domains and endpoints Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 11/14] kdbus: add policy database implementation Greg Kroah-Hartman
[not found] ` <1425906560-13798-1-git-send-email-gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
2015-03-09 13:09 ` [PATCH 01/14] kdbus: add documentation Greg Kroah-Hartman
2015-03-09 13:09 ` Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 03/14] kdbus: add driver skeleton, ioctl entry points and utility functions Greg Kroah-Hartman
2015-03-09 13:09 ` Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 04/14] kdbus: add connection pool implementation Greg Kroah-Hartman
2015-03-09 13:09 ` Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 10/14] kdbus: add name registry implementation Greg Kroah-Hartman
2015-03-09 13:09 ` Greg Kroah-Hartman
2015-03-09 13:09 ` [PATCH 12/14] kdbus: add Makefile, Kconfig and MAINTAINERS entry Greg Kroah-Hartman
2015-03-09 13:09 ` Greg Kroah-Hartman
2015-03-24 15:15 ` Jiri Slaby
2015-03-24 18:51 ` [PATCH] kdbus: Fix CONFIG_KDBUS help text Daniel Mack
2015-03-25 1:05 ` David Herrmann
2015-03-25 9:51 ` Greg KH
2015-03-09 13:09 ` [PATCH 13/14] kdbus: add walk-through user space example Greg Kroah-Hartman
2015-03-09 13:09 ` Greg Kroah-Hartman
2015-03-12 14:52 ` Sasha Levin
2015-03-12 16:27 ` [PATCH] samples/kdbus: add -lrt David Herrmann
2015-03-12 21:40 ` [PATCH] kdbus: " Greg Kroah-Hartman
[not found] ` <5501A848.5080402-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-03-12 16:34 ` [PATCH 13/14] kdbus: add walk-through user space example David Herrmann
2015-03-12 16:34 ` David Herrmann
[not found] ` <1425906560-13798-14-git-send-email-gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
2015-03-24 16:46 ` Jiri Slaby
2015-03-24 16:46 ` Jiri Slaby
[not found] ` <551194C8.4070707-AlSwsSmVLrQ@public.gmane.org>
2015-03-24 17:15 ` David Herrmann
2015-03-24 17:15 ` David Herrmann
2015-03-24 17:37 ` Jiri Slaby
2015-03-24 18:22 ` Michal Marek
2015-03-24 18:51 ` Daniel Mack
2015-03-31 13:11 ` [PATCH] samples: kdbus: build kdbus-workers conditionally Daniel Mack
2015-04-01 12:47 ` Greg KH
2015-04-01 21:41 ` Andrew Morton
2015-04-03 11:02 ` Daniel Mack
2015-03-09 13:09 ` [PATCH 14/14] kdbus: add selftests Greg Kroah-Hartman
2015-03-15 5:13 ` [PATCH] kdbus: fix minor typo in the walk-through example Nicolas Iooss
2015-03-15 9:32 ` Greg KH
2015-03-17 19:24 ` [PATCH v4 00/14] Add kdbus implementation Andy Lutomirski
[not found] ` <CALCETrUjqTH14fZCeqU_OBoKX_6x4B=712WTeSqSAztpgXGiDw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-18 13:54 ` David Herrmann
2015-03-18 13:54 ` David Herrmann
[not found] ` <CANq1E4Tf_6Cn+sxY=BPEbRpEr5WY+-rRX5gipz-_=4PNLa9bnQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-18 18:24 ` Andy Lutomirski
2015-03-18 18:24 ` Andy Lutomirski
[not found] ` <CALCETrVWbz7YudNQXQD_2PjC1HR0P0cB_1ea8NiYoQPDfQxERg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-19 11:26 ` David Herrmann
2015-03-19 11:26 ` David Herrmann
[not found] ` <CANq1E4RA1ok=3Z5W2LkzqaUOKtbMVX_Joxe7_LRbLnQgfRUEYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-19 15:48 ` Andy Lutomirski
2015-03-19 15:48 ` Andy Lutomirski
2015-03-23 15:28 ` David Herrmann
[not found] ` <CANq1E4TtXq02Ug22fsTr8j0X6+vJKvyryALiTEMbT4SMQB1j3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-23 23:24 ` Andy Lutomirski
2015-03-23 23:24 ` Andy Lutomirski
[not found] ` <CALCETrXqYBeZuOWhm9mz_nt+aWPXHFwkQPEAfwBXzDxnAP7f+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-24 0:20 ` Eric W. Biederman
2015-03-24 0:20 ` Eric W. Biederman
2015-03-25 17:29 ` David Herrmann
2015-03-25 17:29 ` David Herrmann
[not found] ` <CANq1E4QiErHp8Q6bzFLkK9=7eBZC8dvh+Xnrh9_D5DAAogyaZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-25 18:12 ` Andy Lutomirski
2015-03-25 18:12 ` Andy Lutomirski
[not found] ` <CALCETrUuWhtJ9w9vyCGgaJDMGithJad4A4wf-BuxWLb_af5eDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-30 16:56 ` David Herrmann
2015-03-30 16:56 ` David Herrmann
[not found] ` <CANq1E4TTt3qanQse30KOZsuo2tfNoj7YSueh3AZ7bY1nQQeZNA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-31 13:58 ` Andy Lutomirski
2015-03-31 13:58 ` Andy Lutomirski
[not found] ` <CALCETrV-cHYzcWu3t6tJ1eP0UZHTqoGH0KTYHTpJNit9-59TAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-31 15:10 ` Tom Gundersen
2015-03-31 15:10 ` Tom Gundersen
[not found] ` <CAG-2HqVwfH5fK0YV1+k3T4bFqd5v3Yd-hpL-bTSBK23FFY-zMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-31 18:29 ` Andy Lutomirski
2015-03-31 18:29 ` Andy Lutomirski
[not found] ` <CALCETrX3vDZsymwC=LK=oK0=QLZqyB2Nv4N8jcjsx2yp1rjBvg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-03 11:51 ` David Herrmann
2015-04-03 11:51 ` David Herrmann
[not found] ` <CANq1E4QSja-KhVL2p-d406uLJT600zMpK2UAcwsb0LkMwa8F7w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-05 12:09 ` Eric W. Biederman
2015-04-05 12:09 ` Eric W. Biederman
[not found] ` <FFF43E89-B796-4BDE-893A-5CC2AE77AED7-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2015-04-05 13:46 ` Greg Kroah-Hartman [this message]
2015-04-05 13:46 ` Greg Kroah-Hartman
2015-04-08 22:38 ` Andy Lutomirski
2015-04-08 22:38 ` Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150405134630.GA29698@kroah.com \
--to=gregkh-hqyy1w1ycw8ekmwlsbkhg0b+6bgklq7r@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org \
--cc=dh.herrmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
--cc=gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org \
--cc=jkosina-AlSwsSmVLrQ@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org \
--cc=teg-B22kvLQNl6c@public.gmane.org \
--cc=tixxdz-Umm1ozX2/EEdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.