HomeFreeBSD

netlink: Align allocations on __max_align_t, not uint64_t.

Description

netlink: Align allocations on __max_align_t, not uint64_t.

uint64_t is not sufficient alignment for allocators on all platforms.
On a CHERI platform pointers require 16 byte alignment, but also if a
type contained a uint128_t or long double it would not be aligned
correctly either. C11 added max_align_t precisely to provide a
portable type for allocators to use.

Reviewed by: melifaro
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D41301

Details

Provenance
jhbAuthored on Aug 10 2023, 6:12 PM
Reviewer
melifaro
Differential Revision
D41301: netlink: Align allocations on __max_align_t, not uint64_t.
Parents
rG2bd446d7f1a0: kern: osd: avoid dereferencing freed slots
Branches
Unknown
Tags
Unknown