Skip to content

Commit

Permalink
net: l2: ieee802154: fix deadlock
Browse files Browse the repository at this point in the history
When an incoming PAN ID does not match or when an error occurs while
sending association requests, then locks were not properly released.

Fixes #78717
Fixes #78495

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit 041d8c7)
  • Loading branch information
fgrandel committed Sep 23, 2024
1 parent ed1db96 commit d23d16a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/net/l2/ieee802154/ieee802154.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static bool ieeee802154_check_dst_addr(struct net_if *iface, struct ieee802154_m
if (!(dst_plain->pan_id == IEEE802154_BROADCAST_PAN_ID ||
dst_plain->pan_id == sys_cpu_to_le16(ctx->pan_id))) {
LOG_DBG("Frame PAN ID does not match!");
return false;
goto out;
}

if (mhr->fs->fc.dst_addr_mode == IEEE802154_ADDR_MODE_SHORT) {
Expand Down
1 change: 1 addition & 0 deletions subsys/net/l2/ieee802154/ieee802154_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ static int ieee802154_associate(uint32_t mgmt_request, struct net_if *iface,
if (ieee802154_radio_send(iface, pkt, pkt->buffer)) {
net_pkt_unref(pkt);
ret = -EIO;
k_sem_give(&ctx->scan_ctx_lock);
goto out;
}

Expand Down

0 comments on commit d23d16a

Please sign in to comment.