[systemd-commits] 3 commits - src/libsystemd TODO

David Herrmann dvdhrm at kemper.freedesktop.org
Thu Dec 11 01:54:38 PST 2014


 TODO                                |    3 +--
 src/libsystemd/sd-bus/bus-message.c |   12 ++++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 055b27f29484b625e03706319c918e3a644e00b9
Author: David Herrmann <dh.herrmann at gmail.com>
Date:   Thu Dec 11 10:45:58 2014 +0100

    bus: zero cmd_free before passing to ioctl
    
    Make sure the whole cmd_free object is zeroed before passing it into the
    kernel. This makes valgrind happy and makes us future proof.

diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 0803999..6bf39ce 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -130,7 +130,7 @@ static void message_free(sd_bus_message *m) {
         message_reset_parts(m);
 
         if (m->release_kdbus) {
-                struct kdbus_cmd_free cmd_free;
+                struct kdbus_cmd_free cmd_free = { };
 
                 cmd_free.flags = 0;
                 cmd_free.offset = (uint8_t *)m->kdbus - (uint8_t *)m->bus->kdbus_buffer;

commit becb1a6e9deabad529c8bc1c90eb7d947505695b
Author: David Herrmann <dh.herrmann at gmail.com>
Date:   Thu Dec 11 10:44:41 2014 +0100

    bus: fix memfd-cache regarding memfd offsets
    
    We must restore part->mmap_begin when poping memfds from the memfd-cache.
    We rely on the memfds to be unsealed, so we can be sure that we own the
    whole FD. Therefore, simply set part->mmap_begin to the same as
    part->data.
    
    This fixes test-bus-kernel-benchmark.

diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 06d8d77..0803999 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -65,9 +65,11 @@ static void message_free_part(sd_bus_message *m, struct bus_body_part *part) {
                 /* If we can reuse the memfd, try that. For that it
                  * can't be sealed yet. */
 
-                if (!part->sealed)
+                if (!part->sealed) {
+                        assert(part->memfd_offset == 0);
+                        assert(part->data == part->mmap_begin);
                         bus_kernel_push_memfd(m->bus, part->memfd, part->data, part->mapped, part->allocated);
-                else {
+                } else {
                         if (part->mapped > 0)
                                 assert_se(munmap(part->mmap_begin, part->mapped) == 0);
 
@@ -1103,8 +1105,10 @@ static int part_make_space(
         if (m->poisoned)
                 return -ENOMEM;
 
-        if (!part->data && part->memfd < 0)
+        if (!part->data && part->memfd < 0) {
                 part->memfd = bus_kernel_pop_memfd(m->bus, &part->data, &part->mapped, &part->allocated);
+                part->mmap_begin = part->data;
+        }
 
         if (part->memfd >= 0) {
 

commit 1f140dd8b048c5f5599a886b8c4d20f3f1065774
Author: David Herrmann <dh.herrmann at gmail.com>
Date:   Thu Dec 11 09:01:34 2014 +0100

    TODO: update
    
    Drop resolved kdbus issues.

diff --git a/TODO b/TODO
index af7bdef..954f312 100644
--- a/TODO
+++ b/TODO
@@ -302,7 +302,6 @@ Features:
 * sd-bus:
   - kdbus: process fd=-1 for incoming msgs
   - make dsrt happy, and change userspace header for kdbus to yyyyuta{tv}v
-  - kdbus: remove NameOwnerChanged kernel messages for monitors
   - kdbus: PID/TID goes missing for method calls from outside the PID namespace?
   - kdbus: the kernel should not allow messages to be delivered that have a reply serial != 0, reply-expect unset, but no appropriate window
   - kdbus: timestamps on kernel's NameOwnerChanged messages?
@@ -311,7 +310,7 @@ Features:
     without the active policy and should get a Wants=org.freedesktop.resolve1.busname to
     pull-in the policy.
   - port to sd-resolve for connecting to TCP dbus servers
-  - kdbus: maybe add controlling tty and ppid metadata fields
+  - kdbus: maybe add controlling tty metadata fields
   - see if we can introduce a new sd_bus_get_owner_machine_id() call to retrieve the machine ID of the machine of the bus itself
   - when kdbus does not take our message without memfds, try again with memfds
   - introduce sd_bus_emit_object_added()/sd_bus_emit_object_removed() that automatically includes the build-in interfaces in the list



More information about the systemd-commits mailing list