HomeFreeBSD

bhyve: avoid theoretical stack buffer overflow from integer overflow

Description

bhyve: avoid theoretical stack buffer overflow from integer overflow

Use the proper size_t type to match strlen's return type. This is not
exploitable in practice as this parses command line arguments, which
are limited to well below 2^31 bytes.

This is a minimal change to address the reported issue; hda_parse_config
and the rest of this file will benefit from further review.

Reported by: Fakhri Zulkifli
Reviewed by: jhb, markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

Details

Provenance
emasteAuthored on
Parents
rS349384: fusefs: fix the tests for nondefault values of vfs.maxbcachebuf
Branches
Unknown
Tags
Unknown