linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/12] Add kdbus implementation
@ 2014-10-29 22:00 Greg Kroah-Hartman
  2014-10-29 22:00 ` kdbus: add documentation Greg Kroah-Hartman
                   ` (16 more replies)
  0 siblings, 17 replies; 103+ messages in thread
From: Greg Kroah-Hartman @ 2014-10-29 22:00 UTC (permalink / raw)
  To: linux-api, linux-kernel
  Cc: john.stultz, arnd, tj, marcel, desrt, hadess, dh.herrmann,
	tixxdz, gregkh, simon.mcvittie, daniel, alban.crequy,
	javier.martinez, teg

kdbus is a kernel-level IPC implementation that aims for resemblance to
the the protocol layer with the existing userspace D-Bus daemon while
enabling some features that couldn't be implemented before in userspace.

The documentation added by the first patch in this series is meant to
explain all protocol and API details comprehensively, but here's a terse
list of the kdbus key features:

 * Implemented as a char driver, which creates devices on demand when
   they are created.

 * Message transfer over shared memory areas in each of the peer's
   task to avoid unnecessary extra data copies during message exchanges.

 * Optional passing of file descriptors and sealed memfds along with
   messages.

 * No demarshalling of any message content from inside the kernel;
   the driver stays entirely agnostic to the transported payload.

 * Support for multiple domains, completely separated from each other,
   allowing multiple virtualized instances to be used at the same time.

 * Support for peer-to-peer unicast and multicast messages.

 * Attachment of trustable metadata to each message on demand, such as
   the sending peer's timestamp, creds, auxgroups, comm, exe, cmdline,
   cgroup path, capabilities, security label, audit information, etc,
   each taken at the time the sender issued the ioctl to send the
   message. Which of those are actually recorded and attached is
   controlled by the receiving peer.

 * Bloom filters as measure to pre-filter broadcast messages and to
   mitigate unnecessary task wakeups. On the side kernel, however, this
   is just a cheap &-operation, hash functions are left to be
   implemented by userspace.

 * Optional message dequeuing by priority, allowing multiple types of
   payloads of different priorities to be transported over the same
   connection.

 * Global, domain-wide guaranteed message ordering.

 * Eavesdropping for buses for debugging

 * Adressing of remote peers by their numerical unique ID, or by a
   well-known name.

 * Built-in name registry for atomic name ownership lookups, claims,
   releases and take-overs from one peer to another.

 * Simple policy database to restrict peers from seeing or talking to
   each other, and to control name ownership.

 * Custom bus endpoints in addition to the default ones. Those allow
   to upload extra policy rules, and can act as a protocol-filtering
   bus firewall.

 * Kernel-generated notifications on connected and disconnected peers,
   claimed and released well-known-names, and exceeded reply timeouts.

This is the first submission of kdbus by the kernel community.  It was
developed in its own repository for well more than a year, and has been
tested on x64-64, i686 and ARM architectures in various use cases. The
driver is totally non-intrusive and doesn't touch a single line of
existing kernel code.

kdbus has been worked on collaboratively by many people contributing
code and suggestions during its development. Below is a list of all
involved individuals, in alphabetical order.

  Alban Crequy, Arnd Bergmann, Christian S., Daniel Kowalski,
  Daniel Mack, David Herrmann, Djalal Harouni, Govindarajulu
  Varadarajan, Greg Kroah-Hartman, Harald Hoyer, Hristo Venev,
  Ingo van Lil, Jacek Janczyk, Jason A. Donenfeld, John de
  la Garza, Kay Sievers, Lennart Poettering, Lukasz Skalski,
  Maciej Wereski, Marc-Antoine Perennou, Marcel Holtmann,
  Michal Eljasiewicz, Michele Curti, Przemyslaw Kedzierski,
  Radoslaw Pajak, Ryan Lortie, Simon McVittie, Simon Peeters,
  Stefan Beller, Ted Feng, Tejun Heo, Tero Roponen, Thomas
  Andersen, Torstein Husebø, Vasiliy Balyasnyy.

Some statistics: the driver itself has a little more than 11k lines,
with ~25% of the lines being comments. Our test suite weights in for
another 6k lines, and the API documentation file currently has >1800
lines. The loaded kernel module has ~70kB of text size.

Patches #3 to #10 carry the driver implementation in digestable bites,
but only #11 adds the Makefile to actually compile them. That division
can of course be changed, and the patches be squashed and reordered
later.

The rest should be pretty much self-explanatory - the individual commit
logs and Documentation/kdbus.txt contain detailed information on the
driver's inner life.

