HomeFreeBSD

netlink: fix accessing freed memory

Description

netlink: fix accessing freed memory

The check for if_addrlen in dump_iface() is not sufficient to determine
if we still have a valid if_addr. Rather than directly accessing if_addr
check the STAILQ (for the first entry).
This avoids panics when destroying cloned interfaces as experienced with
net80211 wlan ones.

Sponsored by: The FreeBSD Foundation
Reviewed by: jhibbits (earlier version), kp
Differential Revision: https://reviews.freebsd.org/D42027

(cherry picked from commit 7d48224073ce14f0dd3db2d4e96876ac928b52f2)

Details

Provenance
bzAuthored on Sep 30 2023, 3:11 PM
Reviewer
jhibbits
Differential Revision
D42027: netlink: fix accessing freed memory
Parents
rG2709483a725e: linuxkpi: fix iteration in __sg_alloc_table_from_pages
Branches
Unknown
Tags
Unknown