platform/core/system/kdbus-bus.git
10 years agoconnection: kill unneeded include upstream/0.20140120.123719
Daniel Mack [Mon, 20 Jan 2014 11:37:19 +0000 (12:37 +0100)]
connection: kill unneeded include

10 years agouse the kernel's generate_random_uuid()
Kay Sievers [Mon, 20 Jan 2014 09:44:37 +0000 (10:44 +0100)]
use the kernel's generate_random_uuid()

10 years agoTODO: update
Kay Sievers [Mon, 20 Jan 2014 09:31:12 +0000 (10:31 +0100)]
TODO: update

10 years agouse uid_eq()
Kay Sievers [Mon, 20 Jan 2014 09:04:00 +0000 (10:04 +0100)]
use uid_eq()

10 years agonamespace: remove debug print
Kay Sievers [Mon, 20 Jan 2014 03:18:31 +0000 (04:18 +0100)]
namespace: remove debug print

10 years agoconnection: fix queue entry locking
Daniel Mack [Sun, 19 Jan 2014 22:25:45 +0000 (23:25 +0100)]
connection: fix queue entry locking

Don't access the queue entry's members without holder the connection's
lock.

10 years agoconnection: kill unused variable
Daniel Mack [Sun, 19 Jan 2014 22:02:59 +0000 (23:02 +0100)]
connection: kill unused variable

10 years agoconnection: remember the reply in the queue item
Daniel Mack [Sun, 19 Jan 2014 21:53:55 +0000 (22:53 +0100)]
connection: remember the reply in the queue item

When an implementor takes over a name from an activator, we must make
sure the overtaking connection is actually able to answer to the waiting
connection.

10 years agoconnection: pass back the full queue element from kdbus_conn_queue_insert
Daniel Mack [Sun, 19 Jan 2014 21:52:50 +0000 (22:52 +0100)]
connection: pass back the full queue element from kdbus_conn_queue_insert

That way, we can fiddle with the contents of the queue entries in
more flexible ways.

10 years agoconnection: assorted sync_reply fixes and cleanups
Daniel Mack [Sun, 19 Jan 2014 20:16:43 +0000 (21:16 +0100)]
connection: assorted sync_reply fixes and cleanups

10 years agoconnection: fix kernel doc comment
Daniel Mack [Sat, 18 Jan 2014 17:42:08 +0000 (18:42 +0100)]
connection: fix kernel doc comment

10 years agoincrease hash tables for connections and names
Kay Sievers [Sat, 18 Jan 2014 16:38:08 +0000 (17:38 +0100)]
increase hash tables for connections and names

10 years agolimit the number of buses and connections per user
Kay Sievers [Sat, 18 Jan 2014 16:31:41 +0000 (17:31 +0100)]
limit the number of buses and connections per user

10 years agoconnection: delete timer on error
Kay Sievers [Sat, 18 Jan 2014 16:21:48 +0000 (17:21 +0100)]
connection: delete timer on error

10 years agodo not shortcut handle state with KDBUS_CMD_BYEBYE, it leaks the namespace ref
Kay Sievers [Sat, 18 Jan 2014 15:35:48 +0000 (16:35 +0100)]
do not shortcut handle state with KDBUS_CMD_BYEBYE, it leaks the namespace ref

10 years agoconnection: delay sending messages to monitor connections
Daniel Mack [Sat, 18 Jan 2014 14:57:39 +0000 (15:57 +0100)]
connection: delay sending messages to monitor connections

Only supply messages to monitor connections in case
kdbus_conn_queue_insert() for the actual destination succeeded.

10 years agoconnection: add comment about wait_event
Daniel Mack [Sat, 18 Jan 2014 14:57:35 +0000 (15:57 +0100)]
connection: add comment about wait_event

10 years agokerneldoc: s/Returns/Return/, s/any value/negative errno/, move "Return:" to last...
Kay Sievers [Sat, 18 Jan 2014 14:39:34 +0000 (15:39 +0100)]
kerneldoc: s/Returns/Return/, s/any value/negative errno/, move "Return:" to last line

10 years agoproperly drop references of endpoint and activator connection
Kay Sievers [Sat, 18 Jan 2014 14:12:41 +0000 (15:12 +0100)]
properly drop references of endpoint and activator connection

10 years agoconnection: only schedule timeout scan for async operation
Daniel Mack [Sat, 18 Jan 2014 11:42:47 +0000 (12:42 +0100)]
connection: only schedule timeout scan for async operation