While we consider the kernel API/ABI mostly stable at this point, we're
still in the process of fixing up some ends in userspace, such as
compatibility layers and the D-Bus spec, but that shouldn't affect the
kernel side much anymore.

As for maintainership, Daniel Mack, David Herrmann, Djalal Harouni and
myself would be taking care for it in the future.

I'll also be keeping this in a git tree, the kdbus branch of
char-misc.git at:
	https://git.kernel.org/cgit/linux/kernel/git/gregkh/char-misc.git/

thanks,

greg k-h

Daniel Mack (12):
  kdbus: add documentation
  kdbus: add header file
  kdbus: add driver skeleton, ioctl entry points and utility functions
  kdbus: add connection pool implementation
  kdbus: add connection, queue handling and message validation code
  kdbus: add code to gather metadata
  kdbus: add code for notifications and matches
  kdbus: add code for buses, domains and endpoints
  kdbus: add name registry implementation
  kdbus: add policy database implementation
  kdbus: add Makefile, Kconfig and MAINTAINERS entry
  kdbus: add selftests

 Documentation/ioctl/ioctl-number.txt             |    1 +
 Documentation/kdbus.txt                          | 1815 ++++++++++++++++++++++
 MAINTAINERS                                      |   12 +
 drivers/misc/Kconfig                             |    1 +
 drivers/misc/Makefile                            |    1 +
 drivers/misc/kdbus/Kconfig                       |   11 +
 drivers/misc/kdbus/Makefile                      |   19 +
 drivers/misc/kdbus/bus.c                         |  450 ++++++
 drivers/misc/kdbus/bus.h                         |  107 ++
 drivers/misc/kdbus/connection.c                  | 1751 +++++++++++++++++++++
 drivers/misc/kdbus/connection.h                  |  177 +++
 drivers/misc/kdbus/domain.c                      |  477 ++++++
 drivers/misc/kdbus/domain.h                      |  105 ++
 drivers/misc/kdbus/endpoint.c                    |  567 +++++++
 drivers/misc/kdbus/endpoint.h                    |   94 ++
 drivers/misc/kdbus/handle.c                      | 1221 +++++++++++++++
 drivers/misc/kdbus/handle.h                      |   46 +
 drivers/misc/kdbus/item.c                        |  256 +++
 drivers/misc/kdbus/item.h                        |   40 +
 drivers/misc/kdbus/limits.h                      |   77 +
 drivers/misc/kdbus/main.c                        |   70 +
 drivers/misc/kdbus/match.c                       |  521 +++++++
 drivers/misc/kdbus/match.h                       |   30 +
 drivers/misc/kdbus/message.c                     |  420 +++++
 drivers/misc/kdbus/message.h                     |   72 +
 drivers/misc/kdbus/metadata.c                    |  626 ++++++++
 drivers/misc/kdbus/metadata.h                    |   51 +
 drivers/misc/kdbus/names.c                       |  920 +++++++++++
 drivers/misc/kdbus/names.h                       |   81 +
 drivers/misc/kdbus/notify.c                      |  235 +++
 drivers/misc/kdbus/notify.h                      |   28 +
 drivers/misc/kdbus/policy.c                      |  617 ++++++++
 drivers/misc/kdbus/policy.h                      |   60 +
 drivers/misc/kdbus/pool.c                        |  728 +++++++++
 drivers/misc/kdbus/pool.h                        |   43 +
 drivers/misc/kdbus/queue.c                       |  602 +++++++
 drivers/misc/kdbus/queue.h                       |   82 +
 drivers/misc/kdbus/util.c                        |  108 ++
 drivers/misc/kdbus/util.h                        |   94 ++
 include/uapi/linux/kdbus.h                       |  918 +++++++++++
 tools/testing/selftests/Makefile                 |    1 +
 tools/testing/selftests/kdbus/.gitignore         |   11 +
 tools/testing/selftests/kdbus/Makefile           |   46 +
 tools/testing/selftests/kdbus/kdbus-enum.c       |   90 ++
 tools/testing/selftests/kdbus/kdbus-enum.h       |   14 +
 tools/testing/selftests/kdbus/kdbus-test.c       |  474 ++++++
 tools/testing/selftests/kdbus/kdbus-test.h       |   79 +
 tools/testing/selftests/kdbus/kdbus-util.c       | 1173 ++++++++++++++
 tools/testing/selftests/kdbus/kdbus-util.h       |  139 ++
 tools/testing/selftests/kdbus/test-activator.c   |  317 ++++
 tools/testing/selftests/kdbus/test-benchmark.c   |  417 +++++
 tools/testing/selftests/kdbus/test-bus.c         |  117 ++
 tools/testing/selftests/kdbus/test-chat.c        |  123 ++
 tools/testing/selftests/kdbus/test-connection.c  |  258 +++
 tools/testing/selftests/kdbus/test-daemon.c      |   66 +
 tools/testing/selftests/kdbus/test-domain.c      |   65 +
 tools/testing/selftests/kdbus/test-endpoint.c    |  221 +++
 tools/testing/selftests/kdbus/test-fd.c          |  473 ++++++
 tools/testing/selftests/kdbus/test-free.c        |   34 +
 tools/testing/selftests/kdbus/test-match.c       |  385 +++++
 tools/testing/selftests/kdbus/test-message.c     |  126 ++
 tools/testing/selftests/kdbus/test-metadata-ns.c |  236 +++
 tools/testing/selftests/kdbus/test-monitor.c     |  156 ++
 tools/testing/selftests/kdbus/test-names.c       |  184 +++
 tools/testing/selftests/kdbus/test-policy-ns.c   |  578 +++++++
 tools/testing/selftests/kdbus/test-policy-priv.c | 1168 ++++++++++++++
 tools/testing/selftests/kdbus/test-policy.c      |   81 +
 tools/testing/selftests/kdbus/test-race.c        |  313 ++++
 tools/testing/selftests/kdbus/test-sync.c        |  241 +++
 tools/testing/selftests/kdbus/test-timeout.c     |   97 ++
 70 files changed, 21217 insertions(+)
 create mode 100644 Documentation/kdbus.txt
 create mode 100644 drivers/misc/kdbus/Kconfig
 create mode 100644 drivers/misc/kdbus/Makefile
 create mode 100644 drivers/misc/kdbus/bus.c
 create mode 100644 drivers/misc/kdbus/bus.h
 create mode 100644 drivers/misc/kdbus/connection.c
 create mode 100644 drivers/misc/kdbus/connection.h
 create mode 100644 drivers/misc/kdbus/domain.c
 create mode 100644 drivers/misc/kdbus/domain.h
 create mode 100644 drivers/misc/kdbus/endpoint.c
 create mode 100644 drivers/misc/kdbus/endpoint.h
 create mode 100644 drivers/misc/kdbus/handle.c
 create mode 100644 drivers/misc/kdbus/handle.h
 create mode 100644 drivers/misc/kdbus/item.c
 create mode 100644 drivers/misc/kdbus/item.h
 create mode 100644 drivers/misc/kdbus/limits.h
 create mode 100644 drivers/misc/kdbus/main.c
 create mode 100644 drivers/misc/kdbus/match.c
 create mode 100644 drivers/misc/kdbus/match.h
 create mode 100644 drivers/misc/kdbus/message.c
 create mode 100644 drivers/misc/kdbus/message.h
 create mode 100644 drivers/misc/kdbus/metadata.c
 create mode 100644 drivers/misc/kdbus/metadata.h
 create mode 100644 drivers/misc/kdbus/names.c
 create mode 100644 drivers/misc/kdbus/names.h
 create mode 100644 drivers/misc/kdbus/notify.c
 create mode 100644 drivers/misc/kdbus/notify.h
 create mode 100644 drivers/misc/kdbus/policy.c
 create mode 100644 drivers/misc/kdbus/policy.h
 create mode 100644 drivers/misc/kdbus/pool.c
 create mode 100644 drivers/misc/kdbus/pool.h
 create mode 100644 drivers/misc/kdbus/queue.c
 create mode 100644 drivers/misc/kdbus/queue.h
 create mode 100644 drivers/misc/kdbus/util.c
 create mode 100644 drivers/misc/kdbus/util.h
 create mode 100644 include/uapi/linux/kdbus.h
 create mode 100644 tools/testing/selftests/kdbus/.gitignore
 create mode 100644 tools/testing/selftests/kdbus/Makefile
 create mode 100644 tools/testing/selftests/kdbus/kdbus-enum.c
 create mode 100644 tools/testing/selftests/kdbus/kdbus-enum.h
 create mode 100644 tools/testing/selftests/kdbus/kdbus-test.c
 create mode 100644 tools/testing/selftests/kdbus/kdbus-test.h
 create mode 100644 tools/testing/selftests/kdbus/kdbus-util.c
 create mode 100644 tools/testing/selftests/kdbus/kdbus-util.h
 create mode 100644 tools/testing/selftests/kdbus/test-activator.c
 create mode 100644 tools/testing/selftests/kdbus/test-benchmark.c
 create mode 100644 tools/testing/selftests/kdbus/test-bus.c
 create mode 100644 tools/testing/selftests/kdbus/test-chat.c
 create mode 100644 tools/testing/selftests/kdbus/test-connection.c
 create mode 100644 tools/testing/selftests/kdbus/test-daemon.c
 create mode 100644 tools/testing/selftests/kdbus/test-domain.c
 create mode 100644 tools/testing/selftests/kdbus/test-endpoint.c
 create mode 100644 tools/testing/selftests/kdbus/test-fd.c
 create mode 100644 tools/testing/selftests/kdbus/test-free.c
 create mode 100644 tools/testing/selftests/kdbus/test-match.c
 create mode 100644 tools/testing/selftests/kdbus/test-message.c
 create mode 100644 tools/testing/selftests/kdbus/test-metadata-ns.c
 create mode 100644 tools/testing/selftests/kdbus/test-monitor.c
 create mode 100644 tools/testing/selftests/kdbus/test-names.c
 create mode 100644 tools/testing/selftests/kdbus/test-policy-ns.c
 create mode 100644 tools/testing/selftests/kdbus/test-policy-priv.c
 create mode 100644 tools/testing/selftests/kdbus/test-policy.c
 create mode 100644 tools/testing/selftests/kdbus/test-race.c
 create mode 100644 tools/testing/selftests/kdbus/test-sync.c
 create mode 100644 tools/testing/selftests/kdbus/test-timeout.c

