opnsense-src/sys/dev/ena
Arthur Kiyanovski c59a5fbd8a ena: Fix driver unload crash
When ena_detach is called, we first call ether_ifdetach(),
which destroys internal addresses of ifp. One such address
is ifp->if_addr->ifa_addr. Then during ena_destroy_device(),
if_link_state_change() is called, eventually trying to access
ifp->if_addr->ifa_addr->sa_family. This causes an access
to garbage memory and crashes the kernel.

Ticket [1] was opened to the FreeBSD community to add null
check in the code of if_link_state_change().
A fix was submitted in commit [2], however it was noted
that it is our driver's responsibilty to not call
if_link_state_change() after calling ether_ifdetach().

This commit makes sure if_link_state_change() is not called
after ether_ifdetach().

[1]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270813
[2]: https://reviews.freebsd.org/D39614

Fixes: 32f63fa7f9 ("Split ENA reset routine into restore and destroy stages")
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2023-07-04 15:57:15 +02:00
..
ena.c ena: Fix driver unload crash 2023-07-04 15:57:15 +02:00
ena.h ena: Update driver version to v2.6.2 2023-01-13 17:07:04 +01:00
ena_datapath.c Mechanically convert ena(4) to DrvAPI 2023-01-13 17:09:17 +01:00
ena_datapath.h ena: Fix styling issues 2022-06-30 17:32:04 +02:00
ena_netmap.c Mechanically convert ena(4) to DrvAPI 2023-01-13 17:09:17 +01:00
ena_netmap.h ena: Fix styling issues 2022-06-30 17:32:04 +02:00
ena_rss.c ena: Fix styling issues 2022-06-30 17:32:04 +02:00
ena_rss.h ena: Fix styling issues 2022-06-30 17:32:04 +02:00
ena_sysctl.c ena: Align names of constants 2022-06-30 17:32:13 +02:00
ena_sysctl.h ena: Fix styling issues 2022-06-30 17:32:04 +02:00