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
F169525719: D36823.diff
Tue, Sep 1, 7:50 PM
F169493794: D36823.id113414.diff
Tue, Sep 1, 5:07 PM
F169281476: D36823.id.diff
Tue, Sep 1, 3:14 AM
Unknown Object (File)
Mon, Aug 31, 3:30 PM
Unknown Object (File)
Mon, Aug 31, 1:59 AM
Unknown Object (File)
Sun, Aug 30, 2:45 PM
Unknown Object (File)
Sun, Aug 30, 2:30 AM
Unknown Object (File)
Sat, Aug 29, 6:37 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