Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."

Today's Topics:

   1. [PATCH] vpn-provider: Cancel agent requests when removing VPN
      (Jussi Laakkonen)
   2. [PATCH] Fix hang up when connecting to a hidden network with a wrong size 
name parameter
      (Emmanuel Vautrin)
   3. [PATCH] Fix hang up when connecting a secure network with an empty 
passphrase
      (Emmanuel Vautrin)
   4. WireGuard plugin doesn't work: __vpn_ipconfig_foreach: symbol not found
      (Evgeny Zinoviev)


----------------------------------------------------------------------

Date: Wed,  2 Dec 2020 11:22:11 +0200
From: Jussi Laakkonen <[email protected]>
Subject: [PATCH] vpn-provider: Cancel agent requests when removing VPN
To: [email protected]
Message-ID: <[email protected]>

If a VPN has a pending request active in the agent and connman-vpnd is
restarted or shutdown it will result in segmentation fault. This happens
because plugins and tasks are cleaned up before vpn-provider and thus,
the removal of agent driver is called after the plugins are gone and
if there is a pending request from any unloaded VPN plugin it needs to
be cancelled. Since the callback set in the agent request points to a
function in the VPN plugin following happens:

Thread 1 "connman-vpnd" received signal SIGSEGV, Segmentation fault.
0xf6716cbc in ?? ()
(gdb) bt
\#0  0xf6716cbc in ?? ()
\#1  0x0002bafc in agent_finalize_pending (reply=reply@entry=0x0,
     agent=<optimized out>) at src/agent.c:121
\#2  0x0002bd80 in cancel_all_requests (agent=0x5285a0) at
     src/agent.c:483
\#3  agent_unref_debug (file=0x363d4 "src/agent.c", line=647,
     caller=<synthetic pointer>, agent=0x5285a0) at src/agent.c:568
\#4  agent_destroy (data=0x5285a0) at src/agent.c:647
\#5  0xf6f6e8d6 in g_hash_table_remove_all_nodes (hash_table=0x4c94e8,
     notify=<optimized out>, destruction=<optimized out>) at ghash.c:552
\#6  0xf6f6fe3c in g_hash_table_remove_all_nodes (destruction=0,
     notify=1, hash_table=0x4c94e8) at ghash.c:1444
\#7  g_hash_table_remove_all (hash_table=0x4c94e8) at ghash.c:1447
\#8  0x0002c442 in connman_agent_driver_unregister
     (driver=driver@entry=0x49784 <agent_driver>) at src/agent.c:629
\#9  0x00024442 in __vpn_provider_cleanup () at vpn/vpn-provider.c:3416
\#10 0x0001a086 in main (argc=1, argv=0xff8c1334) at vpn/main.c:283

Therefore, the requests must be canceled at plugin driver unregister as
that gets eventually called by VPN plugin exit function via
vpn_unregister().
---
 vpn/vpn-provider.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c
index 5d0fb2ce..be25e394 100644
--- a/vpn/vpn-provider.c
+++ b/vpn/vpn-provider.c
@@ -2984,6 +2984,12 @@ void vpn_provider_driver_unregister(struct 
vpn_provider_driver *driver)
                if (provider && provider->driver &&
                                g_strcmp0(provider->driver->name,
                                                        driver->name) == 0) {
+                       /*
+                        * Cancel VPN agent request to avoid segfault at
+                        * shutdown as the callback, if set can point to a
+                        * function in the plugin that is to be removed.
+                        */
+                       connman_agent_cancel(provider);
                        provider->driver = NULL;
                }
        }
-- 
2.20.1

------------------------------

Date: Wed, 02 Dec 2020 09:11:19 -0000
From: "Emmanuel Vautrin" <[email protected]>
Subject: [PATCH] Fix hang up when connecting to a hidden network with
        a wrong size name parameter
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Hello everyone,

Please find the patch below that fixes this issue:
---
 src/service.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/service.c b/src/service.c
