kdbus.h: remove starttime from struct kdbus_pids (ABI break)

Recording the starttie in order to protect against PID overflows is a
hack. Remove it for now, and wait for a better solution to land in
mainline.

Signed-off-by: Daniel Mack <daniel@zonque.org>
test: fix the CONFIG_SECURITY and SELINUX seclabel check

This fixes the attach-flags test that was failing on kernels with
CONFIG_SECURITY=y set but all other LSMs are disabled

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
test: add kdbus_bus_creator_info() and use it

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
test: fix that CONFIG_SECURITY detection function

Sorry previous patch just mixed the return values... This one should
work now.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
test: rename kdbus_info() into kdbus_conn_info()

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
bus: introduce KDBUS_ITEM_ATTACH_FLAGS_SEND the attach flags of bus owner

We want the bus owner to have its attach flags send item that will
contain a set of KDBUS_ATTACH_* items that other connections may see
when they do a KDBUS_CMD_BUS_CREATOR_INFO ioctl. This allows the bus
creator to hide some of its metadata

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
test: add the kdbus_test_bus_creator_info test

This test will be used to query the metadata of the bus owner.

Currently the KDBUS_CMD_BUS_CREATOR_INFO ioctl is broken, no metadata
is returned, next patch will fix it.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
bus: fix KDBUS_CMD_BUS_CREATOR_INFO ioctl

The iov count in kdbus_cmd_bus_creator_info() is broken some iov will
overwrite others, so fix the count and while we are it re-order some
logic. This way the function will be able later to use the bus owner
attach mask to hide some of its metadata. It will be added later.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
test: fix typo

s/dameon/daemon/
kdbus: drop *_MSG_* from ioctl names

Now that we're about to introduce "struct kdbus_cmd_send" it seems rather
inconsistent to not name IOCTLs and their payloads the same. We never used
the *_MSG_* part (like KDBUS_CMD_MSG_SEND) anywhere but in the ioctl name.
Drop it now.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
kdbus: add items to kdbus_cmd_recv

We use items as CMD extensions everwhere except on CMD_RECV. This is
pretty inconsistent. Add them now so we can later support things like
additional filters, timeouts and more.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
kdbus: add generic kdbus_reply object

Once we convert CMD_SEND to use kdbus_cmd_send, we have two ioctls that
can return messages. Make sure we're consistent and use the same storage
for both. Introduce kdbus_reply as sub-object which contains all fields
with information about the returned message.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
tools: fix kdbus monitor

Several fixes:
 - adapt to "new" CMD_FREE
 - use new CMD_RECV

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
kdbus: introduce kdbus_cmd_send

This introduces a new payload for KDBUS_CMD_SEND. Instead of passing the
message directly, we now split between messages and commands. This allows
us to drop several wrongly placed control fields from kdbus_msg and move
them into kdbus_cmd_send.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
handle: modify match handle for connection types

Recently, monitor lost the necessity to add_match because it should receive all
messages for debug. So here we remove the remove_match capability for simetry
reasons.
Also since activators are full receivers citizens, they may also need to handle
matches.

Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>
test-benchmark: split memfds and nomemfds tests

split the benchmark test in two, to avoid recompile to run the 2 majors flavour
of testing: with and without memfds in the msg payload.

Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>
kdbus.txt: fix typos

fix some documentation typos

Signed-off-by: Michele Curti <michele.curti@gmail.com>
Changelog: credit contributors

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
handle: activator should not be allowed to install matches

Matches for activators don't have a valid use case, so we shouldn't allow
that for now.

This partly reverts commit 411e3347 ("handle: modify match handle for
connection types").

Signed-off-by: Daniel Mack <daniel@zonque.org>
handle: remove unneeded { }

Signed-off-by: Daniel Mack <daniel@zonque.org>