Download raw body.
[Kyle Ackerman] Re: imsg_get_data Question
-------------------- Start of forwarded message --------------------
From: Kyle Ackerman <kack@kyleackerman.net>
To: Florian Obser <florian@openbsd.org>
Subject: Re: imsg_get_data Question
Date: Sun, 16 Aug 2026 12:52:15 -0600
Florian Obser <florian@openbsd.org> writes:
> imsg is usually used over a privilege boundary. The sender is supposed
> to send exactly len bytes of data. If it fails to do that the receiver
> has to assume the sender is compromised and terminate itself.
> E.g. (dhcpleased/engine.c):
>
> case IMSG_CTL_LOG_VERBOSE:
> if (imsg_get_data(&imsg, &verbose,
> sizeof(verbose)) == -1)
> fatalx("%s: invalid %s", __func__, i2s(type));
For more context, there is a current use case in Got where we send over
a struct and a string in the same imsg. I imagined a case where you can
do multiple imsg_get_data(3) calls, over predefined lengths, to utilize
the rpos and wpos fields to incrementally extract seprate data.
-------------------- End of forwarded message --------------------
[Kyle Ackerman] Re: imsg_get_data Question