10 years agotest/test-kdbus-sync.c: kill unused variable
Daniel Mack [Sat, 18 Jan 2014 11:42:18 +0000 (12:42 +0100)]
test/test-kdbus-sync.c: kill unused variable

10 years agokdbus.h: document two new possible error values
Daniel Mack [Sat, 18 Jan 2014 00:02:28 +0000 (01:02 +0100)]
kdbus.h: document two new possible error values

10 years agohandle: fix potential mem leak when kdbus_conn_kmsg_send() fails
Daniel Mack [Fri, 17 Jan 2014 23:02:37 +0000 (00:02 +0100)]
handle: fix potential mem leak when kdbus_conn_kmsg_send() fails

10 years agotest: add test for sync message ping-pong
Daniel Mack [Fri, 17 Jan 2014 22:35:49 +0000 (23:35 +0100)]
test: add test for sync message ping-pong

10 years agoconnection: add syncronous message reply mechanism
Daniel Mack [Fri, 17 Jan 2014 22:03:32 +0000 (23:03 +0100)]
connection: add syncronous message reply mechanism

Sending a message with (KDBUS_MSG_FLAGS_EXPECT_REPLY |
KDBUS_MSG_FLAGS_SYNC_REPLY) will result in the KDBUS_CMD_MSG_SEND ioctl
will block until the receiving connection has replied or the specified
timeout is hit.

When the round-trip succeeded, .offset_reply in the sender's message is
set to the offset where the reply can be found, and the message is
accepted and received automatically. The sender is still in charge of
freeing the message though.

This breaks with Greg's original matra that we followed elsewhere
in the design of kbus: "nothing blocks, ever". But hey, it an optional
feature after all :)

10 years agokdbus.h, message: prepare for synchronous operations (ABI break)
Daniel Mack [Fri, 17 Jan 2014 20:33:04 +0000 (21:33 +0100)]
kdbus.h, message: prepare for synchronous operations (ABI break)

10 years agoconnection: let kdbus_conn_queue_insert() hand back the used offset
Daniel Mack [Fri, 17 Jan 2014 20:31:11 +0000 (21:31 +0100)]
connection: let kdbus_conn_queue_insert() hand back the used offset

... so we can store the answer offset in case of synchronous operations.

10 years agoconnection: split receive logic
Daniel Mack [Fri, 17 Jan 2014 20:27:21 +0000 (21:27 +0100)]
connection: split receive logic

This allows us to call the receive logic internally which is needed to
automatically receive a message in synchronous operation.

10 years agofix kerneldoc
Kay Sievers [Fri, 17 Jan 2014 00:59:45 +0000 (01:59 +0100)]
fix kerneldoc

10 years agokdbus.h: fix comments
Kay Sievers [Fri, 17 Jan 2014 00:42:11 +0000 (01:42 +0100)]
kdbus.h: fix comments

10 years agoupdate RECV ioctl and implement priority queues (ABI break)
Kay Sievers [Thu, 16 Jan 2014 09:35:43 +0000 (10:35 +0100)]
update RECV ioctl and implement priority queues (ABI break)

10 years agoTODO: update
Kay Sievers [Thu, 16 Jan 2014 09:30:13 +0000 (10:30 +0100)]
TODO: update

10 years agobus: make conn_seq_last atomic64_t
Daniel Mack [Thu, 16 Jan 2014 18:35:53 +0000 (19:35 +0100)]
bus: make conn_seq_last atomic64_t

conn->id is now assigned outside of the bus' lock, so an atomic64_t is
nicer.

10 years agotest: test-kdbus-timeout: cleanups, less verbosity
Daniel Mack [Thu, 16 Jan 2014 18:02:18 +0000 (19:02 +0100)]
test: test-kdbus-timeout: cleanups, less verbosity

10 years agoconnection: fix error unwinding of kdbus_conn_new()
Daniel Mack [Thu, 16 Jan 2014 17:45:15 +0000 (18:45 +0100)]
connection: fix error unwinding of kdbus_conn_new()

It's not safe to unref a half-baked connection, so conduct a real error
unwinding in case of errors.

10 years agotest: test-timeout: add dirty hack for loop mode
Daniel Mack [Thu, 16 Jan 2014 16:05:44 +0000 (17:05 +0100)]
test: test-timeout: add dirty hack for loop mode

10 years agoconnection: kick off timeout scan for conn_src, not conn_dst
Daniel Mack [Thu, 16 Jan 2014 15:59:47 +0000 (16:59 +0100)]
connection: kick off timeout scan for conn_src, not conn_dst

conn_src is the one we added the reply list to, so this one should be
kicked off.

