HomeFreeBSD

libnv: fix heap overflow in nvlist_recv()

Description

libnv: fix heap overflow in nvlist_recv()

nvlist_check_header() validated nvlh_size for overflow before
performing conversion. An mallicous user can set
NV_FLAG_BIG_ENDIAN in the header and craft nvlh_size so that
the orginall value passes the check, but after the conversion the
sizeof(nvlist_header) + size can overflow.
This can lead to a heap buffer overflow.

Approved by: so
Security: FreeBSD-SA-26:17.libnv
Security: CVE-2026-35547
Fixes: 36fa90dbde0060aacb5677d0b113ee168e839071
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56342

Details

Provenance
oshogboAuthored on Apr 28 2026, 2:36 PM
markjCommitted on Apr 29 2026, 2:45 PM
Reviewer
markj
Differential Revision
D56342: libnv: fix heap overflow in nvlist_recv()
Parents
rG45809b0e1bc1: libnv: switch fd_wait() from select(2) to poll(2)
Branches
Unknown
Tags
Unknown