mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-16 23:40:43 +01:00
![Andrew Zaborowski](/assets/img/avatar_default.png)
Save the ids of the netlink trigger scan commands that we send and cancel them in scan_ifindex_remove to fix a race leading to a segfault. The segfault would happen every time if scan_ifindex_remove was called in the same main loop iteration in which we sent the command, on shutdown: ^CTerminate src/netdev.c:netdev_free() Freeing netdev wlan3[6] src/device.c:device_disassociated() 6 src/device.c:device_enter_state() Old State: connected, new state: disconnected src/device.c:device_enter_state() Old State: disconnected, new state: autoconnect src/scan.c:scan_periodic_start() Starting periodic scan for ifindex: 6 src/device.c:device_free() src/device.c:bss_free() Freeing BSS 02:00:00:00:00:00 src/device.c:bss_free() Freeing BSS 02:00:00:00:01:00 Removing scan context for ifindex: 6 src/scan.c:scan_context_free() sc: 0x5555557ca290 src/scan.c:scan_notify() Scan notification 33 src/netdev.c:netdev_operstate_down_cb() netdev: 6, success: 1 src/scan.c:scan_periodic_done() src/scan.c:scan_periodic_done() Periodic scan triggered for ifindex: 1434209520 Program received signal SIGSEGV, Segmentation fault. 0x0000000000000064 in ?? () (gdb) bt #0 0x0000000000000064 in ?? () #1 0x0000555555583560 in process_unicast (nlmsg=0x7fffffffc1a0, genl=0x5555557c1d60) at ell/genl.c:390 #2 received_data (io=<optimized out>, user_data=0x5555557c1d60) at ell/genl.c:506 #3 0x0000555555580d45 in io_callback (fd=<optimized out>, events=1, user_data=0x5555557c1e60) at ell/io.c:120 #4 0x000055555558005f in l_main_run () at ell/main.c:381 #5 0x00005555555599c1 in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:259