From bbca706eae769452b15f812e6006c0d06b3ce6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 14 Apr 2014 15:40:14 +0200 Subject: [PATCH] mobile: fix crash on modems (rh #1056133) Only move to NEED_AUTH during activation (rh #1058308) https://bugzilla.redhat.com/show_bug.cgi?id=1058308 https://bugzilla.redhat.com/show_bug.cgi?id=1056133 --- 0059-rh1056133-fix-modem-enable-crash.patch | 70 +++++++++++++++++++++ NetworkManager.spec | 7 ++- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 0059-rh1056133-fix-modem-enable-crash.patch diff --git a/0059-rh1056133-fix-modem-enable-crash.patch b/0059-rh1056133-fix-modem-enable-crash.patch new file mode 100644 index 0000000..9cf9a3d --- /dev/null +++ b/0059-rh1056133-fix-modem-enable-crash.patch @@ -0,0 +1,70 @@ +From 5c1dee10cde3cc7cf74718650702dd124d46aa75 Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Sun, 9 Feb 2014 03:31:21 -0600 +Subject: [PATCH] mobile: only change state to NEED_AUTH during activation (rh + #1058308) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Auth requests only happen during activation and there's no need to +request secrets at any other time. Ensure that the device state +won't change to NEED_AUTH except when activating. + +(There's a case in NMModemBroadband where set_mm_enabled() +when the modem is locked may cause this, but we'll solve this +a different way later.) + +https://bugzilla.redhat.com/show_bug.cgi?id=1058308 + +Signed-off-by: Jiří Klimeš +--- + src/devices/nm-device-bt.c | 10 +++++++++- + src/devices/nm-device-modem.c | 10 +++++++++- + 2 files changed, 18 insertions(+), 2 deletions(-) + +diff --git a/src/devices/nm-device-bt.c b/src/devices/nm-device-bt.c +index e22c96e..3e5b693 100644 +--- a/src/devices/nm-device-bt.c ++++ b/src/devices/nm-device-bt.c +@@ -423,7 +423,15 @@ ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) + static void + modem_auth_requested (NMModem *modem, gpointer user_data) + { +- nm_device_state_changed (NM_DEVICE (user_data), ++ NMDevice *device = NM_DEVICE (user_data); ++ ++ /* Auth requests (PIN, PAP/CHAP passwords, etc) only get handled ++ * during activation. ++ */ ++ if (!nm_device_is_activating (device)) ++ return; ++ ++ nm_device_state_changed (device, + NM_DEVICE_STATE_NEED_AUTH, + NM_DEVICE_STATE_REASON_NONE); + } +diff --git a/src/devices/nm-device-modem.c b/src/devices/nm-device-modem.c +index 0bed60c..e047c03 100644 +--- a/src/devices/nm-device-modem.c ++++ b/src/devices/nm-device-modem.c +@@ -113,7 +113,15 @@ modem_prepare_result (NMModem *modem, + static void + modem_auth_requested (NMModem *modem, gpointer user_data) + { +- nm_device_state_changed (NM_DEVICE (user_data), ++ NMDevice *device = NM_DEVICE (user_data); ++ ++ /* Auth requests (PIN, PAP/CHAP passwords, etc) only get handled ++ * during activation. ++ */ ++ if (!nm_device_is_activating (device)) ++ return; ++ ++ nm_device_state_changed (device, + NM_DEVICE_STATE_NEED_AUTH, + NM_DEVICE_STATE_REASON_NONE); + } +-- +1.7.11.7 + diff --git a/NetworkManager.spec b/NetworkManager.spec index 37676e3..b9ce2d7 100644 --- a/NetworkManager.spec +++ b/NetworkManager.spec @@ -42,7 +42,7 @@ Name: NetworkManager Summary: Network connection manager and user applications Epoch: 1 Version: 0.9.9.0 -Release: 35%{snapshot}%{?dist} +Release: 36%{snapshot}%{?dist} Group: System Environment/Base License: GPLv2+ URL: http://www.gnome.org/projects/NetworkManager/ @@ -109,6 +109,7 @@ Patch55: 0055-rh1080474-nmcli-show-mbit-s.patch Patch56: 0056-rh1084556-pending-action-queued-state-lock.patch Patch57: 0057-emit-property-changed-for-active-conn.patch Patch58: 0058-rh1086132-NM-crash-fix-wifi-ap-utils.patch +Patch59: 0059-rh1056133-fix-modem-enable-crash.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -332,6 +333,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment. %patch56 -p1 -b .0056-rh1084556-pending-action-queued-state-lock.orig %patch57 -p1 -b .0057-emit-property-changed-for-active-conn.orig %patch58 -p1 -b .0058-rh1086132-NM-crash-fix-wifi-ap-utils.orig +%patch59 -p1 -b .0059-rh1056133-fix-modem-enable-crash.orig %build @@ -556,6 +558,9 @@ fi %endif %changelog +* Mon Apr 14 2014 Jiří Klimeš - 0.9.9.0-36.git20131003 +- mobile: fix crash (only move to NEED_AUTH during activation (rh #1056133) (rh #1058308) + * Thu Apr 10 2014 Jiří Klimeš - 0.9.9.0-35.git20131003 - wifi: fix possible crash in Wi-Fi utils (rh #1086132)