GNOME Bugzilla – Bug 584774
ifupdown plugin segfaults with empty ssid
Last modified: 2009-09-04 01:45:13 UTC
I am using network-manager 0.7.1, on Debian testing. My syslog was littered with segfaults like this: nm-system-setti[1052]: segfault at 4 ip b7ffa4f1 sp bfd1bd50 error 4 in libnm settings-plugin-ifupdown.so[b7ff6000+8000] nm-system-setti[1516]: segfault at 4 ip b7f924f1 sp bfab3af0 error 4 in libnm-settings-plugin-ifupdown.so[b7f8e000+8000] I traced back the crash point to system-settings/plugins/ifupdown/parser.c, line 245, in the normalize_psk function. Apparently, nm_setting_wireless_get_ssid returns NULL as ssid. Does it mean the SSID is empty or is there some other problem causing that? Anyway, with the following patch, the crash does not show up anymore. --- parser.c 2009-06-03 22:37:46.923274704 +0200 +++ /tmp/NetworkManager-0.7.1/system-settings/plugins/ifupdown/parser.c 2009-03-03 18:59:50.000000000 +0100 @@ -245,7 +245,7 @@ unsigned char *buf = g_malloc0 (WPA_PMK_LEN * 2); ssid = nm_setting_wireless_get_ssid (s_wireless); - pbkdf2_sha1 (value, ssid ? (char *) ssid->data : NULL, ssid ? ssid->len : 0, 4096, buf, WPA_PMK_LEN); + pbkdf2_sha1 (value, (char *) ssid->data, ssid->len, 4096, buf, WPA_PMK_LEN); normalized = utils_bin2hexstr ((const char *) buf, WPA_PMK_LEN, WPA_PMK_LEN * 2); g_free (buf); }
Should actually be fixed by current git master and NM 0.7.2 (upcoming) where we just push passphrases to NM and no longer hash the passphrase manually. commit 0408c149b558787f99cb7c095f142a46d9778c89 Author: Dan Williams <dcbw@redhat.com> Date: Fri Jun 5 22:09:39 2009 -0400 system-settings: kill usage of sha1 since NM can handle passphrases now