iwd core dump
by KeithG
This is on an Rpi B3+ runint aarch64. I have noticed that, periodically I
get disconnected and it doe snot reconnect. I am using connman to manage
the iwd connection. This is the first time I have seen the crash in the
log. It has been crashing and not recovering.
It gets a Deauth event (I've seen this quite a bit) and usually, it will
not reconnect until I reboot it and my router. How can I best diagnose this?
It is iwd 1.7 and connman 1.38. potentially useful excerpts from my journal:
Jun 17 23:26:58 rune64 kernel: Booting Linux on physical CPU 0x0000000000
[0x410fd034]
Jun 17 23:26:58 rune64 kernel: Linux version 5.4.44-1-ARCH
(alarm@buildrune64) (gcc version 9.3.0 (GCC)) #1 SMP PREEMPT Mon Jun 22
15:13:50 CDT 2020
Jun 17 23:26:58 rune64 kernel: Machine model: Raspberry Pi 3 Model B Plus
Rev 1.3
...
Jun 17 23:26:58 rune64 kernel: raspberrypi-firmware soc:firmware: Attached
to firmware from 2020-06-10 17:52, variant start_cd
Jun 17 23:26:58 rune64 kernel: raspberrypi-firmware soc:firmware: Firmware
hash is e46bba1638cca2708b31b9daf4636770ef981735
...
Jun 17 23:26:59 rune64 kernel: brcmfmac: F1 signature read
@0x18000000=0x15264345
Jun 17 23:26:59 rune64 kernel: brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43455-sdio for chip BCM4345/6
Jun 17 23:26:59 rune64 kernel: usbcore: registered new interface driver
brcmfmac
...
Jun 17 23:27:00 rune64 kernel: brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43455-sdio for chip BCM4345/6
Jun 17 23:27:00 rune64 kernel: brcmfmac: brcmf_c_preinit_dcmds: Firmware:
BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID
01-4fbe0b04
...
Jun 24 22:28:10 rune64 iwd[261]: Wireless daemon version 1.7
Jun 24 22:28:10 rune64 iwd[261]: Loaded configuration from
/etc/iwd/main.conf
Jun 24 22:28:10 rune64 systemd[1]: Started Wireless service.
Jun 24 22:28:10 rune64 iwd[261]: netconfig: Network configuration is
disabled.
Jun 24 22:28:10 rune64 iwd[261]: Wiphy: 0, Name: phy0
Jun 24 22:28:10 rune64 iwd[261]: Permanent Address:
b8:27:eb:52:cc:d0
Jun 24 22:28:10 rune64 iwd[261]: Bands: 2.4 GHz 5 GHz
Jun 24 22:28:10 rune64 iwd[261]: Ciphers: CCMP TKIP BIP
Jun 24 22:28:10 rune64 iwd[261]: Supported iftypes: ad-hoc station
ap p2p-client p2p-go p2p-device
Jun 24 22:28:10 rune64 iwd[261]: Wiphy phy0 will only use the default
interface
Jun 24 22:28:11 rune64 iwd[261]: hardware_rekey not supported
Jun 25 13:40:14 rune64 iwd[261]: Received Deauthentication event, reason:
2, from_ap: false
Jun 25 13:40:14 rune64 iwd[261]: Received error during CMD_TRIGGER_SCAN:
Resource temporarily unavailable (11)
Jun 25 13:40:15 rune64 systemd[1]: iwd.service: Main process exited,
code=dumped, status=11/SEGV
Jun 25 13:40:15 rune64 systemd[1]: iwd.service: Failed with result
'core-dump'.
Jun 25 13:40:15 rune64 systemd[1]: iwd.service: Scheduled restart job,
restart counter is at 1.
Jun 25 13:40:15 rune64 systemd[1]: Stopped Wireless service.
Jun 25 13:40:15 rune64 systemd[1]: Starting Wireless service...
Jun 25 13:40:15 rune64 iwd[15388]: Wireless daemon version 1.7
Jun 25 13:40:15 rune64 iwd[15388]: Loaded configuration from
/etc/iwd/main.conf
Jun 25 13:40:15 rune64 systemd[1]: Started Wireless service.
7 months
[PATCH v2 0/7] Radio Management Module
by James Prestwood
Version 2:
- Renamed from 'offchannel'
- Fixed potential problems in initial p2p patch. Added work ID tracking
as well as setting ID to zero once completed since the ID is reused
for multiple requests. If Andrew could verify everything looks ok that
would be great.
- Changed priority from enum to integer. This makes things much more
flexible.
- Removed the concept of suspended completely. This was to support scanning
but with the addition of priorities we can actually insert ANQP entries
before any pending scans, which avoids needing to suspend scanning.
- Connection attempts are now treated as radio management work items. This
in addition to the above changes allow us again to avoid suspending scans
as well as waiting for ANQP to complete before connecting. Connections
can be inserted after ANQP, but before scans which removes the need for
the ANQP watch in station.
James Prestwood (7):
radio_mgmt: introduce new radio management module
wiphy: integrate radio management module
frame-xchg: refactor to use radio management module
anqp: refactor to use frame-xchg
scan: refactor to use radio management module
network: use radio management for connections
station: remove ANQP watch
Makefile.am | 1 +
src/anqp.c | 443 ++++++++++-------------------------------------
src/anqp.h | 3 +-
src/frame-xchg.c | 99 +++++------
src/frame-xchg.h | 6 +-
src/network.c | 148 ++++++++--------
src/p2p.c | 22 ++-
src/radio_mgmt.c | 240 +++++++++++++++++++++++++
src/radio_mgmt.h | 48 +++++
src/scan.c | 104 ++++-------
src/scan.h | 3 -
src/station.c | 75 ++------
src/station.h | 5 -
src/wiphy.c | 5 +
14 files changed, 575 insertions(+), 627 deletions(-)
create mode 100644 src/radio_mgmt.c
create mode 100644 src/radio_mgmt.h
--
2.21.1
7 months
iwd 1.8 causes kernel oops
by caljorden@hotmail.com
Hi all,
I have observed on my two main machines that I am getting a kernel oops when I boot that only occurs when I am running IWD 1.8. When I downgrade to IWD 1.7, the oops goes away. I have observed this on kernels 5.7.4 and 5.7.5 (at least). The kernel oops does not seem to negatively impact the operation of the system, and wireless works fine after this as well.
Here are the oops details:
[ 2.951230] ------------[ cut here ]------------
[ 2.951235] WARNING: CPU: 13 PID: 3703 at net/wireless/nl80211.c:7259 nl80211_get_reg_do+0x1f1/0x220
[ 2.951235] Modules linked in: algif_aead algif_skcipher md4 algif_hash af_alg amd64_edac_mod(-) pcc_cpufreq(-) iwlmvm btusb btrtl btbcm btintel bluetooth ecdh_generic iwlwifi ecc snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec_hdmi crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel crypto_simd cryptd snd_hda_intel glue_helper snd_intel_dspcfg snd_hda_codec k10temp snd_hwdep snd_hda_core
[ 2.951245] CPU: 13 PID: 3703 Comm: iwd Tainted: G T 5.7.5 #2
[ 2.951246] Hardware name: Micro-Star International Co., Ltd. MS-7B93/MPG X570 GAMING PRO CARBON WIFI (MS-7B93), BIOS 1.50 11/06/2019
[ 2.951248] RIP: 0010:nl80211_get_reg_do+0x1f1/0x220
[ 2.951249] Code: 24 0c 01 00 00 00 e8 7e 13 7b ff 85 c0 0f 84 01 ff ff ff eb a6 48 89 ef 48 89 04 24 e8 48 5b e4 ff 48 8b 04 24 e9 43 ff ff ff <0f> 0b 48 89 ef e8 35 5b e4 ff b8 ea ff ff ff e9 2f ff ff ff e9 78
[ 2.951250] RSP: 0018:ffffaff480b9fc10 EFLAGS: 00010202
[ 2.951251] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
[ 2.951252] RDX: ffff8bcf874c0008 RSI: 0000000000000000 RDI: ffff8bcf874c0300
[ 2.951252] RBP: ffff8bcf8d5d7700 R08: 0000000000000004 R09: ffff8bcf911cb014
[ 2.951253] R10: 0000000000000017 R11: ffffffff8874a580 R12: ffffaff480b9fc68
[ 2.951254] R13: 0000000000000000 R14: ffff8bcf911cb014 R15: ffff8bcf874c0300
[ 2.951255] FS: 00007f715bc30740(0000) GS:ffff8bcf9eb40000(0000) knlGS:0000000000000000
[ 2.951256] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2.951256] CR2: 00007f715bbcca55 CR3: 0000000fd16b8000 CR4: 0000000000340ee0
[ 2.951257] Call Trace:
[ 2.951261] ? _cond_resched+0x15/0x30
[ 2.951264] genl_rcv_msg+0x1bd/0x320
[ 2.951266] ? genl_family_rcv_msg_attrs_parse+0xf0/0xf0
[ 2.951268] netlink_rcv_skb+0x49/0x110
[ 2.951269] genl_rcv+0x24/0x40
[ 2.951271] netlink_unicast+0x191/0x230
[ 2.951272] netlink_sendmsg+0x21e/0x430
[ 2.951275] __sys_sendto+0x1a4/0x1c0
[ 2.951278] __x64_sys_sendto+0x25/0x30
[ 2.951280] do_syscall_64+0x48/0x130
[ 2.951282] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 2.951283] RIP: 0033:0x7f715bd31c7c
[ 2.951284] Code: c0 ff ff ff ff eb bc 0f 1f 80 00 00 00 00 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 21 45 31 c9 45 31 c0 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 6c c3 66 66 2e 0f 1f 84 00 00 00 00 00 55 48
[ 2.951285] RSP: 002b:00007ffe48183bd8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
[ 2.951286] RAX: ffffffffffffffda RBX: 000055bff8539870 RCX: 00007f715bd31c7c
[ 2.951286] RDX: 000000000000001c RSI: 000055bff854da30 RDI: 0000000000000004
[ 2.951287] RBP: 000055bff8544bc0 R08: 0000000000000000 R09: 0000000000000000
[ 2.951287] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe48183c30
[ 2.951288] R13: 00007ffe48183c2c R14: 000055bff8543500 R15: 0000000000000000
[ 2.951289] ---[ end trace 4fa37a5b4f72d39c ]---
Note that I am using Intel wireless cards in both of my systems. This system has the AX200 Intel card, and my other system has an older low-end single-stream 433Mbps 802.11ac chipset (I think the Intel 3165). This system is Gentoo, Ryzen 9 3900x, AMD x570 chipset. The other system is Arch Linux, Ryzen 7 2700x, AMD B350 chipset. Both recently updated to IWD 1.8, which is when I started seeing this.
I have tried to run the current git master branch (currently f7c036a8018213d3b8ce3fe36fdceeb633c00c54), but I can't get iwd to start on that commit (it just exits with a non-zero return. I tried to strace it, and it seems to be having some issue with accessing the kernel keystore, maybe?)
I wanted to report this here so that it would be noticed, and possibly fixed in a future release. I am happy to test patches.
7 months
[PATCH] frame-xchg: add destroy function to start() APIs
by James Prestwood
This makes things more consistent with other IWD APIs as well as
prepares for unifying frame-xchg and scanning.
---
src/frame-xchg.c | 36 ++++++++++++++++++++----------------
src/frame-xchg.h | 6 ++++--
src/p2p.c | 2 +-
3 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/src/frame-xchg.c b/src/frame-xchg.c
index 61399561..a9c1e4c3 100644
--- a/src/frame-xchg.c
+++ b/src/frame-xchg.c
@@ -106,6 +106,7 @@ struct frame_xchg_data {
struct l_timeout *timeout;
struct l_queue *rx_watches;
frame_xchg_cb_t cb;
+ frame_xchg_destroy_func_t destroy;
void *user_data;
uint32_t group_id;
unsigned int retry_cnt;
@@ -770,26 +771,25 @@ static void frame_xchg_reset(struct frame_xchg_data *fx)
frame_xchg_resp_cb, fx);
}
-static void frame_xchg_destroy(struct frame_xchg_data *fx, int err)
+static void frame_xchg_destroy(void *user_data)
{
- if (fx->cb)
- fx->cb(err, fx->user_data);
+ struct frame_xchg_data *fx = user_data;
+
+ if (fx->destroy)
+ fx->destroy(fx->user_data);
frame_xchg_reset(fx);
l_free(fx);
}
-static void frame_xchg_cancel(void *user_data)
-{
- struct frame_xchg_data *fx = user_data;
-
- frame_xchg_destroy(fx, -ECANCELED);
-}
-
static void frame_xchg_done(struct frame_xchg_data *fx, int err)
{
l_queue_remove(frame_xchgs, fx);
- frame_xchg_destroy(fx, err);
+
+ if (fx->cb)
+ fx->cb(err, fx->user_data);
+
+ frame_xchg_destroy(fx);
}
static void frame_xchg_timeout_destroy(void *user_data)
@@ -1073,20 +1073,23 @@ static bool frame_xchg_match(const void *a, const void *b)
void frame_xchg_start(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
unsigned int retry_interval, unsigned int resp_timeout,
unsigned int retries_on_ack, uint32_t group_id,
- frame_xchg_cb_t cb, void *user_data, ...)
+ frame_xchg_cb_t cb, void *user_data,
+ frame_xchg_destroy_func_t destroy, ...)
{
va_list args;
- va_start(args, user_data);
+ va_start(args, destroy);
frame_xchg_startv(wdev_id, frame, freq, retry_interval, resp_timeout,
- retries_on_ack, group_id, cb, user_data, args);
+ retries_on_ack, group_id, cb, user_data,
+ destroy, args);
va_end(args);
}
void frame_xchg_startv(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
unsigned int retry_interval, unsigned int resp_timeout,
unsigned int retries_on_ack, uint32_t group_id,
- frame_xchg_cb_t cb, void *user_data, va_list resp_args)
+ frame_xchg_cb_t cb, void *user_data,
+ frame_xchg_destroy_func_t destroy, va_list resp_args)
{
struct frame_xchg_data *fx;
size_t frame_len;
@@ -1137,6 +1140,7 @@ void frame_xchg_startv(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
fx->resp_timeout = resp_timeout;
fx->retries_on_ack = retries_on_ack;
fx->cb = cb;
+ fx->destroy = destroy;
fx->user_data = user_data;
fx->group_id = group_id;
@@ -1343,7 +1347,7 @@ static void frame_xchg_exit(void)
struct l_queue *xchgs = frame_xchgs;
frame_xchgs = NULL;
- l_queue_destroy(xchgs, frame_xchg_cancel);
+ l_queue_destroy(xchgs, frame_xchg_destroy);
watch_groups = NULL;
l_queue_destroy(groups, frame_watch_group_destroy);
diff --git a/src/frame-xchg.h b/src/frame-xchg.h
index 45b0e5fa..55a55f73 100644
--- a/src/frame-xchg.h
+++ b/src/frame-xchg.h
@@ -46,9 +46,11 @@ bool frame_watch_wdev_remove(uint64_t wdev_id);
void frame_xchg_start(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
unsigned int retry_interval, unsigned int resp_timeout,
unsigned int retries_on_ack, uint32_t group_id,
- frame_xchg_cb_t cb, void *user_data, ...);
+ frame_xchg_cb_t cb, void *user_data,
+ frame_xchg_destroy_func_t destroy, ...);
void frame_xchg_startv(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
unsigned int retry_interval, unsigned int resp_timeout,
unsigned int retries_on_ack, uint32_t group_id,
- frame_xchg_cb_t cb, void *user_data, va_list resp_args);
+ frame_xchg_cb_t cb, void *user_data,
+ frame_xchg_destroy_func_t destroy, va_list resp_args);
void frame_xchg_stop(uint64_t wdev_id);
diff --git a/src/p2p.c b/src/p2p.c
index a759df5c..1c9cb081 100644
--- a/src/p2p.c
+++ b/src/p2p.c
@@ -460,7 +460,7 @@ static void p2p_peer_frame_xchg(struct p2p_peer *peer, struct iovec *tx_body,
va_start(args, cb);
frame_xchg_startv(dev->wdev_id, frame, freq, retry_interval,
resp_timeout, retries_on_ack, group_id,
- cb, dev, args);
+ cb, dev, NULL, args);
va_end(args);
l_free(frame);
--
2.21.1
7 months
Re: Fw: Failed to load trusted user certificate
by Andrew Zaborowski
Hi Martin,
On Sat, 20 Jun 2020 at 14:51, Martin Tesar <martin.tesar(a)yourwifi.cz> wrote:
> it looks like the IWD is not able to load trusted user certificates.
> Basically if the certificate is enclosed in
>
> -----BEGIN TRUSTED CERTIFICATE-----
> -----END TRUSTED CERTIFICATE-----
>
> I'm always getting an error "Failed to load".
Right, we've seen this feature request somewhere recently and thought
that it may be easy to support this format in IWD.
Do you happen to know where this format is specified?
Best regards
7 months
[RFC 1/6] frame-xchg: add destroy function to start() APIs
by James Prestwood
This makes things more consistent with other IWD APIs as well as
prepares for unifying frame-xchg and scanning.
---
src/frame-xchg.c | 36 ++++++++++++++++++++----------------
src/frame-xchg.h | 6 ++++--
2 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/src/frame-xchg.c b/src/frame-xchg.c
index 7e516d0a..1473e59e 100644
--- a/src/frame-xchg.c
+++ b/src/frame-xchg.c
@@ -106,6 +106,7 @@ struct frame_xchg_data {
struct l_timeout *timeout;
struct l_queue *rx_watches;
frame_xchg_cb_t cb;
+ frame_xchg_destroy_func_t destroy;
void *user_data;
uint32_t group_id;
unsigned int retry_cnt;
@@ -770,26 +771,25 @@ static void frame_xchg_reset(struct frame_xchg_data *fx)
frame_xchg_resp_cb, fx);
}
-static void frame_xchg_destroy(struct frame_xchg_data *fx, int err)
+static void frame_xchg_destroy(void *user_data)
{
- if (fx->cb)
- fx->cb(err, fx->user_data);
+ struct frame_xchg_data *fx = user_data;
+
+ if (fx->destroy)
+ fx->destroy(fx->user_data);
frame_xchg_reset(fx);
l_free(fx);
}
-static void frame_xchg_cancel(void *user_data)
-{
- struct frame_xchg_data *fx = user_data;
-
- frame_xchg_destroy(fx, -ECANCELED);
-}
-
static void frame_xchg_done(struct frame_xchg_data *fx, int err)
{
l_queue_remove(frame_xchgs, fx);
- frame_xchg_destroy(fx, err);
+
+ if (fx->cb)
+ fx->cb(err, fx->user_data);
+
+ frame_xchg_destroy(fx);
}
static void frame_xchg_timeout_destroy(void *user_data)
@@ -1073,20 +1073,23 @@ static bool frame_xchg_match(const void *a, const void *b)
void frame_xchg_start(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
unsigned int retry_interval, unsigned int resp_timeout,
unsigned int retries_on_ack, uint32_t group_id,
- frame_xchg_cb_t cb, void *user_data, ...)
+ frame_xchg_cb_t cb, void *user_data,
+ frame_xchg_destroy_func_t destroy, ...)
{
va_list args;
- va_start(args, user_data);
+ va_start(args, destroy);
frame_xchg_startv(wdev_id, frame, freq, retry_interval, resp_timeout,
- retries_on_ack, group_id, cb, user_data, args);
+ retries_on_ack, group_id, cb, user_data,
+ destroy, args);
va_end(args);
}
void frame_xchg_startv(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
unsigned int retry_interval, unsigned int resp_timeout,
unsigned int retries_on_ack, uint32_t group_id,
- frame_xchg_cb_t cb, void *user_data, va_list resp_args)
+ frame_xchg_cb_t cb, void *user_data,
+ frame_xchg_destroy_func_t destroy, va_list resp_args)
{
struct frame_xchg_data *fx;
size_t frame_len;
@@ -1132,6 +1135,7 @@ void frame_xchg_startv(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
fx->resp_timeout = resp_timeout;
fx->retries_on_ack = retries_on_ack;
fx->cb = cb;
+ fx->destroy = destroy;
fx->user_data = user_data;
fx->group_id = group_id;
@@ -1338,7 +1342,7 @@ static void frame_xchg_exit(void)
struct l_queue *xchgs = frame_xchgs;
frame_xchgs = NULL;
- l_queue_destroy(xchgs, frame_xchg_cancel);
+ l_queue_destroy(xchgs, frame_xchg_destroy);
watch_groups = NULL;
l_queue_destroy(groups, frame_watch_group_destroy);
diff --git a/src/frame-xchg.h b/src/frame-xchg.h
index 45b0e5fa..55a55f73 100644
--- a/src/frame-xchg.h
+++ b/src/frame-xchg.h
@@ -46,9 +46,11 @@ bool frame_watch_wdev_remove(uint64_t wdev_id);
void frame_xchg_start(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
unsigned int retry_interval, unsigned int resp_timeout,
unsigned int retries_on_ack, uint32_t group_id,
- frame_xchg_cb_t cb, void *user_data, ...);
+ frame_xchg_cb_t cb, void *user_data,
+ frame_xchg_destroy_func_t destroy, ...);
void frame_xchg_startv(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
unsigned int retry_interval, unsigned int resp_timeout,
unsigned int retries_on_ack, uint32_t group_id,
- frame_xchg_cb_t cb, void *user_data, va_list resp_args);
+ frame_xchg_cb_t cb, void *user_data,
+ frame_xchg_destroy_func_t destroy, va_list resp_args);
void frame_xchg_stop(uint64_t wdev_id);
--
2.21.1
7 months
[PATCH v2] test-runner: use WNOHANG option waiting for PID
by James Prestwood
If an application has a bug and hangs on SIGTERM this causes
test-runner to hang as well. This is obviously an issue with
the application in question, but test-runner should have a way
of continuing onto the next test rather than hanging.
Instead we can use WNOHANG and a sleep to allow applications
some amount of time to exit, and if they haven't use SIGKILL
instead as well as print an error. Similar to how
wait_for_socket works. The timeout is hard coded to 2 seconds
(100ms sleep + 20 iterations).
---
tools/test-runner.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
v2:
- Removed extra check for i >= 20 since that is always going to be
true if we get past the while loop
- Added another waitpid after SIGKILL
diff --git a/tools/test-runner.c b/tools/test-runner.c
index f8677be5..83d5194d 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -626,14 +626,24 @@ exit:
static void kill_process(pid_t pid)
{
int status;
+ int i = 0;
l_debug("Terminate pid: %d", pid);
kill(pid, SIGTERM);
do {
- waitpid(pid, &status, 0);
- } while (!WIFEXITED(status) && !WIFSIGNALED(status));
+ if (waitpid(pid, &status, WNOHANG) == pid)
+ return;
+
+ usleep(100000);
+ } while (!WIFEXITED(status) && !WIFSIGNALED(status) && i++ < 20);
+
+ l_error("Failed to kill process %d gracefully", pid);
+ kill(pid, SIGKILL);
+
+ /* SIGKILL shouldn't need WNOHANG */
+ waitpid(pid, &status, 0);
}
static bool wait_for_socket(const char *socket, useconds_t wait_time)
--
2.21.1
7 months
[PATCH] frame-xchg: fix incorrect length check
by James Prestwood
frame_xchg_startv was using sizeof(mmpdu) to check the minimum length
for a frame. Instead mmpdu_header_len should be used since this checks
fc.order and returns either 24 or 28 bytes, not 28 bytes always.
This change adds the requirement that the first iovec in the array
must contain at least the first 2 bytes (mmpdu_fc) of the header.
This really shouldn't be a problem since all current users of
frame-xchg put the entire header (or entire frame) into the first
iovec in the array.
---
src/frame-xchg.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/frame-xchg.c b/src/frame-xchg.c
index dd60e080..3744a4c1 100644
--- a/src/frame-xchg.c
+++ b/src/frame-xchg.c
@@ -1090,12 +1090,17 @@ uint32_t frame_xchg_startv(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
size_t frame_len;
struct iovec *iov;
uint8_t *ptr;
- struct mmpdu_header *mpdu;
for (frame_len = 0, iov = frame; iov->iov_base; iov++)
frame_len += iov->iov_len;
- if (frame_len < sizeof(*mpdu)) {
+ /*
+ * This assumes that the first iovec at least contains the mmpdu_fc
+ * portion of the header used to calculate the minimum length.
+ */
+ if (frame[0].iov_len >= 2 && frame_len <
+ mmpdu_header_len((const struct mmpdu_header *)
+ frame[0].iov_base)) {
l_error("Frame too short");
cb(-EMSGSIZE, user_data);
return 0;
--
2.21.1
7 months
[PATCH] src/p2p.c: fix build with uclibc
by Fabrice Fontaine
explicit_bzero is used in src/p2p.c since commit
1675c765a3d66f3c626a1581a7bf514e1859b064 but src/missing.h is not
included, as a result build with uclibc fails on:
/home/naourr/work/instance-0/output-1/per-package/iwd/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-uclibc/5.5.0/../../../../mips64el-buildroot-linux-uclibc/bin/ld: src/p2p.o: in function `p2p_connection_reset':
p2p.c:(.text+0x2cf4): undefined reference to `explicit_bzero'
/home/naourr/work/instance-0/output-1/per-package/iwd/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-uclibc/5.5.0/../../../../mips64el-buildroot-linux-uclibc/bin/ld: p2p.c:(.text+0x2cfc): undefined reference to `explicit_bzero'
Fixes:
- http://autobuild.buildroot.org/results/8bbf7e1d0929d0883c0c2445990f62f5a1...
Signed-off-by: Fabrice Fontaine <fontaine.fabrice(a)gmail.com>
---
src/p2p.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/p2p.c b/src/p2p.c
index dc78b887..a759df5c 100644
--- a/src/p2p.c
+++ b/src/p2p.c
@@ -37,6 +37,7 @@
#include "linux/nl80211.h"
+#include "src/missing.h"
#include "src/iwd.h"
#include "src/wiphy.h"
#include "src/scan.h"
--
2.26.2
7 months
[PATCH] plugins: ofono: remove newline from debug print
by James Prestwood
---
plugins/ofono.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 6f2acda0..186dac71 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -427,7 +427,7 @@ static void modem_destroy(void *data)
iwd_sim_auth_remove(modem->auth);
}
- l_debug("removing modem %s\n", modem->path);
+ l_debug("removing modem %s", modem->path);
if (modem->apps_serial)
l_dbus_cancel(dbus, modem->apps_serial);
--
2.21.1
7 months