Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754036AbbDPSDV (ORCPT ); Thu, 16 Apr 2015 14:03:21 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:35036 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753868AbbDPSDO (ORCPT ); Thu, 16 Apr 2015 14:03:14 -0400 Date: Thu, 16 Apr 2015 19:03:10 +0100 From: Djalal Harouni To: Rik van Riel Cc: Andy Lutomirski , Havoc Pennington , One Thousand Gnomes , Greg Kroah-Hartman , Jiri Kosina , Linus Torvalds , Andrew Morton , Arnd Bergmann , "Eric W. Biederman" , Tom Gundersen , "linux-kernel@vger.kernel.org" , Daniel Mack , David Herrmann Subject: Re: [GIT PULL] kdbus for 4.1-rc1 Message-ID: <20150416180310.GA5382@dztty> References: <20150413204547.GB1760@kroah.com> <20150414175019.GA2874@kroah.com> <20150415085641.GH16381@kroah.com> <20150415120618.4d8d90ff@lxorguk.ukuu.org.uk> <552E8B11.4010803@redhat.com> <552ED310.80806@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <552ED310.80806@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2482 Lines: 58 Hi, On Wed, Apr 15, 2015 at 05:07:28PM -0400, Rik van Riel wrote: [...] > > This leads me to a potentially interesting question: where's the > > buffering? If there's a bus with lots of untrusted clients and one of > > them broadcasts data faster than all receivers can process it, where > > does it go? > > > > At least with a userspace solution, it's clear what the OOM killer > > should kill when this happens. Unless it's PID 1. Sigh > > It may be useful to do the buffering (and general interception > of any message that cannot be delivered) in a userspace program. > > Not only to get the buffers out of the kernel and into swappable > memory, but also so people could re-use the same infrastructure > for things like cluster communication (or communication between > different containers) - the userspace daemons could take care of > routing messages to and from the outside. > > They could also be useful to keep some of the policy stuff > outside of the kernel, if only to ensure that the kernel side > policy is not set in stone, and people can do things differently > in the future if they want to. > kdbus connections have memory pools, please check kdbus.pool(7). The pool has its own quota accounting to prevent bad scenarios, and the memory is attributed to the connection. Messages that can't be delivered are not stored in the pool, but senders will get an appropriate error code. For further details on how this works, please see kdbus.message(7). If you are aware of any corner-cases we overlooked, please let us know. Regarding the policy, the implementaion is hardly more complex than traditional UNIX file permissions. Bus names may have multiple permissions assined, each of which consist of a bit-mask to denote OWN, TALK and SEE flags which are applied to UIDs, GIDs or "world". This policy has to be enforced by the kernel, therfore the information it acts upon also needs to be stored there. For further details, please see kdbus.policy(7). The concept of a name policy originates from dbus1 [1], however we simplified it substantially, removing features which we believe rather belong into userspace. [1] http://dbus.freedesktop.org/doc/dbus-daemon.1.html -- Djalal Harouni http://opendz.org -- 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/