-- 
2.1.0


^ permalink raw reply	[flat|nested] 103+ messages in thread

end of thread, other threads:[~2014-11-17 18:37 UTC | newest]

Thread overview: 103+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-29 22:00 [PATCH 00/12] Add kdbus implementation Greg Kroah-Hartman
2014-10-29 22:00 ` kdbus: add documentation Greg Kroah-Hartman
2014-10-30 12:20   ` Peter Meerwald
2014-11-02  1:29     ` Greg Kroah-Hartman
2014-10-29 22:00 ` kdbus: add header file Greg Kroah-Hartman
2014-10-30  8:20   ` Arnd Bergmann
2014-10-30 11:02     ` Tom Gundersen
2014-10-30 11:26       ` Arnd Bergmann
2014-10-30 11:52         ` Daniel Mack
2014-10-30 12:03           ` Arnd Bergmann
2014-10-31 10:03             ` Daniel Mack
2014-10-29 22:00 ` kdbus: add driver skeleton, ioctl entry points and utility functions Greg Kroah-Hartman
2014-10-30  3:50   ` Eric W. Biederman
2014-10-30 23:45   ` Thomas Gleixner
2014-10-31  0:23     ` Jiri Kosina
2014-10-31  0:42       ` Thomas Gleixner
2014-10-29 22:00 ` kdbus: add connection pool implementation Greg Kroah-Hartman
2014-10-29 22:00 ` kdbus: add connection, queue handling and message validation code Greg Kroah-Hartman
     [not found]   ` <87k33iw759.fsf@x220.int.ebiederm.org>
