NetworkManager crashes when updating wpa-eap connections

Bug #2038811 reported by errors.ubuntu.com bug bridge
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
netplan.io (Ubuntu)
Fix Released
High
Unassigned
Mantic
New
Undecided
Unassigned
network-manager (Ubuntu)
Triaged
Medium
Unassigned
Mantic
Incomplete
Undecided
Unassigned

Bug Description

The Ubuntu Error Tracker has been receiving reports about a problem regarding network-manager. This problem was most recently seen with package version 1.44.2-1ubuntu1, the problem page at https://errors.ubuntu.com/problem/0185fff02c2976262de9f862e539829420f9c737 contains more details, including versions of packages affected, stacktrace or traceback, and individual crash reports.
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://forms.canonical.com/reports/.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Checking the journal errors from some reports those warnings are found

nm-device: NM-9ca0c167-eb7c-4200-8766-38707689ef3b: the renderer for nm-devices must be NetworkManager, it will be used instead of the defined one.

or

<error> [1696737400.9276] BUG: the profile cannot be stored in keyfile format without becoming unusable: invalid connection: 802-1x: 'wpa-eap' security requires '802-1x' setting presence

or

<error> [1696771280.2003] BUG: the profile cannot be stored in keyfile format without becoming unusable: cannot access file: No such file or directory

Unsure if some of those have to do with the netplan transition

Changed in network-manager (Ubuntu):
importance: Undecided → High
Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote :

They might (likely to?) be related to libnetplan. I'm looking into it.

Lukas Märdian (slyon)
tags: added: foundations-todo
Revision history for this message
Lukas Märdian (slyon) wrote :

Reproducer:
nmcli con add type wifi ifname wlan0 ssid asdasd wifi-sec.key-mgmt wpa-eap 802-1x.eap leap 802-1x.identity username 802-1x.password aaaaaaaa

The crash (SIGABRT) happens in NetworkManager's Netplan integration patch, because of running into a "nm_assert_not_reached()" call. This could easily be avoided by muting that assert and just logging the error and returning FALSE (as is already done below the assert):

https://git.launchpad.net/ubuntu/+source/network-manager/tree/debian/patches/netplan/0002-netplan-make-use-of-libnetplan-for-YAML-backend.patch#n319

This would not fix the root-cause, though, which is located in libnetplan: When creating or updating a NetworkManager connection profile that uses a 802.1x eap authentication method unknown to Netplan (such as "leap" or "pwd"), the Netplan keyfile parser is getting confused and generates a broken keyfile config for NetworkManager.

https://github.com/canonical/netplan/blob/main/src/parse-nm.c#L383

This is triggered when manually adding/modifying a corresponding NM connection profile (through the NM GUI, nmcli, NM DBus, ...) or automatically, when migrating a corresponding profile through NetworkManager's "Netplan everywhere" migration as part of the .postinst maintainer script. In the latter case the crash is handled gracefully, NetworkManager is restarted and the broken keyfile is restored from a backup.

https://git.launchpad.net/ubuntu/+source/network-manager/tree/debian/network-manager.postinst#n67

This can be fixed by supporting all of NetworkManager's 802.1x eap authentication methods in Netplan or by making Netplan's passthrough logic detect such cases and handle them as a fallback.

Kudos to @danilogondolfo for the investigation and the proposed patch:
https://github.com/canonical/netplan/pull/415

Changed in netplan.io (Ubuntu):
importance: Undecided → High
Changed in network-manager (Ubuntu):
importance: High → Medium
status: New → Triaged
Changed in netplan.io (Ubuntu):
status: New → Triaged
Lukas Märdian (slyon)
summary: - /usr/sbin/NetworkManager:6:g_assertion_message:g_assertion_message_expr:_internal_write_connection:nms_keyfile_writer_connection:nms_keyfile_plugin_update_connection
+ NetworkManager crashes when updating wpa-eap connections
Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote :

I'm working on the SRU of a couple of fixes for Netplan. This ticket is being user for the SRU https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2039825

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.107.1-3

---------------
netplan.io (0.107.1-3) unstable; urgency=medium

  * d/t/prep-testbed.sh: Improve autopkgtest reliability
  * d/p/python-limited-stable-api.patch: Build Python module against stable API
    (LP: #2050881)
  * d/patches: Cleanup DEP-3 headers

 -- Lukas Märdian <email address hidden> Tue, 23 Jan 2024 11:13:19 +0100

Changed in netplan.io (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Can we get proper SRU information on this bug? Thank you!

Changed in network-manager (Ubuntu Mantic):
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.