Note that the first invocation of the timeout scanner will unlikely do
any real work anyway. The reason for calling it here is that it will
implicitly calculate a new deadline, and arm the timer.

10 years agoconnection: rework timeout logic
Daniel Mack [Thu, 16 Jan 2014 15:58:29 +0000 (16:58 +0100)]
connection: rework timeout logic

No functional change actually, just a code reordering that makes the
function more readable and saves us one level of indentation.

10 years agotest: improve reply timeout test
Daniel Mack [Thu, 16 Jan 2014 13:41:03 +0000 (14:41 +0100)]
test: improve reply timeout test

10 years agotest: add test for reply timeout
Kay Sievers [Thu, 16 Jan 2014 06:16:36 +0000 (07:16 +0100)]
test: add test for reply timeout

10 years agokdbus, endpoint: abort if device_register fails
Djalal Harouni [Wed, 15 Jan 2014 17:17:08 +0000 (18:17 +0100)]
kdbus, endpoint: abort if device_register fails

If device_register() fails then jump to exit to clean things up and
return.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
10 years agonamespace use 64 bit message seqnum
Kay Sievers [Tue, 14 Jan 2014 16:14:01 +0000 (00:14 +0800)]
namespace use 64 bit message seqnum

10 years agopool: remove debug function
Kay Sievers [Tue, 14 Jan 2014 16:13:45 +0000 (00:13 +0800)]
pool: remove debug function

10 years agoallow to set and query connections and memfds a human-readable names (ABI break)
Kay Sievers [Tue, 14 Jan 2014 11:15:10 +0000 (19:15 +0800)]
allow to set and query connections and memfds a human-readable names (ABI break)

10 years agoexport namespace-global message sequence number (ABI break)
Kay Sievers [Tue, 14 Jan 2014 07:59:04 +0000 (15:59 +0800)]
export namespace-global message sequence number (ABI break)

10 years agotest: use bool instead of int
Kay Sievers [Tue, 14 Jan 2014 07:58:43 +0000 (15:58 +0800)]
test: use bool instead of int

10 years agoidentify anon inode as [kdbus-memfd]
Kay Sievers [Sun, 12 Jan 2014 15:50:54 +0000 (23:50 +0800)]
identify anon inode as [kdbus-memfd]

10 years agoutil: fix typo
Daniel Mack [Mon, 13 Jan 2014 18:29:30 +0000 (19:29 +0100)]
util: fix typo

10 years agonamespace: spare one format variable in dev_set_name()
Daniel Mack [Mon, 13 Jan 2014 18:29:18 +0000 (19:29 +0100)]
namespace: spare one format variable in dev_set_name()

10 years agokerneldoc: remove unused ENOTCONN
Kay Sievers [Sun, 12 Jan 2014 02:53:12 +0000 (10:53 +0800)]
kerneldoc: remove unused ENOTCONN

10 years agoconnection: Fix timeout
Lukasz Skalski [Fri, 10 Jan 2014 09:51:12 +0000 (10:51 +0100)]
connection: Fix timeout

KDBUS_ITEM_REPLY_TIMEOUT have to be sent to src_id.

10 years agonames: switch locking order
Kay Sievers [Thu, 9 Jan 2014 00:14:22 +0000 (08:14 +0800)]
names: switch locking order

10 years agopool: use own lock to protect the slices lists
Kay Sievers [Wed, 8 Jan 2014 23:37:22 +0000 (07:37 +0800)]
pool: use own lock to protect the slices lists

10 years agoMerge pull request #12 from michelecurti/patch-1
Greg Kroah-Hartman [Wed, 8 Jan 2014 14:22:14 +0000 (06:22 -0800)]
Merge pull request #12 from michelecurti/patch-1

kdbus.txt: fix typo

10 years agofix typo
michelecurti [Wed, 8 Jan 2014 14:02:08 +0000 (15:02 +0100)]
fix typo

10 years agoTODO: update
Kay Sievers [Mon, 6 Jan 2014 16:31:48 +0000 (00:31 +0800)]
TODO: update

10 years agopolicy: require privileges for seeting the endpoint's policy
Kay Sievers [Sun, 5 Jan 2014 20:53:12 +0000 (00:53 +0400)]
policy: require privileges for seeting the endpoint's policy

10 years agotest: return error from loop
Kay Sievers [Sun, 5 Jan 2014 15:10:35 +0000 (19:10 +0400)]
test: return error from loop

