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)
Tue, Oct 14, 2:57 PM
Unknown Object (File)
Sun, Oct 12, 3:50 AM
Unknown Object (File)
Sun, Oct 12, 3:50 AM
Unknown Object (File)
Sun, Oct 12, 3:50 AM
Unknown Object (File)
Sat, Oct 11, 5:51 PM
Unknown Object (File)
Wed, Sep 17, 8:11 AM
Unknown Object (File)
Sep 10 2025, 7:11 PM
Unknown Object (File)
Sep 10 2025, 6:15 PM
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