[systemd-devel] Suspicious assertions in resolved

David Herrmann dh.herrmann at gmail.com
Sun Jan 18 13:23:03 PST 2015


Hi

On Sun, Jan 18, 2015 at 10:15 PM, Topi Miettinen <toiwoton at gmail.com> wrote:
> On 01/18/15 20:45, David Herrmann wrote:
>> Hi
>>
>> On Sun, Jan 18, 2015 at 8:12 PM, Topi Miettinen <toiwoton at gmail.com> wrote:
>>> Hello,
>>>
>>> I think resolved_manager.c function manager_recv() has an assertion that
>>> could be triggerable by the server sending an oversized packet:
>>>
>>>         assert(!(mh.msg_flags & MSG_TRUNC));
>>>
>>> The other assertions look suspicious too but I don't know if they can
>>> really be triggered by the other side.
>>
>> We use FIONREAD to read the size of the next pending datagram.
>> Therefore, MSG_TRUNC cannot be set. Similarly, we provide suitable
>> control-data space so MSG_CTRUNC cannot be set, either.
>
> OK. What about the assertions later, is it possible to receive a reply
> via IPv6 for IPv4 request or the other way around?

Those asserts verify that the CMSG socket-type is the same as the
PACKET/PEER socket-type. I don't see how this looks at the
request-type? Those assert()s look good to me.

Thanks
David


More information about the systemd-devel mailing list