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 0/3] Fix WireGuard fallouts (Daniel Wagner)
2. [PATCH 1/3] wireguard: Fix use after free (Daniel Wagner)
3. [PATCH 2/3] wireguard: Initialize data structure properly
(Daniel Wagner)
4. [PATCH 3/3] wireguard: Fix typo in option parser (Daniel Wagner)
5. Re: [PATCH 2/3] wireguard: Initialize data structure properly
(Jussi Laakkonen)
6. Re: [PATCH 2/3] wireguard: Initialize data structure properly
(Daniel Wagner)
7. Re: [PATCH 2/3] wireguard: Initialize data structure properly
(Jussi Laakkonen)
8. Python3 support (nick83ola)
9. Any connman API for WiFi WPS process? (JH)
----------------------------------------------------------------------
Date: Mon, 18 Nov 2019 09:17:17 +0100
From: Daniel Wagner <[email protected]>
Subject: [PATCH 0/3] Fix WireGuard fallouts
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Message-ID: <[email protected]>
A few minor fixes for WireGuard.
Daniel Wagner (3):
wireguard: Fix use after free
wireguard: Initialize data structure properly
wireguard: Fix typo in option parser
vpn/plugins/wireguard.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--
2.24.0
------------------------------
Date: Mon, 18 Nov 2019 09:17:18 +0100
From: Daniel Wagner <[email protected]>
Subject: [PATCH 1/3] wireguard: Fix use after free
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Message-ID: <[email protected]>
Use freeaddrinfo after rp has been used. rp points to an element in
results.
---
vpn/plugins/wireguard.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/vpn/plugins/wireguard.c b/vpn/plugins/wireguard.c
index e55f2fcc8bf9..aca3c562162f 100644
--- a/vpn/plugins/wireguard.c
+++ b/vpn/plugins/wireguard.c
@@ -145,12 +145,14 @@ static int parse_endpoint(const char *host, const char
*port, wg_peer *peer)
close(sk);
}
- freeaddrinfo(result);
- if (!rp)
+ if (!rp) {
+ freeaddrinfo(result);
return -EINVAL;
+ }
memcpy(&peer->endpoint.addr, rp->ai_addr, rp->ai_addrlen);
+ freeaddrinfo(result);
return 0;
}
--
2.24.0
------------------------------
Date: Mon, 18 Nov 2019 09:17:19 +0100
From: Daniel Wagner <[email protected]>
Subject: [PATCH 2/3] wireguard: Initialize data structure properly
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Message-ID: <[email protected]>
The info data structure should be properly initialized.
#0 0x00007ffff7bd98f7 in __memmove_avx_unaligned () from /lib64/libc.so.6
#1 0x00007ffff7fa4925 in mnl_attr_put () from /usr/lib64/libmnl.so.0
#2 0x00007ffff7fa496f in mnl_attr_put_check () from /usr/lib64/libmnl.so.0
#3 0x000000000040dd95 in wg_set_device (dev=0x480c70) at
vpn/plugins/libwireguard.c:341
#4 0x0000000000410dd7 in wg_connect (provider=0x47e100, task=0x0,
if_name=0x0, cb=0x0, dbus_sender=0x0,
user_data=0x0) at vpn/plugins/wireguard.c:336
#5 0x0000000000413092 in vpn_connect (provider=0x47e100, cb=0x41e946
<connect_cb>,
dbus_sender=0x481dd4 ":1.46", user_data=0x475a10) at vpn/plugins/vpn.c:632
#6 0x000000000041ec52 in __vpn_provider_connect (provider=0x47e100,
msg=0x475a10) at vpn/vpn-provider.c:1206
#7 0x000000000041d488 in do_connect (conn=0x473ce0, msg=0x475a10,
data=0x47e100) at vpn/vpn-provider.c:505
#8 0x000000000041d4da in do_connect2 (conn=0x473ce0, msg=0x475a10,
data=0x47e100) at vpn/vpn-provider.c:515
#9 0x0000000000435691 in process_message (connection=0x473ce0,
message=0x475a10,
method=0x43bfe0 <connection_methods+160>, iface_user_data=0x47e100) at
gdbus/object.c:259
#10 0x00000000004371a5 in generic_message (connection=0x473ce0,
message=0x475a10, user_data=0x47f340)
at gdbus/object.c:1071
#11 0x00007ffff7e4fc4d in ?? () from /usr/lib64/libdbus-1.so.3
#12 0x00007ffff7e407a4 in dbus_connection_dispatch () from
/usr/lib64/libdbus-1.so.3
#13 0x000000000043306b in message_dispatch (data=0x473ce0) at
gdbus/mainloop.c:72
#14 0x00007ffff7eca9f7 in ?? () from /usr/lib64/libglib-2.0.so.0
#15 0x00007ffff7ecdf88 in g_main_context_dispatch () from
/usr/lib64/libglib-2.0.so.0
#16 0x00007ffff7ece310 in ?? () from /usr/lib64/libglib-2.0.so.0
#17 0x00007ffff7ece5e3 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#18 0x0000000000419f6f in main (argc=1, argv=0x7fffffffec28) at vpn/main.c:275
---
vpn/plugins/wireguard.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vpn/plugins/wireguard.c b/vpn/plugins/wireguard.c
index aca3c562162f..e9a3f50db358 100644
--- a/vpn/plugins/wireguard.c
+++ b/vpn/plugins/wireguard.c
@@ -252,7 +252,7 @@ static int wg_connect(struct vpn_provider *provider,
char *ifname;
int err = -EINVAL;
- info = g_malloc(sizeof(struct wireguard_info));
+ info = g_malloc0(sizeof(struct wireguard_info));
info->peer.flags = WGPEER_HAS_PUBLIC_KEY | WGPEER_REPLACE_ALLOWEDIPS;
info->device.flags = WGDEVICE_HAS_PRIVATE_KEY |
WGDEVICE_HAS_LISTEN_PORT;
info->device.first_peer = &info->peer;
--
2.24.0
------------------------------
Date: Mon, 18 Nov 2019 09:17:20 +0100
From: Daniel Wagner <[email protected]>
Subject: [PATCH 3/3] wireguard: Fix typo in option parser
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Message-ID: <[email protected]>
The option is called WireGuard.EndpointPort.
---
vpn/plugins/wireguard.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vpn/plugins/wireguard.c b/vpn/plugins/wireguard.c
index e9a3f50db358..4d2fe3c3ad75 100644
--- a/vpn/plugins/wireguard.c
+++ b/vpn/plugins/wireguard.c
@@ -293,7 +293,7 @@ static int wg_connect(struct vpn_provider *provider,
if (err)
goto done;
- option = vpn_provider_get_string(provider, "Wireguard.EndpointPort");
+ option = vpn_provider_get_string(provider, "WireGuard.EndpointPort");
if (!option)
option = "51820";
--
2.24.0
------------------------------
Date: Mon, 18 Nov 2019 10:31:45 +0200
From: Jussi Laakkonen <[email protected]>
Subject: Re: [PATCH 2/3] wireguard: Initialize data structure properly
To: Daniel Wagner <[email protected]>, [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
Hi Daniel,
On 11/18/19 10:17 AM, Daniel Wagner wrote:
> The info data structure should be properly initialized.
>
> #0 0x00007ffff7bd98f7 in __memmove_avx_unaligned () from /lib64/libc.so.6
> #1 0x00007ffff7fa4925 in mnl_attr_put () from /usr/lib64/libmnl.so.0
> #2 0x00007ffff7fa496f in mnl_attr_put_check () from /usr/lib64/libmnl.so.0
> #3 0x000000000040dd95 in wg_set_device (dev=0x480c70) at
> vpn/plugins/libwireguard.c:341
> #4 0x0000000000410dd7 in wg_connect (provider=0x47e100, task=0x0,
> if_name=0x0, cb=0x0, dbus_sender=0x0,
> user_data=0x0) at vpn/plugins/wireguard.c:336
> #5 0x0000000000413092 in vpn_connect (provider=0x47e100, cb=0x41e946
> <connect_cb>,
> dbus_sender=0x481dd4 ":1.46", user_data=0x475a10) at
> vpn/plugins/vpn.c:632
> #6 0x000000000041ec52 in __vpn_provider_connect (provider=0x47e100,
> msg=0x475a10) at vpn/vpn-provider.c:1206
> #7 0x000000000041d488 in do_connect (conn=0x473ce0, msg=0x475a10,
> data=0x47e100) at vpn/vpn-provider.c:505
> #8 0x000000000041d4da in do_connect2 (conn=0x473ce0, msg=0x475a10,
> data=0x47e100) at vpn/vpn-provider.c:515
> #9 0x0000000000435691 in process_message (connection=0x473ce0,
> message=0x475a10,
> method=0x43bfe0 <connection_methods+160>, iface_user_data=0x47e100) at
> gdbus/object.c:259
> #10 0x00000000004371a5 in generic_message (connection=0x473ce0,
> message=0x475a10, user_data=0x47f340)
> at gdbus/object.c:1071
> #11 0x00007ffff7e4fc4d in ?? () from /usr/lib64/libdbus-1.so.3
> #12 0x00007ffff7e407a4 in dbus_connection_dispatch () from
> /usr/lib64/libdbus-1.so.3
> #13 0x000000000043306b in message_dispatch (data=0x473ce0) at
> gdbus/mainloop.c:72
> #14 0x00007ffff7eca9f7 in ?? () from /usr/lib64/libglib-2.0.so.0
> #15 0x00007ffff7ecdf88 in g_main_context_dispatch () from
> /usr/lib64/libglib-2.0.so.0
> #16 0x00007ffff7ece310 in ?? () from /usr/lib64/libglib-2.0.so.0
> #17 0x00007ffff7ece5e3 in g_main_loop_run () from
> /usr/lib64/libglib-2.0.so.0
> #18 0x0000000000419f6f in main (argc=1, argv=0x7fffffffec28) at
> vpn/main.c:275
> ---
> vpn/plugins/wireguard.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/vpn/plugins/wireguard.c b/vpn/plugins/wireguard.c
> index aca3c562162f..e9a3f50db358 100644
> --- a/vpn/plugins/wireguard.c
> +++ b/vpn/plugins/wireguard.c
> @@ -252,7 +252,7 @@ static int wg_connect(struct vpn_provider *provider,
> char *ifname;
> int err = -EINVAL;
>
> - info = g_malloc(sizeof(struct wireguard_info));
> + info = g_malloc0(sizeof(struct wireguard_info));
Doesn't coding style M8 state that g_try_malloc{,0} should be preferred?
> info->peer.flags = WGPEER_HAS_PUBLIC_KEY | WGPEER_REPLACE_ALLOWEDIPS;
> info->device.flags = WGDEVICE_HAS_PRIVATE_KEY |
> WGDEVICE_HAS_LISTEN_PORT;
> info->device.first_peer = &info->peer;
>
Cheers,
Jussi
------------------------------
Date: Mon, 18 Nov 2019 09:44:50 +0100
From: Daniel Wagner <[email protected]>
Subject: Re: [PATCH 2/3] wireguard: Initialize data structure properly
To: Jussi Laakkonen <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
Hi Jussi,
On 18.11.19 09:31, Jussi Laakkonen wrote:
>> --- a/vpn/plugins/wireguard.c
>> +++ b/vpn/plugins/wireguard.c
>> @@ -252,7 +252,7 @@ static int wg_connect(struct vpn_provider *provider,
>> char *ifname;
>> int err = -EINVAL;
>> - info = g_malloc(sizeof(struct wireguard_info));
>> + info = g_malloc0(sizeof(struct wireguard_info));
>
> Doesn't coding style M8 state that g_try_malloc{,0} should be preferred?
Yes, that's correct. Though these days I'd say if malloc fails we are
out of luck and should just die. All those error paths we have
implemented in ConnMan have never been exercised. So what's better?
Untested code or just known behavior?
g_try_malloc() makes sense if you want to allocate a lot of memory. But
for small allocations.
Maybe we should update M8. What do you think?
Thanks,
Daniel
------------------------------
Date: Mon, 18 Nov 2019 11:35:31 +0200
From: Jussi Laakkonen <[email protected]>
Subject: Re: [PATCH 2/3] wireguard: Initialize data structure properly
To: Daniel Wagner <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
Hi Daniel,
On 11/18/19 10:44 AM, Daniel Wagner wrote:
> Hi Jussi,
>
> Yes, that's correct. Though these days I'd say if malloc fails we are
> out of luck and should just die. All those error paths we have
> implemented in ConnMan have never been exercised. So what's better?
> Untested code or just known behavior?
>
I'd prefer the latter. Unit tests will get you only so far, and
end-to-end testing of all features and situations is cumbersome and
error prone.
> g_try_malloc() makes sense if you want to allocate a lot of memory. But
> for small allocations.
>
> Maybe we should update M8. What do you think?
>
It would be good to have the coding style up to date as it is the common
rule-set for all. Other obsolete requirements should be discarded as
well if they do not apply anymore.
Cheers,
Jussi
------------------------------
Date: Mon, 18 Nov 2019 16:18:45 +0000
From: nick83ola <[email protected]>
Subject: Python3 support
To: [email protected]
Message-ID:
<cabph3unv3ccsavroh-kbzywuhnl3e9r4xuoe4ggatmvmlxg...@mail.gmail.com>
Content-Type: multipart/alternative;
boundary="000000000000f7a8840597a14d9b"
--000000000000f7a8840597a14d9b
Content-Type: text/plain; charset="UTF-8"
Hi connman developers,
how is the status of python3 support in connman?
-> python2.7 will be EOL in january 2020...
Cheers
Nicola Lunghi
--000000000000f7a8840597a14d9b
Content-Type: text/html; charset="UTF-8"
<div dir="ltr"><div>Hi connman developers,</div><div>how is the status of
python3 support in connman?</div><div>-> python2.7 will be EOL in january
2020...<br></div><div>Cheers</div><div>Nicola Lunghi</div><div><br></div></div>
--000000000000f7a8840597a14d9b--
------------------------------
Date: Tue, 19 Nov 2019 17:40:33 +1100
From: JH <[email protected]>
Subject: Any connman API for WiFi WPS process?
To: connman <[email protected]>
Message-ID:
<CAA=hcwrthczzwnimhvgoufpvnv+prcesu9pdftnadxs8v6w...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Hi,
I think connman can catch WiFi WPS broadcasting message and extract
WiFi network name and password, are there any dbus API to find the
WiFi network name and password during WiFi WPS process?
Thank you.
Kind regards,
- jh
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list -- [email protected]
To unsubscribe send an email to [email protected]
------------------------------
End of connman Digest, Vol 49, Issue 21
***************************************