NetworkManager/src/devices
Thomas Haller ad21d54219 iface-helper: fix non-reentrant call to platform for failed IPv6 DAD
Platform invokes change events while reading netlink events. However,
platform code is not re-entrant and calling into platform again is not
allowed (aside operations that do not process the netlink socket, like
lookup of the platform cache).

That basically means, we have to always process events in an idle
handler. That is not a too strong limitation, because we anyway don't
know the call context in which the platform event is emitted and we
should avoid unguarded recursive calls into platform.

Otherwise, we get hit an assertion/crash in nm-iface-helper:

     1  raise()
     2  abort()
     3  g_assertion_message()
     4  g_assertion_message_expr()
     5  do_delete_object()
     6  ip6_address_delete()
 >>> 7  nm_platform_ip6_address_delete()
     8  nm_platform_ip6_address_sync()
     9  nm_ip6_config_commit()
     10 ndisc_config_changed()
     11 ffi_call_unix64()
     12 ffi_call()
     13 g_cclosure_marshal_generic_va()
     14 _g_closure_invoke_va()
     15 g_signal_emit_valist()
     16 g_signal_emit()
 >>> 17 nm_ndisc_dad_failed()
     18 ffi_call_unix64()
     19 ffi_call()
     20 g_cclosure_marshal_generic()
     21 g_closure_invoke()
     22 signal_emit_unlocked_R()
     23 g_signal_emit_valist()
     24 g_signal_emit()
 >>> 25 nm_platform_cache_update_emit_signal()
     26 event_handler_recvmsgs()
     27 event_handler_read_netlink()
     28 delayed_action_handle_one()
     29 delayed_action_handle_all()
     30 do_delete_object()
     31 ip6_address_delete()
     32 nm_platform_ip6_address_delete()
     33 nm_platform_ip6_address_sync()
 >>> 34 nm_ip6_config_commit()
     35 ndisc_config_changed()
     36 ffi_call_unix64()
     37 ffi_call()
     38 g_cclosure_marshal_generic_va()
     39 _g_closure_invoke_va()
     40 g_signal_emit_valist()
     41 g_signal_emit()
     42 check_timestamps()
     43 receive_ra()
     44 ndp_call_eventfd_handler()
     45 ndp_callall_eventfd_handler()
     46 event_ready()
     47 g_main_context_dispatch()
     48 g_main_context_iterate.isra.22()
     49 g_main_loop_run()
 >>> 50 main()

NMPlatform already has a check to assert against recursive calls
in delayed_action_handle_all():

    g_return_val_if_fail (priv->delayed_action.is_handling == 0, FALSE);

    priv->delayed_action.is_handling++;
    ...
    priv->delayed_action.is_handling--;

Fixes: f85728ecff