10 years agotest: silence a Wmaybe-uninitialized report on ret variable
Djalal Harouni [Sat, 4 Jan 2014 19:46:46 +0000 (20:46 +0100)]
test: silence a Wmaybe-uninitialized report on ret variable

Silence the gcc Wmaybe-uninitialized report on ret variable, and avoid
an extra check since run_tests() already returns EXIT_FAILURE or
EXIT_SUCCESS

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
10 years agoendpoint: don't kfree a PTR_ERR
Djalal Harouni [Sat, 4 Jan 2014 21:21:51 +0000 (22:21 +0100)]
endpoint: don't kfree a PTR_ERR

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
10 years agoTODO: update
Kay Sievers [Sat, 4 Jan 2014 05:44:06 +0000 (09:44 +0400)]
TODO: update

10 years agomove devname validation to util.c
Kay Sievers [Sat, 4 Jan 2014 05:21:57 +0000 (09:21 +0400)]
move devname validation to util.c

10 years agosplit internal.h into defaults.h and util.h
Kay Sievers [Sat, 4 Jan 2014 05:05:04 +0000 (09:05 +0400)]
split internal.h into defaults.h and util.h

10 years agofix whitespace and comments
Kay Sievers [Sat, 4 Jan 2014 04:55:09 +0000 (08:55 +0400)]
fix whitespace and comments

10 years agoTODO: update
Kay Sievers [Sat, 4 Jan 2014 04:54:55 +0000 (08:54 +0400)]
TODO: update

10 years agovalidate incoming names for buses, namespaces, endpoints
Kay Sievers [Fri, 3 Jan 2014 23:13:52 +0000 (00:13 +0100)]
validate incoming names for buses, namespaces, endpoints

10 years agorequire privileges to activate or monitor
Kay Sievers [Fri, 3 Jan 2014 22:52:12 +0000 (23:52 +0100)]
require privileges to activate or monitor

10 years agoTODO: update
Kay Sievers [Fri, 3 Jan 2014 22:51:59 +0000 (23:51 +0100)]
TODO: update

10 years agoMerge pull request #7 from Keruspe/master
Greg Kroah-Hartman [Fri, 3 Jan 2014 17:46:41 +0000 (09:46 -0800)]
Merge pull request #7 from Keruspe/master

Makefile: fix typo

10 years agoMakefile: s/name/uname/
Greg Kroah-Hartman [Fri, 3 Jan 2014 17:46:02 +0000 (09:46 -0800)]
Makefile: s/name/uname/

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoTODO: update
Kay Sievers [Fri, 3 Jan 2014 02:25:31 +0000 (03:25 +0100)]
TODO: update

10 years agovarious 80 column warnings fixed up
Greg Kroah-Hartman [Wed, 1 Jan 2014 22:00:06 +0000 (14:00 -0800)]
various 80 column warnings fixed up

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agopolicy.c: use linux/uaccess.h not asm/uaccess.h
Greg Kroah-Hartman [Wed, 1 Jan 2014 21:59:36 +0000 (13:59 -0800)]
policy.c: use linux/uaccess.h not asm/uaccess.h

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agomore checkpatch space "fixes"
Greg Kroah-Hartman [Wed, 1 Jan 2014 21:54:38 +0000 (13:54 -0800)]
more checkpatch space "fixes"

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agonamespace.c: fix bug with trailing ; on an if statement
Greg Kroah-Hartman [Wed, 1 Jan 2014 21:54:20 +0000 (13:54 -0800)]
namespace.c: fix bug with trailing ; on an if statement

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agonotify.c: switch/case statement alignment.
Greg Kroah-Hartman [Wed, 1 Jan 2014 21:50:50 +0000 (13:50 -0800)]
notify.c: switch/case statement alignment.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agonotify.c: space checkpatch "fixes"
Greg Kroah-Hartman [Wed, 1 Jan 2014 21:49:58 +0000 (13:49 -0800)]
notify.c: space checkpatch "fixes"

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agokdbus.h: fix stupid checkpatch warnings about spaces in comments.
Greg Kroah-Hartman [Wed, 1 Jan 2014 21:47:00 +0000 (13:47 -0800)]
kdbus.h: fix stupid checkpatch warnings about spaces in comments.

ugh, trivial crud...

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agofix semicolon in if statement
Govindarajulu Varadarajan [Mon, 30 Dec 2013 12:57:33 +0000 (18:27 +0530)]
fix semicolon in if statement