index 629db995..a6e8407a 100644
--- a/src/service.c
+++ b/src/service.c
@@ -5692,14 +5692,18 @@ static void request_input_cb(struct connman_service 
*service,
                goto done;
        }
 
-       if (service->hidden && name_len > 0 && name_len <= 32) {
-               device = connman_network_get_device(service->network);
-               security = connman_network_get_string(service->network,
-                                                       "WiFi.Security");
-               err = __connman_device_request_hidden_scan(device,
-                                               name, name_len,
-                                               identity, passphrase,
-                                               security, user_data);
+       if (service->hidden) {
+               if (name_len > 0 && name_len <= 32) {
+                       device = connman_network_get_device(service->network);
+                       security = connman_network_get_string(service->network,
+                                                               
"WiFi.Security");
+                       err = __connman_device_request_hidden_scan(device,
+                                                       name, name_len,
+                                                       identity, passphrase,
+                                                       security, user_data);
+               } else {
+                       err = -EINVAL;
+               }
                if (err < 0)
                        __connman_service_return_error(service, -err,
                                                        user_data);
-- 

Best Regards,

Emmanuel

------------------------------

Date: Wed, 02 Dec 2020 09:17:17 -0000
From: "Emmanuel Vautrin" <[email protected]>
Subject: [PATCH] Fix hang up when connecting a secure network with an
        empty passphrase
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Hello everyone,

Please find below the patch fixing this issue:

diff --git a/src/service.c b/src/service.c
index 8d236749..629db995 100644
--- a/src/service.c
+++ b/src/service.c
@@ -4021,6 +4021,7 @@ static void disconnect_on_last_session(enum 
connman_service_type type)
 static int active_sessions[MAX_CONNMAN_SERVICE_TYPES] = {};
 static int always_connect[MAX_CONNMAN_SERVICE_TYPES] = {};
 static int active_count = 0;
+static bool passphrase_requested = false;
 
 void __connman_service_set_active_session(bool enable, GSList *list)
 {
@@ -4187,6 +4188,9 @@ static bool auto_connect_service(GList *services,
                        continue;
                }
 
+               if (passphrase_requested)
+                               return true;
+
                if (service->pending ||
                                is_connecting(service->state) ||
                                is_connected(service->state)) {
@@ -5721,6 +5725,7 @@ static void request_input_cb(struct connman_service 
*service,
                err = __connman_service_set_passphrase(service, passphrase);
 
  done:
+       passphrase_requested = false;
        if (err >= 0) {
                /* We forget any previous error. */
                set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
@@ -6664,6 +6669,9 @@ int __connman_service_connect(struct connman_service 
*service,
                        if (service->hidden && err != -EINPROGRESS)
                                service->pending = pending;
 
+                       if (err == -EINPROGRESS)
+                               passphrase_requested = true;
+
                        return err;
                }
        }
-- 

Best Regards,

Emmanuel

------------------------------

Date: Wed, 2 Dec 2020 15:24:46 +0300
From: Evgeny Zinoviev <[email protected]>
Subject: WireGuard plugin doesn't work: __vpn_ipconfig_foreach: symbol
        not found
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi everybody.

I'm using connman 1.38 on Void Linux with musl-libc. I was trying to 
connect to my WireGuard VPN using connman but the wireguard plugin 
crashes on load:

2020-12-01T20:51:31.96059 daemon.err: DecĀ  1 20:51:31 connman-vpnd[502]: 
Can't load /usr/lib/connman/plugins-vpn/wireguard.so: Error relocating 
/usr/lib/connman/plugins-vpn/wireguard.so: __vpn_ipconfig_foreach: 
symbol not found

Everything else is working fine.

Please tell me how can I help with debugging and solving this issue.

Evgeny

------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list -- [email protected]
To unsubscribe send an email to [email protected]


------------------------------

End of connman Digest, Vol 62, Issue 1
**************************************

Reply via email to