HomeFreeBSD

netlink: make netlink work correctly on CHERI.

Description

netlink: make netlink work correctly on CHERI.

Current Netlink message writer code relies on executing callbacks
with arbitrary data (pointer or integer) to flush the completed
messages.
This arbitrary data is stored as a union of { void *, uint64_t }.
At some stage, the message flushing code copied this data, using
direct uint64_t assignment instead of copying the union. It lead
to failure on CHERI, as sizeof(pointer) == 16 there.

Fix the code by making union non-anonymous and copying it entirely.

Reviewed by: br, jhb, jrtc27
Differential Revision: https://reviews.freebsd.org/D39557
MFC after: 2 weeks

Details

Provenance
melifaroAuthored on Apr 13 2023, 11:53 AM
Reviewer
br
Differential Revision
D39557: netlink: make netlink work correctly on CHERI.
Parents
rG3e5d0784b9b5: Testing: add framework for the kernel unit tests.
Branches
Unknown
Tags
Unknown