From be2879018372054adc03896f757d75cdb4f87f08 Mon Sep 17 00:00:00 2001 From: Andreas Henriksson Date: Tue, 24 Apr 2018 19:25:40 +0200 Subject: [PATCH] iwd: fix assertion failure when requesting scan if device *is* a NM_DEVICE_IWD, then make sure to not pass that to _nm_device_wifi_request_scan (which asserts on anything else than a NM_DEVICE_WIFI device). The crash can be triggered by enabling wifi.backend=iwd and clicking on the 'select network' item in gnome shell for example. The journal output looks like this: NetworkManager[1861]: invalid cast from 'NMDeviceIwd' to 'NMDeviceWifi' NetworkManager[1861]: ** NetworkManager[1861]: NetworkManager:ERROR:src/devices/wifi/nm-device-wifi.c:1127:_nm_device_wifi_request_scan: assertion failed: ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((_obj)); GType __t = ((nm_device_wifi_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))) systemd[1]: NetworkManager.service: Main process exited, code=dumped, status=6/ABRT systemd[1]: NetworkManager.service: Failed with result 'core-dump'. Fixes: 297d4985abcc7b571b8c090ee90622357fc60e16 https://github.com/NetworkManager/NetworkManager/pull/107 --- src/devices/wifi/nm-wifi-common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/devices/wifi/nm-wifi-common.c b/src/devices/wifi/nm-wifi-common.c index 47c0ce6784..e5e16f03e0 100644 --- a/src/devices/wifi/nm-wifi-common.c +++ b/src/devices/wifi/nm-wifi-common.c @@ -69,6 +69,7 @@ _dispatch_request_scan (NMDevice *device, _nm_device_iwd_request_scan (NM_DEVICE_IWD (device), options, invocation); + return; } #endif _nm_device_wifi_request_scan (NM_DEVICE_WIFI (device),