mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-04-03 18:07:50 +02:00
netdev: fix invalid read after netdev_free
The netdev frame watches got cleaned up upon the interface going down which works if the interface is simply being toggled but when IWD shuts down it first shuts down the interface, then immediately frees netdev. If a watched frame arrives immediately after that before the interface shutdown callback it will reference netdev, which has been freed. Fix this by clearing out the frame watches in netdev_free. ==147== Invalid read of size 8 ==147== at 0x408ADB: netdev_neighbor_report_frame_event (netdev.c:4772) ==147== by 0x467C75: frame_watch_unicast_notify (frame-xchg.c:234) ==147== by 0x4E28F8: __notifylist_notify (notifylist.c:91) ==147== by 0x4E2D37: l_notifylist_notify_matches (notifylist.c:204) ==147== by 0x4A1388: process_unicast (genl.c:844) ==147== by 0x4A1388: received_data (genl.c:972) ==147== by 0x49D82F: io_callback (io.c:105) ==147== by 0x49C93C: l_main_iterate (main.c:461) ==147== by 0x49CA0B: l_main_run (main.c:508) ==147== by 0x49CA0B: l_main_run (main.c:490) ==147== by 0x49CC3F: l_main_run_with_signal (main.c:630) ==147== by 0x4049EC: main (main.c:614)
This commit is contained in:
parent
f0e515b6ff
commit
d70fbade44
@ -1109,6 +1109,7 @@ static void netdev_free(void *data)
|
||||
l_timeout_remove(netdev->rssi_poll_timeout);
|
||||
|
||||
scan_wdev_remove(netdev->wdev_id);
|
||||
frame_watch_wdev_remove(netdev->wdev_id);
|
||||
|
||||
watchlist_destroy(&netdev->station_watches);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user