2014-10-30  3:55     ` Andy Lutomirski
2014-10-30  9:06       ` Djalal Harouni
2014-10-29 22:00 ` kdbus: add code to gather metadata Greg Kroah-Hartman
2014-10-29 22:33   ` Andy Lutomirski
2014-10-30  0:13     ` Andy Lutomirski
2014-10-30  8:45       ` Daniel Mack
2014-10-30 14:07         ` Andy Lutomirski
2014-10-30 15:54           ` Daniel Mack
2014-10-30 21:01             ` Andy Lutomirski
2014-11-01 11:05               ` Daniel Mack
2014-11-01 16:19                 ` Andy Lutomirski
2014-11-03 12:00                   ` Simon McVittie
2014-11-03 17:05                     ` Andy Lutomirski
2014-10-30  8:09     ` Daniel Mack
2014-10-29 22:00 ` kdbus: add code for notifications and matches Greg Kroah-Hartman
2014-10-29 22:00 ` kdbus: add code for buses, domains and endpoints Greg Kroah-Hartman
2014-10-30  3:59   ` Eric W. Biederman
2014-10-30  9:58     ` Djalal Harouni
2014-10-30 12:15       ` Eric W. Biederman
2014-10-30 14:48         ` Djalal Harouni
2014-10-30 14:58           ` Andy Lutomirski
2014-10-30 18:08             ` Djalal Harouni
2014-10-30 18:46               ` Simon McVittie
2014-11-05 19:59                 ` Djalal Harouni
2014-10-30 20:37               ` Andy Lutomirski
     [not found]                 ` <m2ublh$5h7$2@ger.gmane.org>