Signed-off-by: Govindarajulu Varadarajan <govindarajulu90@gmail.com>
10 years agoFix some stupid checkpatch warnings in connection.h and names.h
Greg Kroah-Hartman [Mon, 30 Dec 2013 00:54:07 +0000 (16:54 -0800)]
Fix some stupid checkpatch warnings in connection.h and names.h

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agolimit the amount of request for a reply a connection can issue
Kay Sievers [Sat, 28 Dec 2013 17:29:05 +0000 (18:29 +0100)]
limit the amount of request for a reply a connection can issue

10 years agotest: benchmark - use sizeof(struct timeval)
Kay Sievers [Fri, 27 Dec 2013 12:02:26 +0000 (13:02 +0100)]
test: benchmark - use sizeof(struct timeval)

Simon Peeters 12:41 PM:
I am happy to let you all know that the error is not in the kdbus
code, but in the test code which has 16 hardcoded as the size of struct
timeval.

10 years agotest: cast addr to uintptr_t
Kay Sievers [Fri, 27 Dec 2013 11:58:24 +0000 (12:58 +0100)]
test: cast addr to uintptr_t

10 years agoMakefile: fix typo
Marc-Antoine Perennou [Thu, 26 Dec 2013 17:20:33 +0000 (02:20 +0900)]
Makefile: fix typo

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
10 years agogrant CAP_IPC_OWNER-like access to the owner of the bus
Kay Sievers [Fri, 27 Dec 2013 04:00:37 +0000 (05:00 +0100)]
grant CAP_IPC_OWNER-like access to the owner of the bus

10 years agodo not accept "kernel messages" from userspace
Kay Sievers [Fri, 27 Dec 2013 02:50:39 +0000 (03:50 +0100)]
do not accept "kernel messages" from userspace

10 years agokdbus.h: fix kernel doc
Kay Sievers [Thu, 26 Dec 2013 23:48:45 +0000 (00:48 +0100)]
kdbus.h: fix kernel doc

10 years agokdbus.h: KDBUS_ITEM_PRIORITY is not implemented and probably not even a good idea...
Lennart Poettering [Thu, 26 Dec 2013 20:43:11 +0000 (21:43 +0100)]
kdbus.h: KDBUS_ITEM_PRIORITY is not implemented and probably not even a good idea, let's remove it

10 years agouse module name for printk
Kay Sievers [Thu, 26 Dec 2013 12:19:31 +0000 (13:19 +0100)]
use module name for printk

10 years agoprint better error message
Kay Sievers [Thu, 26 Dec 2013 03:12:54 +0000 (04:12 +0100)]
print better error message

10 years agoTODO: update
Kay Sievers [Wed, 25 Dec 2013 23:09:48 +0000 (00:09 +0100)]
TODO: update

10 years agomemfd: use KBUILD_MODNAME
Kay Sievers [Wed, 25 Dec 2013 23:09:33 +0000 (00:09 +0100)]
memfd: use KBUILD_MODNAME

10 years agoallow to compile a separate kernel module with a named extension
Kay Sievers [Wed, 25 Dec 2013 22:37:44 +0000 (23:37 +0100)]
allow to compile a separate kernel module with a named extension

running:
  make EXT=2

will create a:
  kdbus2.ko

and the tests will run against:
  /dev/kdbus2/control

This allows us to run a new and separated kernel modules while the original
kdbus.ko is in use in the booted system.

10 years agofix kernel doc
Kay Sievers [Wed, 25 Dec 2013 16:59:07 +0000 (17:59 +0100)]
fix kernel doc

10 years agohandle timeouts only handled for expected replies, not for queued messages
Kay Sievers [Wed, 25 Dec 2013 15:33:21 +0000 (16:33 +0100)]
handle timeouts only handled for expected replies, not for queued messages

10 years agoTODO: update
Kay Sievers [Wed, 25 Dec 2013 04:43:38 +0000 (05:43 +0100)]
TODO: update

10 years agoconnection: fix access-after-free
Kay Sievers [Wed, 25 Dec 2013 04:16:36 +0000 (05:16 +0100)]
connection: fix access-after-free

10 years agoupdate cookie and cookie_reply logic
Kay Sievers [Wed, 25 Dec 2013 03:14:05 +0000 (04:14 +0100)]
update cookie and cookie_reply logic

10 years agoreturn error in kdbus_name_release()
Kay Sievers [Tue, 24 Dec 2013 23:20:06 +0000 (00:20 +0100)]
return error in kdbus_name_release()

10 years agodo not deny writing messages to an activator connection
Kay Sievers [Tue, 24 Dec 2013 21:44:07 +0000 (22:44 +0100)]
do not deny writing messages to an activator connection