NetworkManager/src
Aleksander Morgado bf7865e859 platform: avoid storing unknown netlink object types (bgo #742928)
Testing WWAN connections through a Nokia Series 40 phone, addresses of family
AF_PHONET end up triggering an assert() in object_has_ifindex(), just because
object_type_from_nl_object() only handles AF_INET and AF_INET6 address.

In order to avoid this kind of problems, we'll try to make sure that the object
caches kept by NM only store known object types.

(fixup by dcbw to use cached passed to cache_remove_unknown())

https://bugzilla.gnome.org/show_bug.cgi?id=742928

    Connect: ppp0 <--> /dev/ttyACM0
    nm-pppd-plugin-Message: nm-ppp-plugin: (nm_phasechange): status 5 / phase 'establish'
    NetworkManager[27434]: <info>  (ppp0): new Generic device (driver: 'unknown' ifindex: 12)
    NetworkManager[27434]: <info>  (ppp0): exported as /org/freedesktop/NetworkManager/Devices/4
    [Thread 0x7ffff1ecf700 (LWP 27439) exited]
    NetworkManager[27434]: <info>  (ttyACM0): device state change: ip-config -> deactivating (reason 'user-requested') [70 110 39]
    Terminating on signal 15
    nm-pppd-plugin-Message: nm-ppp-plugin: (nm_phasechange): status 10 / phase 'terminate'
    **
    NetworkManager:ERROR:platform/nm-linux-platform.c:1534:object_has_ifindex: code should not be reached

    Program received signal SIGABRT, Aborted.
    0x00007ffff4692a97 in raise () from /usr/lib/libc.so.6
    (gdb) bt
    #0  0x00007ffff4692a97 in raise () from /usr/lib/libc.so.6
    #1  0x00007ffff4693e6a in abort () from /usr/lib/libc.so.6
    #2  0x00007ffff4c8d7f5 in g_assertion_message () from /usr/lib/libglib-2.0.so.0
    #3  0x00007ffff4c8d88a in g_assertion_message_expr () from /usr/lib/libglib-2.0.so.0
    #4  0x0000000000472b91 in object_has_ifindex (object=0x8a8320, ifindex=12) at platform/nm-linux-platform.c:1534
    #5  0x0000000000472bec in check_cache_items (platform=0x7fe8a0, cache=0x7fda30, ifindex=12) at platform/nm-linux-platform.c:1549
    #6  0x0000000000472de3 in announce_object (platform=0x7fe8a0, object=0x8a8c30, change_type=NM_PLATFORM_SIGNAL_REMOVED, reason=NM_PLATFORM_REASON_EXTERNAL) at platform/nm-linux-platform.c:1617
    #7  0x0000000000473dd2 in event_notification (msg=0x8a7970, user_data=0x7fe8a0) at platform/nm-linux-platform.c:1992
    #8  0x00007ffff5ee14de in nl_recvmsgs_report () from /usr/lib/libnl-3.so.200
    #9  0x00007ffff5ee1849 in nl_recvmsgs () from /usr/lib/libnl-3.so.200
    #10 0x00000000004794df in event_handler (channel=0x7fc930, io_condition=G_IO_IN, user_data=0x7fe8a0) at platform/nm-linux-platform.c:4152
    #11 0x00007ffff4c6791d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
    #12 0x00007ffff4c67cf8 in ?? () from /usr/lib/libglib-2.0.so.0
    #13 0x00007ffff4c68022 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
    #14 0x00000000004477ee in main (argc=1, argv=0x7fffffffeaa8) at main.c:447
    (gdb) fr 4
    #4  0x0000000000472b91 in object_has_ifindex (object=0x8a8320, ifindex=12) at platform/nm-linux-platform.c:1534
    1534                    g_assert_not_reached ();
2015-01-15 11:13:50 -06:00
..
devices bond: allow overriding the MTU 2015-01-14 18:44:20 +01:00
dhcp-manager core: use NM_DEFINE_SINGLETON_GETTER() macro 2015-01-12 12:10:03 +01:00
dns-manager core: declare nm_dns_manager_get() using NM_DEFINE_SINGLETON_GETTER() 2015-01-12 12:10:02 +01:00
dnsmasq-manager all: consistently include config.h 2014-11-13 17:18:42 -05:00
platform platform: avoid storing unknown netlink object types (bgo #742928) 2015-01-15 11:13:50 -06:00
ppp-manager all: consistently include config.h 2014-11-13 17:18:42 -05:00
rdisc all: consistently include config.h 2014-11-13 17:18:42 -05:00
settings ifcfg-rh: update test files not to use obsolete GATEWAY<n> variables 2015-01-15 13:03:13 +01:00
supplicant-manager core: declare nm_supplicant_manager_get() using NM_DEFINE_SINGLETON_GETTER() 2015-01-12 12:10:03 +01:00
tests tests: fix NEGATIVE_RETURNS (CWE-394) in tests 2014-12-15 16:25:27 +01:00
vpn-manager core: declare nm_agent_manager_get() using NM_DEFINE_SINGLETON_GETTER() 2015-01-12 12:10:03 +01:00
main-utils.c libnm: remove nm_utils_init() from the public API 2014-12-04 08:39:54 -05:00
main-utils.h core: split signal/pidfile/option handling into separate source file 2014-11-07 12:18:32 -06:00
main.c dbus: destroy singleton instance of NMDBusManager on exit 2015-01-12 12:10:03 +01:00
Makefile.am session: merge nm-session-monitor-* modules 2015-01-05 18:39:46 +01:00
NetworkManagerUtils.c core: log object type in nm_utils_log_connection_diff() 2015-01-13 11:23:22 +01:00
NetworkManagerUtils.h all: move STRLEN() macro to global header nm-utils-internal.h 2014-12-18 17:36:57 +01:00
nm-activation-request.c all: remove a bunch of unnecessary dbus/dbus-glib includes 2014-09-03 10:45:24 -04:00
nm-activation-request.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-active-connection.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-active-connection.h vpn/core: move VPN gateway route between devices when routing changes 2014-11-06 21:17:34 -06:00
nm-auth-manager.c auth: destroy singleton instance of NMAuthManager on exit 2015-01-12 12:10:03 +01:00
nm-auth-manager.h core: drop all remaining core-internal error domains 2014-10-22 08:29:10 -04:00
nm-auth-subject.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-auth-subject.h auth: support disabling POLKIT authentication entirely at compile time 2014-09-29 13:51:11 +02:00
nm-auth-utils.c auth: remove session monitor argument 2015-01-05 18:38:44 +01:00
nm-auth-utils.h auth: remove session monitor argument 2015-01-05 18:38:44 +01:00
nm-config.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-config.h core: add option to quit when startup is complete (rh #863515) (rh #1083683) 2014-11-07 12:18:33 -06:00
nm-connection-provider.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-connection-provider.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-connectivity.c connectivity: avoid redundant connectivity checks 2015-01-15 10:22:13 -05:00
nm-connectivity.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-dbus-manager.c dbus: destroy singleton instance of NMDBusManager on exit 2015-01-12 12:10:03 +01:00
nm-dbus-manager.h core: fill in nm-types.h, clean out other headers 2014-07-23 10:56:26 -04:00
nm-dcb.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-dcb.h core: drop all remaining core-internal error domains 2014-10-22 08:29:10 -04:00
nm-default-route-manager.c core: use NM_DEFINE_SINGLETON_GETTER() macro 2015-01-12 12:10:03 +01:00
nm-default-route-manager.h policy: remove redundant remove_default_route() functions from NMDefaultRouteManager 2014-11-19 22:55:32 +01:00
nm-dhcp4-config.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-dhcp4-config.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-dhcp6-config.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-dhcp6-config.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-dispatcher.c dispatcher: pass CONNECTION_FILENAME to dispatcher scripts 2015-01-12 09:53:21 -05:00
nm-dispatcher.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-firewall-manager.c core: declare nm_firewall_manager_get() using NM_DEFINE_SINGLETON_GETTER() 2015-01-12 12:10:03 +01:00
nm-firewall-manager.h firewall: make call handle an opaque pointer type 2014-11-19 12:58:36 +01:00
nm-iface-helper.c core: declare nm_dhcp_manager_get() using NM_DEFINE_SINGLETON_GETTER() 2015-01-12 12:10:03 +01:00
nm-ip4-config.c core: fix route metrics for subnet routes 2014-11-25 22:30:38 +01:00
nm-ip4-config.h core: fix route metrics for subnet routes 2014-11-25 22:30:38 +01:00
nm-ip6-config.c libnm: allow zero prefix length for NMIPRoute 2014-11-24 18:02:46 +01:00
nm-ip6-config.h core: add nm_ip4_config_get_subnet_for_host() function 2014-11-07 15:23:11 +01:00
nm-logging.c logging: pass file:line as separate arguments to _nm_log() 2014-12-18 17:36:57 +01:00
nm-logging.h logging: pass file:line as separate arguments to _nm_log() 2014-12-18 17:36:57 +01:00
nm-manager.c connectivity: simplify redundant code 2015-01-15 10:22:13 -05:00
nm-manager.h iface-helper: add nm-iface-helper for dynamic configure-then-quit support 2014-11-07 12:18:33 -06:00
nm-policy.c core: declare nm_dns_manager_get() using NM_DEFINE_SINGLETON_GETTER() 2015-01-12 12:10:02 +01:00
nm-policy.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-posix-signals.c core: merge src/config, src/logging, src/posix-signals into src/ 2014-07-30 15:56:29 -04:00
nm-posix-signals.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-properties-changed-signal.c core: log ignored property notification with level TRACE 2015-01-13 11:23:22 +01:00
nm-properties-changed-signal.h core: make nm-properties-changed-signal always export the right properties 2013-05-20 16:38:33 -03:00
nm-rfkill-manager.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-rfkill-manager.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-session-monitor.c core: declare nm_session_monitor_get() using NM_DEFINE_SINGLETON_GETTER() 2015-01-12 12:10:03 +01:00
nm-session-monitor.h session: merge nm-session-monitor-* modules 2015-01-05 18:39:46 +01:00
nm-sleep-monitor-systemd.c core: declare nm_sleep_monitor_get() using NM_DEFINE_SINGLETON_GETTER() 2015-01-12 12:10:02 +01:00
nm-sleep-monitor-upower.c core: declare nm_sleep_monitor_get() using NM_DEFINE_SINGLETON_GETTER() 2015-01-12 12:10:02 +01:00
nm-sleep-monitor.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-types.h policy: add manager for default routes and support multiple default routes 2014-11-07 15:23:12 +01:00
org.freedesktop.NetworkManager.conf dbus: kill at_console usage in permissions (bgo #707983) (rh #979416) 2014-01-23 16:48:19 -06:00