From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.01.org
Subject: Re: [PATCH v2 08/11] dbus: Fix the kdbus message encoding
Date: Tue, 12 Apr 2016 17:25:27 -0500 [thread overview]
Message-ID: <570D75D7.7000704@gmail.com> (raw)
In-Reply-To: <CAOq732K6svEyShfP5qziUMyggjDHG_A5tdTqRy32HxOnhX3tjQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2381 bytes --]
Hi Andrew,
On 04/12/2016 05:10 PM, Andrzej Zaborowski wrote:
> Hi Denis,
>
> On 12 April 2016 at 23:46, Denis Kenzior <denkenz@gmail.com> wrote:
>> On 04/11/2016 08:56 PM, Andrew Zaborowski wrote:
>>>
>>> Keep sending the message header+padding as a separate
>>> KDBUS_ITEM_PAYLOAD_OFF buffer like in DBus-1, the systemd busctl utility
>>> also seems to do that. But fix what we send after the header.
>>> ---
>>> ell/dbus-kernel.c | 17 +++++++++--------
>>> ell/dbus-message.c | 19 +++++++++++++++++++
>>> ell/dbus-private.h | 3 +++
>>> 3 files changed, 31 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/ell/dbus-kernel.c b/ell/dbus-kernel.c
>>> index 7797153..da5920f 100644
>>> --- a/ell/dbus-kernel.c
>>> +++ b/ell/dbus-kernel.c
>>> @@ -427,14 +427,15 @@ int _dbus_kernel_send(int fd, size_t bloom_size,
>>> uint8_t bloom_n_hash,
>>> item->vec.size = header_size;
>>> item = KDBUS_ITEM_NEXT(item);
>>>
>>> - body = _dbus_message_get_body(message, &body_size);
>>> - if (body_size > 0) {
>>> - item->size = KDBUS_ITEM_HEADER_SIZE + sizeof(struct
>>> kdbus_vec);
>>> - item->type = KDBUS_ITEM_PAYLOAD_VEC;
>>> - item->vec.address = (uintptr_t) body;
>>> - item->vec.size = body_size;
>>> - item = KDBUS_ITEM_NEXT(item);
>>> - }
>>> + _dbus_message_build_contents(message, NULL, &body_size);
>>> + body = alloca(body_size);
>>
>>
>> This will fail badly somewhere around body_size >= 64k, depending on the
>> platform. Why can't we write the contents directly like we used to?
>
> Hmm true. But the body is now enclosed in a variant, so what buffer
> do you suggest to write that into and assign to item->ver.address?
>
This is actually a nasty issue with kdbus. As you say, variant must be
a single type, this is specified in DBus-1 Spec somewhere. So if we are
to enclose it in a variant like kdbus wants, then it either needs to be:
1. enclosed in '()'
2. special cased.
You're doing 1, however won't this result in the message signature being
different depending on the the transport being used?
Can we special case the building of this variant for gvariant based
messages? Similar to how we're generating the signature on the fly in
the builder?
Regards,
-Denis
next prev parent reply other threads:[~2016-04-12 22:25 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-12 1:56 [PATCH v2 01/11] dbus: Validate field type in get_header_field Andrew Zaborowski
2016-04-12 1:56 ` [PATCH v2 02/11] dbus: Check some more return values when parsing messages Andrew Zaborowski
2016-04-12 18:53 ` Denis Kenzior
2016-04-12 1:56 ` [PATCH v2 03/11] dbus: GVariant header field identifiers are 64-bit Andrew Zaborowski
2016-04-12 1:56 ` [PATCH v2 04/11] dbus: Fix parsing GVariant header/body information Andrew Zaborowski
2016-04-12 21:15 ` Denis Kenzior
2016-04-12 1:56 ` [PATCH v2 05/11] dbus: GVariant message cookie and reply cookie are 64-bit Andrew Zaborowski
2016-04-12 21:18 ` Denis Kenzior
2016-04-12 22:00 ` Andrzej Zaborowski
2016-04-12 1:56 ` [PATCH v2 06/11] dbus: Don't rely on 1st KDBUS_ITEM_PAYLOAD_OFF being the header Andrew Zaborowski
2016-04-12 1:56 ` [PATCH v2 07/11] gvariant: Utility to build GVariant message out of header+body Andrew Zaborowski
2016-04-12 21:44 ` Denis Kenzior
2016-04-12 22:06 ` Andrzej Zaborowski
2016-04-12 1:56 ` [PATCH v2 08/11] dbus: Fix the kdbus message encoding Andrew Zaborowski
2016-04-12 21:46 ` Denis Kenzior
2016-04-12 22:10 ` Andrzej Zaborowski
2016-04-12 22:25 ` Denis Kenzior [this message]
2016-04-12 23:06 ` Andrzej Zaborowski
2016-04-12 23:11 ` Andrzej Zaborowski
2016-04-12 23:30 ` Denis Kenzior
2016-04-12 23:18 ` Denis Kenzior
2016-04-12 23:30 ` Andrzej Zaborowski
2016-04-12 23:42 ` Denis Kenzior
2016-04-13 0:14 ` Denis Kenzior
2016-04-13 0:23 ` Andrzej Zaborowski
2016-04-12 1:56 ` [PATCH v2 09/11] dbus: Rename _dbus_header_is_valid to _dbus1_header_is_valid Andrew Zaborowski
2016-04-12 1:56 ` [PATCH v2 10/11] gvariant: Fix empty structure/array parsing and error check Andrew Zaborowski
2016-04-12 1:56 ` [PATCH v2 11/11] unit: Fix GVariant test messages Andrew Zaborowski
2016-04-12 18:51 ` [PATCH v2 01/11] dbus: Validate field type in get_header_field Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=570D75D7.7000704@gmail.com \
--to=denkenz@gmail.com \
--cc=ell@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.