Page MenuHomeFreeBSD

systat: Fix a bunch of use after frees in fetch_ifstat().
ClosedPublic

Authored by jhb on Sep 29 2022, 10:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 2:54 PM
Unknown Object (File)
Sun, Apr 7, 12:28 PM
Unknown Object (File)
Feb 14 2024, 7:31 AM
Unknown Object (File)
Feb 14 2024, 7:27 AM
Unknown Object (File)
Feb 14 2024, 5:13 AM
Unknown Object (File)
Feb 14 2024, 5:00 AM
Unknown Object (File)
Dec 20 2023, 7:43 AM
Unknown Object (File)
Dec 12 2023, 10:50 AM
Subscribers

Details

Summary

I think this was probably just a typo. initifstat() continues around
a similar loop if the mib data fails to fetch, and fetch_ifstat() was
already using a FOREACH_SAFE loop here so expected to keep going.
Calling clearifstat() from the fetch routine also seems wrong, and the
sort_interface_list() call triggered by the existing needsort = 1 will
itself set needclear to trigger a future clearifstat().

Reported by: GCC 12 -Wuse-after-free

Diff Detail

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