https://bugzilla.redhat.com/show_bug.cgi?id=1546656
2018-02-21 12:08:46 +01:00
..
adsl build/meson: use variables for ldflags and linker-script 2018-01-11 12:46:01 +01:00
bluetooth build/meson: use variables for ldflags and linker-script 2018-01-11 12:46:01 +01:00
ovs ovs: add error code for callbacks to indicate NM is quitting 2018-02-21 11:44:25 +01:00
team build/meson: use variables for ldflags and linker-script 2018-01-11 12:46:01 +01:00
tests meson: Improve dependency system 2018-01-10 12:20:17 +01:00
wifi wifi/iwd: make NMIwdManager:dispose() reentrant 2018-02-09 21:34:20 +01:00
wwan build/meson: use variables for ldflags and linker-script 2018-01-11 12:46:01 +01:00
meson.build build: add initial support for meson build system 2017-12-13 15:48:50 +01:00
nm-arping-manager.c all: use nm_direct_hash() instead of g_direct_hash() 2017-11-16 11:49:52 +01:00
nm-arping-manager.h core: refactor private data in "src" 2016-10-04 09:50:56 +02:00
nm-device-bond.c platform: pass string buffer to nm_platform_error_to_string() and print numeric errno 2017-08-24 10:55:45 +02:00
nm-device-bond.h core: refactor private data in "src" 2016-10-04 09:50:56 +02:00
nm-device-bridge.c platform: pass string buffer to nm_platform_error_to_string() and print numeric errno 2017-08-24 10:55:45 +02:00
nm-device-bridge.h bridge: move the Bluetooth NAP logic to bridge device 2017-06-01 11:57:42 +02:00
nm-device-dummy.c platform: pass string buffer to nm_platform_error_to_string() and print numeric errno 2017-08-24 10:55:45 +02:00
nm-device-dummy.h core: add support for dummy devices 2017-02-22 21:05:04 +01:00
nm-device-ethernet-utils.c device: use NMSettings directly instead of NMConnectionProvider in subclasses 2016-05-24 12:35:58 +02:00
nm-device-ethernet-utils.h device: use NMSettings directly instead of NMConnectionProvider in subclasses 2016-05-24 12:35:58 +02:00
nm-device-ethernet.c wifi: enable WPA-*-SHA256 AKMs only when the supplicant supports them 2018-01-22 08:38:28 +01:00
nm-device-ethernet.h all: replace non-leading tabs with spaces 2018-02-07 13:32:04 +01:00
nm-device-factory.c device: split per-directory factory function 2018-01-10 11:01:46 +01:00
nm-device-factory.h core: device-factory: implement match_connection() 2017-08-05 08:03:16 +02:00
nm-device-generic.c device: don't use platform singleton getter in device subclasses 2017-04-18 15:49:14 +02:00
nm-device-generic.h core: refactor private data in "src" 2016-10-04 09:50:56 +02:00
nm-device-infiniband.c trivial: avoid XXX tag and replace by NOTE or FIXME 2018-01-23 12:55:33 +01:00
nm-device-infiniband.h core: refactor private data in "src" 2016-10-04 09:50:56 +02:00
nm-device-ip-tunnel.c trivial: avoid XXX tag and replace by NOTE or FIXME 2018-01-23 12:55:33 +01:00
nm-device-ip-tunnel.h ip-tunnel: add support for tunnel flags 2018-01-05 18:25:08 +01:00
nm-device-logging.h Revert "device: log device type too" 2017-10-31 18:48:41 +01:00
nm-device-macsec.c wifi: enable WPA-*-SHA256 AKMs only when the supplicant supports them 2018-01-22 08:38:28 +01:00
nm-device-macsec.h core,libnm: introduce NMDeviceMacsec 2017-01-16 17:37:14 +01:00
nm-device-macvlan.c device: deduplicate match_hwaddr() 2017-09-28 10:54:01 +02:00
nm-device-macvlan.h device: move tracking of parent device from NMDeviceMacvlan to NMDevice 2017-01-04 14:18:01 +01:00
nm-device-ppp.c ppp/trivial: rename field 2018-01-10 15:36:29 +01:00
nm-device-ppp.h device: add NMDevicePPP 2017-08-05 08:03:15 +02:00
nm-device-private.h all: replace non-leading tabs with spaces 2018-02-07 13:32:04 +01:00
nm-device-tun.c platform: pass string buffer to nm_platform_error_to_string() and print numeric errno 2017-08-24 10:55:45 +02:00
nm-device-tun.h core: refactor private data in "src" 2016-10-04 09:50:56 +02:00
nm-device-veth.c device: remove unused private data for NMDeviceVeth 2017-05-27 23:16:56 +02:00
nm-device-veth.h all: cleanup includes in header files 2016-08-17 19:51:17 +02:00
nm-device-vlan.c device: remove 'force_restart' argument from reactivate functions 2017-12-06 09:53:18 +01:00
nm-device-vlan.h device: move tracking of parent device from NMDeviceVlan to NMDevice 2017-01-04 14:18:01 +01:00
nm-device-vxlan.c device: deduplicate match_parent() 2017-09-28 10:54:01 +02:00
nm-device-vxlan.h device: move tracking of parent device from NMDeviceVxlan to NMDevice 2017-01-04 14:18:01 +01:00
nm-device.c iface-helper: fix non-reentrant call to platform for failed IPv6 DAD 2018-02-21 12:08:46 +01:00
nm-device.h core: implement setting MDNS setting for systemd 2018-01-09 14:24:54 +01:00
nm-lldp-listener.c all: add helper functions for nm_hash_update*() 2017-10-18 13:29:22 +02:00
nm-lldp-listener.h core: refactor private data for NMExportedObject and others 2016-10-03 12:04:14 +02:00