[PATCH] nm-service-openvpn: prevent segfault



Hey,

r4056 introduced management socket cleanup in the openvpn plugin - and a 
SIGSEGV for me, when openvpn fails to start (because one needs 2.1_rc 
now). Backtrace, log and patch follow.

Robert


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fd2db7e3740 (LWP 30941)]
0x00007fd2daacb961 in g_io_channel_get_buffer_condition () 
from /usr/lib/libglib-2.0.so.0
(gdb) bt full
#0  0x00007fd2daacb961 in g_io_channel_get_buffer_condition () 
from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#1  0x0000000000403014 in openvpn_watch_cb (pid=30948, status=256, 
user_data=0x6488a0) at nm-openvpn-service.c:459
        channel = (GIOChannel *) 0x0
        condition = 32722
        plugin = (NMVPNPlugin *) 0x6488a0
        priv = (NMOpenvpnPluginPrivate *) 0x6488f0
        failure = NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED
        error = 1
        good_exit = 0
        __PRETTY_FUNCTION__ = "openvpn_watch_cb"
#2  0x00007fd2daad4308 in ?? () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#3  0x00007fd2daad5e98 in g_main_context_dispatch () 
from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#4  0x00007fd2daad9115 in ?? () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#5  0x00007fd2daad95fa in g_main_loop_run () 
from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#6  0x000000000040434b in main (argc=1, argv=0x7fffe381e068) at 
nm-openvpn-service.c:1045
        plugin = (NMOpenvpnPlugin *) 0x6488a0
        main_loop = (GMainLoop *) 0x64a170
(gdb)
 
 
NetworkManager: <info>  Starting VPN 
service 'org.freedesktop.NetworkManager.openvpn'...
NetworkManager: <info>  VPN 
service 'org.freedesktop.NetworkManager.openvpn' started 
(org.freedesktop.NetworkManager.openvpn), PID 19510
NetworkManager: <info>  VPN 
service 'org.freedesktop.NetworkManager.openvpn' just appeared, 
activating connections
NetworkManager: <info>  VPN plugin state changed: 1
NetworkManager: <info>  VPN plugin state changed: 3
NetworkManager: <info>  VPN connection 'tubit-o' (Connect) reply 
received.
nm-openvpn[19515]: Options error: Unrecognized option or missing 
parameter(s) in [CMD-LINE]:1: script-security (2.0.7)
nm-openvpn[19515]: Use --help for more information.
[29782.335456] nm-openvpn-serv[19510]: segfault at 10 ip 
00007f6803114961 sp 00007fff0be688b0 error 4 in 
libglib-2.0.so.0.1600.5[7f68030e9000+d8000]
NetworkManager: <WARN>  vpn_service_watch_cb(): VPN 
service 'org.freedesktop.NetworkManager.openvpn' died with signal 11
NetworkManager: <WARN>  connection_state_changed(): The name 
org.freedesktop.NetworkManager.openvpn was not provided by any .service 
files
NetworkManager: <info>  VPN 
service 'org.freedesktop.NetworkManager.openvpn' disappeared, 
cancelling connections

Index: vpn-daemons/openvpn/src/nm-openvpn-service.c
===================================================================
--- vpn-daemons/openvpn/src/nm-openvpn-service.c	(revision 4069)
+++ vpn-daemons/openvpn/src/nm-openvpn-service.c	(working copy)
@@ -452,7 +452,7 @@
 	}
 
 	/* Try to get the last bits of data from openvpn */
-	if (priv->io_data) {
+	if (priv->io_data && priv->io_data->socket_channel) {
 		GIOChannel *channel = priv->io_data->socket_channel;
 		GIOCondition condition;
 

Attachment: signature.asc
Description: This is a digitally signed message part.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]