device: fix crash releasing destroyed slave

System Internals / NetworkManager - Thomas Haller [redhat.com] - 2 July 2019 15:52 EDT

I encountered this on a WIP branch, but I think it can happen under regular conditions. I think there is no error condition here, and we should do nothing if we have no ifindex.

[1561653068.2192] platform: signal: link removed: 1699: test1p mtu 1500 master 1698 arp 1 veth* init addrgenmode none addr D6:14:45:97:06:75 brd FF:FF:FF:FF:FF:FF driver veth rx:0,0 tx:38,5606

[1561653068.2617] device (test1): state change: activated -> unmanaged (reason 'unmanaged', sys-iface-state: 'removed')

[1561653068.2635] device[0x564058c73750] (test1p): sys-iface-state: external -> removed [1561653068.2635] device[0x564058c73750] (test1p): unrealize (ifindex 1699) [1561653068.2636] device[0x564058c73750] (test1p): parent: clear [1561653068.2636] device[0x564058b98eb0] (vethbr): mtu: commit-mtu... [1561653068.2639] device[0x564058c73750] (test1p): unmanaged: flags set to [platform-init,!sleeping,!by-type,!user-explicit,!user-settings,!user-udev,!is-slave=0x10/0x1479/unmanaged/unrealized], set-unmanaged [platform-init=0x10]) [1561653068.2639] device[0x564058c73750] (test1p): unmanaged: flags set to [platform-init,!sleeping,!user-settings=0x10/0x51/unmanaged/unrealized], forget [parent,by-type,user-explicit,user-udev,external-down,is-slave=0x1c2c]) [1561653068.2639] device (test1p): state change: activated -> unmanaged (reason 'unmanaged', sys-iface-state: 'removed') [1561653068.2640] device[0x564058c73750] (test1p): deactivating device (reason 'unmanaged') [3] [1561653068.2640] device[0x564058c73750] (test1p): ip4-state: set to 0 (none) [1561653068.2640] device[0x564058c73750] (test1p): ip6-state: set to 0 (none) [1561653068.2640] device[0x564058c73750] (test1p): remove_pending_action (0): 'dhcp6' not pending (expected) [1561653068.2640] device[0x564058c73750] (test1p): remove_pending_action (0): 'autoconf6' not pending (expected) [1561653068.2640] rules-manager: sync [1561653068.2640] device[0x564058c73750] (test1p): set metered value 0 [1561653068.2641] device[0x564058c73750] (test1p): ip4-config: update (commit=1, new-config=(nil)) [1561653068.2641] device[0x564058c73750] (test1p): ip6-config: update (commit=1, new-config=(nil)) [1561653068.2644] device[0x564058b98eb0] (vethbr): slave test1p state change 100 (activated) -> 10 (unmanaged) [1561653068.2644] device[0x564058b98eb0] (vethbr): master: release one slave 0x564058c73750/test1p ((src/platform/nm-platform.c:2002)): assertion '' failed

backtrace:

#3 0x0000564057fb713e _nm_g_return_if_fail_warning (NetworkManager) #4 0x000056405808b37c release_slave (NetworkManager) #5 0x0000564058079aef nm_device_master_release_one_slave (NetworkManager) #6 0x00005640580844d7 slave_state_changed (NetworkManager) #7 0x00007efc24833fae ffi_call_unix64 (libffi.so.6) #8 0x00007efc2483396f ffi_call (libffi.so.6) #9 0x00007efc29b836e5 g_cclosure_marshal_generic (libgobject-2.0.so.0) #10 0x00007efc29b82c1d g_closure_invoke (libgobject-2.0.so.0) #11 0x00007efc29b96173 signal_emit_unlocked_R (libgobject-2.0.so.0) #12 0x00007efc29b9f29a g_signal_emit_valist (libgobject-2.0.so.0) #13 0x00007efc29b9f893 g_signal_emit (libgobject-2.0.so.0) #14 0x000056405807ab20 _set_state_full (NetworkManager) #15 0x000056405807d803 nm_device_unrealize (NetworkManager) #16 0x0000564057f6072c _platform_link_cb_idle (NetworkManager) #17 0x00007efc296a01db g_idle_dispatch (libglib-2.0.so.0)

5b98f2fb0 device: fix crash releasing destroyed slave
src/devices/nm-device-bond.c | 40 +++++++++++++++++++++++++--------------
src/devices/nm-device-bridge.c | 10 +++++++++-
src/devices/team/nm-device-team.c | 13 +++++++++++--
3 files changed, 46 insertions(+), 17 deletions(-)

Upstream: cgit.freedesktop.org


  • Share