Starting the kdbus discussions

Marc Deslauriers marc.deslauriers at canonical.com
Wed Jan 8 05:12:43 PST 2014


On 14-01-08 03:51 AM, Lennart Poettering wrote:
> On Tue, 07.01.14 15:24, Tyler Hicks (tyhicks at canonical.com) wrote:
> 
>> Hi Lennart! I've added Greg to cc since John Johansen and I spoke with
>> him about this in a hallway at Plumbers last year.
>>
>> On 2014-01-02 18:08:42, Lennart Poettering wrote:
>>> I am sorry, but to make this very clear: this is explicitly not an
>>> option. There will not be a payload parser for kdbus in the kernel, as
>>> long as the four developers who are working on it have any say. The
>>> entire design is based on the concept that the payload is irrelevant to
>>> the kernel, and routing is done only according to the metadata we
>>> attach. This is a fundamental design decision of kdbus, and the four of
>>> us (Kay, Daniel, Greg and I) will refuse this.
>>
>> I agree that parsing the payload in the kernel is not something that we
>> should do. However, I do think that there are some important metadata
>> fields hidden away in the opaque sd_bus_message that should be exposed
>> to the kernel by way of moving them to the kdbus_msg.
>>
>> I'm proposing that the following fields be moved to the kdbus_msg:
>>
>>  - message type
>>  - destination
>>  - sender
> 
> These three you have anyway, in one way or another. (or can mostly
> reconstruct from the data available to the kernel, since the kernel can
> distuingish method calls from method replies and broadcast signals --
> though you cannot distuingish methods replies from method errors).
> 
>>  - path
>>  - interface
>>  - member
> 
> Nope. This is really not how this is supposed to work. These concepts
> are opaque to the kernel on purpose.

So you're not willing to change any of your design to cope with the community's
requirements?

> And the kernel does not use them
> for anything. We are certainly not adding arbitrary fields to the kernel
> structures, which nobody needs,

We're arguing the point that the kernel does need to use them, so the LSMs can
make appropriate security decisions.

 which cannot be checked or validated by
> the kernel, and complicate things and create a false sense of security
> via a flawed security model... 

You clearly don't have the same definition of security than I do. The security
model isn't flawed, it just happens to not be the one you're going to use.

> 
> Really, we will not parse dbus messages in the kernel, and we will not
> work around this design choice by then just moving arbitrary fields from
> the userspace to the kernelspace header. 
> 
> You can do such things with dbus-daemon, or you can create a bus proxy,
> like we did for compat reason, but the kernel should not look into the
> payload like this or even have an understanding of so many userspace
> details.

It's just moving a few headers to from the payload to the metadata, where they
belong.

> 
> It's a bit like you'd write a letter with salutation, sender/receiver
> addresses and valediction, which you then seal into an envelope, on
> which you write sender and reciever address, then break the seal again,
> and fax both the envelope and the letter to the destination....

No, that's the way it currently works, with certain headers duplicated in both
the payload and the metadata. We're trying to get the headers separated out of
the payload as it doesn't make sense to have that important information in a
blob that is opaque to the kernel.

> 
>>  1) The kernel provides a centralized, trustworthy location for making
>>     security decisions
>>     - The security burden isn't placed solely on the clients/services
>>     - LSMs could hook into kdbus and perform fine-grained filtering,
>>       much like what's possible in today's dbus-daemon
>>     - kdbus security policy for an application can be located alongside
>>       the security policy for other kernel-managed objects (files,
>>       network permissions, IPC objects, etc.)
>>     - The D-Bus security policy could be fine-grained, allowing filter
>>       on certain interfaces, members, etc.
>>     - I suppose that someone could even write an LSM to implement the XML
>>       bus policy if they had a dependence on it
> 
> This really misses the point. We get rid of the XML policy because it is
> misdesigned, and not just because we want to replace XML by somer other
> formatting.

I disagree. Removing the central location where policy can be enforced is the
bad design. You're moving trust from the system into the applications themselves.

> 
> You cannot replace decisions PolicyKit is capable of by a decision
> engine in the kernel. That's because PolicyKit can ask questions
> interactively, can ask the network and whatnot. Trying to avoid fixing
> things properly by moving all complexity and all understanding of the
> userspace semantics into kernel space is never going to work. In
> addition, in many many cases looking at the mere method call
> interactions between clients and servers will not work anyway, if you
> don't have any context for it.

PolicyKit only works if you trust the daemon that is using this. We want a
better security model than that, a model where you don't need to trust the
daemon, or you can assume the daemon could be compromised.

> 
>>     - If the burden of auditing is placed on a client/service, they
>>       will not likely have the required privileges (CAP_AUDIT_WRITE) to
>>       write to the audit subsystem
> 
> auditd can also just subscribe to the monitor stream and get the data
> without further intervention of the kernel, if auditing on that level is
> really desired.
> 
> Sorry, but this is not happening. Find a different solution. Use
> dbus-daemon, provide a bus proxy that enforces your ruleset, or hack up
> your own kernel IPC, but kdbus is not going to do what you want it to
> do.

Well, so much for attempting to collaborate into making something that can be
used by everyone. Once again, we are going to be accused of doing our own thing.

Marc.


More information about the dbus mailing list