2014-10-30 22:00                   ` Andy Lutomirski
2014-10-30 23:38   ` How Not To Use kref (was Re: kdbus: add code for buses, domains and endpoints) Al Viro
2014-10-31 18:00     ` Linus Torvalds
2014-10-31 19:56       ` Al Viro
2014-11-04  9:11     ` David Herrmann
2014-10-31  1:39   ` kdbus: add code for buses, domains and endpoints Al Viro
2014-10-31  9:55     ` Daniel Mack
2014-10-29 22:00 ` kdbus: add name registry implementation Greg Kroah-Hartman
2014-10-29 22:00 ` kdbus: add policy database implementation Greg Kroah-Hartman
2014-10-29 22:00 ` kdbus: add Makefile, Kconfig and MAINTAINERS entry Greg Kroah-Hartman
2014-10-29 22:00 ` kdbus: add selftests Greg Kroah-Hartman
2014-10-30  8:31   ` Arnd Bergmann
2014-11-14  3:42   ` Michael Ellerman
2014-11-14  8:56     ` Daniel Mack
2014-10-29 22:15 ` [PATCH 00/12] Add kdbus implementation Greg KH
2014-10-30  4:04   ` Eric W. Biederman
2014-10-30  7:12     ` Daniel Mack
2014-10-29 22:15 ` Andy Lutomirski
2014-10-29 22:27   ` Greg Kroah-Hartman
2014-10-29 22:34     ` Andy Lutomirski
2014-10-30  2:27     ` Andy Lutomirski
2014-10-30  4:20       ` Eric W. Biederman
2014-10-30 10:15         ` Tom Gundersen
2014-10-30 12:02           ` Eric W. Biederman
2014-10-30 13:48           ` Andy Lutomirski
2014-10-29 22:19 ` Andy Lutomirski
2014-10-29 22:25   ` Greg Kroah-Hartman
2014-10-29 22:28     ` Andy Lutomirski
2014-10-29 22:36       ` Andy Lutomirski
2014-10-30  7:44       ` Daniel Mack
2014-11-05 14:34   ` Daniel Mack
2014-10-29 23:00 ` Jiri Kosina
2014-10-29 23:11   ` Greg Kroah-Hartman
2014-10-29 23:12     ` Greg Kroah-Hartman
2014-10-29 23:24     ` Jiri Kosina
2014-10-29 23:26       ` Jiri Kosina
2014-10-29 23:34         ` Greg Kroah-Hartman
2014-10-29 23:40       ` Greg Kroah-Hartman
2014-10-29 23:55         ` Andy Lutomirski
2014-10-30 11:52           ` Tom Gundersen
2014-10-30 12:28             ` Simon McVittie
2014-10-30 13:59             ` Andy Lutomirski
2014-10-30 20:28               ` Alex Elsayed
2014-10-30  9:51         ` Karol Lewandowski
2014-10-30 10:44           ` Karol Lewandowski
2014-10-30 14:47             ` Greg Kroah-Hartman
2014-10-30 19:55               ` Karol Lewandowski
2014-10-30 20:24                 ` Greg Kroah-Hartman
2014-10-31 11:15                   ` Karol Lewandowski
2014-10-30 23:13                 ` One Thousand Gnomes
2014-10-31 10:58                   ` Karol Lewandowski
2014-10-30 23:39                 ` Paul Moore
2014-10-31 14:21                   ` Karol Lewandowski
     [not found]                     ` <1414773397-26490-1-git-send-email-k.lewandowsk@samsung.com>
     [not found]                       ` <20141107180120.GA15387@kroah.com>
2014-11-09  0:07                         ` [RFC PATCH 0/5] kdbus: add support for lsm Karol Lewandowski
     [not found]                       ` <1414773397-26490-2-git-send-email-k.lewandowsk@samsung.com>
2014-11-17  1:47                         ` [PATCH 1/5] kdbus: extend structures with security pointer " Karol Lewandowski
2014-11-17 18:37                           ` Greg KH
2014-11-02  1:21   ` [PATCH 00/12] Add kdbus implementation Greg Kroah-Hartman
2014-11-03 14:38     ` One Thousand Gnomes
2014-10-30  8:33 ` Arnd Bergmann
2014-10-30 16:17   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).