Page MenuHomeFreeBSD

bhyve: Avoid passing a possible garbage pointer to free().
ClosedPublic

Authored by jhb on Nov 23 2022, 11:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 13, 5:36 AM
Unknown Object (File)
Thu, Mar 12, 7:53 PM
Unknown Object (File)
Sun, Feb 22, 9:14 AM
Unknown Object (File)
Fri, Feb 20, 5:40 PM
Unknown Object (File)
Feb 8 2026, 11:04 PM
Unknown Object (File)
Feb 8 2026, 8:19 PM
Unknown Object (File)
Feb 1 2026, 11:09 AM
Unknown Object (File)
Dec 31 2025, 11:39 AM
Subscribers

Details

Summary

All of the error paths in pci_vtcon_sock_add free the sock pointer.
However, sock is not initialized until part way through the function.
An early error would pass stack garbage to free().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable