Skip to content

Commit

Permalink
iwd: Add missing module dependencies
Browse files Browse the repository at this point in the history
Certain module dependencies were missing, which could cause a crash on
exit under (very unlikely) circumstances.

  #0  l_queue_peek_head (queue=<optimized out>) at ../iwd-1.28/ell/queue.c:241
  #1  0x0000aaaab752f2a0 in wiphy_radio_work_done (wiphy=0xaaaac3a129a0, id=6)
      at ../iwd-1.28/src/wiphy.c:2013
  #2  0x0000aaaab7523f50 in netdev_connect_free (netdev=netdev@entry=0xaaaac3a13db0)
      at ../iwd-1.28/src/netdev.c:765
  #3  0x0000aaaab7526208 in netdev_free (data=0xaaaac3a13db0) at ../iwd-1.28/src/netdev.c:909
  #4  0x0000aaaab75a3924 in l_queue_clear (queue=queue@entry=0xaaaac3a0c800,
      destroy=destroy@entry=0xaaaab7526190 <netdev_free>) at ../iwd-1.28/ell/queue.c:107
  #5  0x0000aaaab75a3974 in l_queue_destroy (queue=0xaaaac3a0c800,
      destroy=destroy@entry=0xaaaab7526190 <netdev_free>) at ../iwd-1.28/ell/queue.c:82
  #6  0x0000aaaab7522050 in netdev_exit () at ../iwd-1.28/src/netdev.c:6653
  #7  0x0000aaaab7579bb0 in iwd_modules_exit () at ../iwd-1.28/src/module.c:181

In this particular case, wiphy module was de-initialized prior to the
netdev module:

Jul 14 18:14:39 localhost iwd[2867]: ../iwd-1.28/src/wiphy.c:wiphy_free() Freeing wiphy phy0[0]
Jul 14 18:14:39 localhost iwd[2867]: ../iwd-1.28/src/netdev.c:netdev_free() Freeing netdev wlan0[45]
  • Loading branch information
denkenz committed Jul 18, 2022
1 parent f807901 commit b84b710
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -6676,3 +6676,5 @@ void netdev_shutdown(void)

IWD_MODULE(netdev, netdev_init, netdev_exit);
IWD_MODULE_DEPENDS(netdev, eapol);
IWD_MODULE_DEPENDS(netdev, frame_xchg);
IWD_MODULE_DEPENDS(netdev, wiphy);
1 change: 1 addition & 0 deletions src/offchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,4 @@ static void offchannel_exit(void)
}

IWD_MODULE(offchannel, offchannel_init, offchannel_exit);
IWD_MODULE_DEPENDS(offchannel, wiphy);
1 change: 1 addition & 0 deletions src/rrm.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,3 +890,4 @@ static void rrm_exit(void)

IWD_MODULE(rrm, rrm_init, rrm_exit);
IWD_MODULE_DEPENDS(rrm, netdev);
IWD_MODULE_DEPENDS(rrm, frame_xchg);
1 change: 1 addition & 0 deletions src/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2198,3 +2198,4 @@ static void scan_exit(void)
}

IWD_MODULE(scan, scan_init, scan_exit)
IWD_MODULE_DEPENDS(scan, wiphy)
4 changes: 3 additions & 1 deletion src/station.c
Original file line number Diff line number Diff line change
Expand Up @@ -4614,4 +4614,6 @@ static void station_exit(void)

IWD_MODULE(station, station_init, station_exit)
IWD_MODULE_DEPENDS(station, netdev);
IWD_MODULE_DEPENDS(station, netconfig)
IWD_MODULE_DEPENDS(station, netconfig);
IWD_MODULE_DEPENDS(station, frame_xchg);
IWD_MODULE_DEPENDS(station, wiphy);

0 comments on commit b84b710

Please sign in to comment.