HomeFreeBSD

umb: avoid buffer overflow in umb_in_len2mask()

Description

umb: avoid buffer overflow in umb_in_len2mask()

len comes from ipv4elem.prefixlen in a MBIM_CID_IP_CONFIGURATION message
from the USB device, and should not be trusted, as it could be any
uint32_t value. Without this extra check, a potential buffer overflow
could subsequently occur in umb_in_len2mask().

Fix from Gerhard Roth, after coordination upstream with OpenBSD.

PR: 284904
Reported by: Robert Morris <rtm@lcs.mit.edu>
Approved by: philip (mentor)
Sponsored by: The FreeBSD Foundation

Details

Provenance
khorbenAuthored on May 26 2025, 11:18 PM
Parents
rG7f81f87a74a4: pf: remove unused 'dir' argument in pf_reassemble()
Branches
Unknown
Tags
Unknown