[PATCH 0/2] Prevent abort on non-UTF-8 data loaded from storage
Giuseppe Eletto <[email protected]> Wed, 8 Jul 2026 19:56:48 +0200
| Newsgroups | dev.linux.lists.connman |
|---|---|
| Message-ID | <[email protected]> |
While investigating a connmand crash loop on an i.MX91 based device I found that connmand aborts on start with SIGABRT raised from libdbus. The global settings file contained a WiFi tethering identifier and/or passphrase that were no longer valid UTF-8: [WiFi] Tethering.Identifier=@????? Tethering.Passphrase=PW\215\301\252\252 technology_load() loads these values and append_properties() hands them to D-Bus when the TechnologyAdded signal is emitted. libdbus aborts the whole process when a string that is not valid UTF-8 is appended to a message, so connmand crashes on every start and cannot recover without manually editing or removing the lines from the file: Aborting (signal 6) [/usr/sbin/connmand] #6 libdbus-1.so.3 dbus_message_iter_append_basic #7 connmand connman_dbus_dict_append_basic #8 connmand append_properties #9 connmand technology_added_signal #10 connmand technology_dbus_register #11 connmand technology_get The same problem applies to the WiFi service name, which is also loaded verbatim from storage and exported over D-Bus. This series makes connmand resilient to such corrupted data by validating the affected strings with g_utf8_validate() when they are loaded and ignoring the invalid ones. Values sent over D-Bus are always valid UTF-8, so only corrupted on-disk data is affected. Giuseppe Eletto (2): technology: Ignore invalid UTF-8 tethering identifier and passphrase service: Ignore invalid UTF-8 service name src/service.c | 8 ++++++++ src/technology.c | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) -- 2.50.1