jow- / ucode

JavaScript-like language with optional templating
ISC License
90 stars 30 forks source link

rtnl: zero request message headers #82

Closed jow- closed 2 years ago

jow- commented 2 years ago

For route netlink request messages having a header struct, uc_nl_request() invokes nlmsg_reserve() to reserve room for the struct data but the nlmsg_reserve() function only zeroes additional alignment bytes, not the actual reserved buffer space.

Extend the existing logic to explicitly zero out the reserved header space in order to avoid sending uninitialized struct member values to the kernel.

Signed-off-by: Jo-Philipp Wich jo@mein.io