Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
* [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected
@ 2026-11-29 13:03 leegun25
  2026-11-29 13:03 ` [PATCH net v2 2/2] mac802154: fix locking for association response TX leegun25
  2026-11-30 14:03 ` [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected netdev-bot+sashiko
  0 siblings, 2 replies; 4+ messages in thread
From: leegun25 @ 2026-11-29 13:03 UTC (permalink / raw)
  To: miquel.raynal, alex.aring, stefan; +Cc: linux-wpan, netdev

>From 0fb563b521939707808b720d3e5801b3370c97f2 Mon Sep 17 00:00:00 2001
From: Lee Keon-Hyeong <leegun25@proton.me>
Date: Fri, 27 Nov 2026 11:42:37 +0900
Subject: [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected

ieee802154_mlme_tx_locked() returns -ENETDOWN on two paths before
passing the skb to ieee802154_tx(). Its callers expect it to consume
the skb, so both paths leak it. Free the skb before returning.

I found this during an LLM-assisted review of the MLME TX error
paths. An earlier review of beacon TX also noted the leak.

The association tests exercised only successful transmissions. I did
not test either error path or run the in-tree selftests.

Link: https://lore.kernel.org/linux-wpan/179370015236.488856.9062135405491525675@kernel.org/
Fixes: ddd9ee7cda12 ("net: mac802154: Introduce a synchronous API for MLME commands")
Fixes: 4f790184139b ("net: mac802154: Add a warning in the slow path")
Signed-off-by: Lee Keon-Hyeong <leegun25@proton.me>
---
 net/mac802154/tx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index 4d13f18f6..af5003b93 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -147,14 +147,18 @@ int ieee802154_mlme_tx_locked(struct ieee802154_local *local,
 	ASSERT_RTNL();
 
 	/* Ensure the device was not stopped, otherwise error out */
-	if (!local->open_count)
+	if (!local->open_count) {
+		kfree_skb(skb);
 		return -ENETDOWN;
+	}
 
 	/* Warn if the ieee802154 core thinks MLME frames can be sent while the
 	 * net interface expects this cannot happen.
 	 */
-	if (WARN_ON_ONCE(!netif_running(sdata->dev)))
+	if (WARN_ON_ONCE(!netif_running(sdata->dev))) {
+		kfree_skb(skb);
 		return -ENETDOWN;
+	}
 
 	ieee802154_tx(local, skb);
 	return ieee802154_sync_queue(local);
-- 
2.56.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net v2 2/2] mac802154: fix locking for association response TX
  2026-11-29 13:03 [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected leegun25
@ 2026-11-29 13:03 ` leegun25
  2026-11-30 14:04   ` netdev-bot+sashiko
  2026-11-30 14:03 ` [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected netdev-bot+sashiko
  1 sibling, 1 reply; 4+ messages in thread
From: leegun25 @ 2026-11-29 13:03 UTC (permalink / raw)
  To: miquel.raynal, alex.aring, stefan; +Cc: linux-wpan, netdev

>From c5f32daa0f9e2322ad7ff5f098946d4364e8bb65 Mon Sep 17 00:00:00 2001
From: Lee Keon-Hyeong <leegun25@proton.me>
Date: Fri, 27 Nov 2026 11:42:51 +0900
Subject: [PATCH net v2 2/2] mac802154: fix locking for association response TX

The association response worker calls ieee802154_mlme_tx_locked()
without holding RTNL. I found this during an LLM-assisted review
and confirmed the RTNL warning with mac802154_hwsim.

Taking RTNL in the worker causes association between two PHYs on the
same host to time out because the initiator holds RTNL while waiting
for the response.

Use a per-PHY mutex to serialize MLME TX with interface open and
close. Hold the mutex from the interface state check until TX
completes. This lets the worker send the response without taking
RTNL. The close path can still wait for TX to complete while
holding RTNL.

On v7.4-rc3 with CONFIG_PROVE_LOCKING=y, two mac802154_hwsim PHYs
on the same host associated, disassociated and associated again
without an RTNL warning. With a one-second delay added to TX, I
brought the interface down during an MLME transmission. The
transmission completed before the device stopped. I did not run the
in-tree selftests.

Fixes: 601f160b61b2 ("mac802154: Handle association requests from peers")
Signed-off-by: Lee Keon-Hyeong <leegun25@proton.me>
---
v2: Use a per-PHY mutex instead of taking RTNL in the response worker.
    Split the skb leak fix into a separate patch.
v1: https://lore.kernel.org/netdev/20261121150835.256812-1-leegun25@proton.me/

 net/mac802154/ieee802154_i.h |  9 ++++++---
 net/mac802154/iface.c        | 10 +++++++++-
 net/mac802154/main.c         |  2 ++
 net/mac802154/scan.c         |  2 +-
 net/mac802154/tx.c           | 37 +++++++++++++++++-------------------
 5 files changed, 35 insertions(+), 25 deletions(-)

diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
index 992ce6698..ba3cb1388 100644
--- a/net/mac802154/ieee802154_i.h
+++ b/net/mac802154/ieee802154_i.h
@@ -39,6 +39,9 @@ struct ieee802154_local {
 
 	int open_count;
 
+	/* Serialize MLME TX with interface open and close. */
+	struct mutex hw_mutex;
+
 	/* As in mac80211 slaves list is modified:
 	 * 1) under the RTNL
 	 * 2) protected by slaves_mtx;
@@ -196,12 +199,12 @@ void ieee802154_rx(struct ieee802154_local *local, struct sk_buff *skb);
 void ieee802154_xmit_sync_worker(struct work_struct *work);
 int ieee802154_sync_and_hold_queue(struct ieee802154_local *local);
 int ieee802154_mlme_op_pre(struct ieee802154_local *local);
+int ieee802154_mlme_tx_hw(struct ieee802154_local *local,
+			  struct ieee802154_sub_if_data *sdata,
+			  struct sk_buff *skb);
 int ieee802154_mlme_tx(struct ieee802154_local *local,
 		       struct ieee802154_sub_if_data *sdata,
 		       struct sk_buff *skb);
-int ieee802154_mlme_tx_locked(struct ieee802154_local *local,
-			      struct ieee802154_sub_if_data *sdata,
-			      struct sk_buff *skb);
 void ieee802154_mlme_op_post(struct ieee802154_local *local);
 int ieee802154_mlme_tx_one_locked(struct ieee802154_local *local,
 				  struct ieee802154_sub_if_data *sdata,
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index 31353795f..d84e7a99a 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -186,6 +186,8 @@ static int mac802154_slave_open(struct net_device *dev)
 
 	ASSERT_RTNL();
 
+	mutex_lock(&local->hw_mutex);
+
 	set_bit(SDATA_STATE_RUNNING, &sdata->state);
 
 	if (!local->open_count) {
@@ -200,11 +202,13 @@ static int mac802154_slave_open(struct net_device *dev)
 	}
 
 	local->open_count++;
+	mutex_unlock(&local->hw_mutex);
 	netif_start_queue(dev);
 	return 0;
 err:
 	/* might already be clear but that doesn't matter */
 	clear_bit(SDATA_STATE_RUNNING, &sdata->state);
+	mutex_unlock(&local->hw_mutex);
 
 	return res;
 }
@@ -309,13 +313,17 @@ static int mac802154_slave_close(struct net_device *dev)
 		mac802154_stop_beacons_locked(local, sdata);
 
 	netif_stop_queue(dev);
-	local->open_count--;
 
+	mutex_lock(&local->hw_mutex);
+
+	local->open_count--;
 	clear_bit(SDATA_STATE_RUNNING, &sdata->state);
 
 	if (!local->open_count)
 		ieee802154_stop_device(local);
 
+	mutex_unlock(&local->hw_mutex);
+
 	return 0;
 }
 
diff --git a/net/mac802154/main.c b/net/mac802154/main.c
index 8ed6de111..61d075922 100644
--- a/net/mac802154/main.c
+++ b/net/mac802154/main.c
@@ -93,6 +93,7 @@ ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops)
 	INIT_LIST_HEAD(&local->rx_mac_cmd_list);
 	spin_lock_init(&local->rx_lock);
 	mutex_init(&local->iflist_mtx);
+	mutex_init(&local->hw_mutex);
 
 	tasklet_setup(&local->tasklet, ieee802154_tasklet_handler);
 
@@ -177,6 +178,7 @@ void ieee802154_free_hw(struct ieee802154_hw *hw)
 	BUG_ON(!list_empty(&local->interfaces));
 
 	mutex_destroy(&local->iflist_mtx);
+	mutex_destroy(&local->hw_mutex);
 
 	wpan_phy_free(local->phy);
 }
diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c
index d393b1f4e..d15ba5d96 100644
--- a/net/mac802154/scan.c
+++ b/net/mac802154/scan.c
@@ -779,7 +779,7 @@ mac802154_send_association_resp_locked(struct ieee802154_sub_if_data *sdata,
 		return ret;
 	}
 
-	ret = ieee802154_mlme_tx_locked(local, sdata, skb);
+	ret = ieee802154_mlme_tx_hw(local, sdata, skb);
 	if (ret) {
 		dev_warn(&sdata->dev->dev,
 			 "No ASSOC RESP ACK received from %8phC\n", &teaddr);
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index af5003b93..baff40bac 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -137,31 +137,26 @@ int ieee802154_mlme_op_pre(struct ieee802154_local *local)
 	return ieee802154_sync_and_hold_queue(local);
 }
 
-int ieee802154_mlme_tx_locked(struct ieee802154_local *local,
-			      struct ieee802154_sub_if_data *sdata,
-			      struct sk_buff *skb)
+int ieee802154_mlme_tx_hw(struct ieee802154_local *local,
+			  struct ieee802154_sub_if_data *sdata,
+			  struct sk_buff *skb)
 {
-	/* Avoid possible calls to ->ndo_stop() when we asynchronously perform
-	 * MLME transmissions.
-	 */
-	ASSERT_RTNL();
+	int ret;
 
-	/* Ensure the device was not stopped, otherwise error out */
-	if (!local->open_count) {
-		kfree_skb(skb);
-		return -ENETDOWN;
-	}
+	mutex_lock(&local->hw_mutex);
 
-	/* Warn if the ieee802154 core thinks MLME frames can be sent while the
-	 * net interface expects this cannot happen.
-	 */
-	if (WARN_ON_ONCE(!netif_running(sdata->dev))) {
+	if (!local->open_count || !ieee802154_sdata_running(sdata)) {
 		kfree_skb(skb);
-		return -ENETDOWN;
+		ret = -ENETDOWN;
+		goto out;
 	}
 
 	ieee802154_tx(local, skb);
-	return ieee802154_sync_queue(local);
+	ret = ieee802154_sync_queue(local);
+
+out:
+	mutex_unlock(&local->hw_mutex);
+	return ret;
 }
 
 int ieee802154_mlme_tx(struct ieee802154_local *local,
@@ -171,7 +166,7 @@ int ieee802154_mlme_tx(struct ieee802154_local *local,
 	int ret;
 
 	rtnl_lock();
-	ret = ieee802154_mlme_tx_locked(local, sdata, skb);
+	ret = ieee802154_mlme_tx_hw(local, sdata, skb);
 	rtnl_unlock();
 
 	return ret;
@@ -188,8 +183,10 @@ int ieee802154_mlme_tx_one_locked(struct ieee802154_local *local,
 {
 	int ret;
 
+	ASSERT_RTNL();
+
 	ieee802154_mlme_op_pre(local);
-	ret = ieee802154_mlme_tx_locked(local, sdata, skb);
+	ret = ieee802154_mlme_tx_hw(local, sdata, skb);
 	ieee802154_mlme_op_post(local);
 
 	return ret;
-- 
2.56.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected
  2026-11-29 13:03 [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected leegun25
  2026-11-29 13:03 ` [PATCH net v2 2/2] mac802154: fix locking for association response TX leegun25
@ 2026-11-30 14:03 ` netdev-bot+sashiko
  1 sibling, 0 replies; 4+ messages in thread
From: netdev-bot+sashiko @ 2026-11-30 14:03 UTC (permalink / raw)
  To: leegun25; +Cc: miquel.raynal, alex.aring, stefan, linux-wpan, netdev, kuba

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] This commit was applied with its mbox headers left in.

--

mac802154: free the skb when MLME TX is rejected

This commit makes ieee802154_mlme_tx_locked() free the skb on its two
early -ENETDOWN return paths. Callers expect the function to consume the
skb, so it was leaked on both paths before this change.

Link: https://lore.kernel.org/linux-wpan/179370015236.488856.9062135405491525675@kernel.org/

> mac802154: free the skb when MLME TX is rejected
>
> >>From 0fb563b521939707808b720d3e5801b3370c97f2 Mon Sep 17 00:00:00 2001
> From: Lee Keon-Hyeong <leegun25@proton.me>
> Date: Fri, 27 Nov 2026 11:42:37 +0900
> Subject: [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected

[Severity: Low]
This isn't a bug, but it looks like the mbox headers were left in when the
patch was applied. The commit body still begins with the escaped ">>From"
separator, then the in-body From:, Date: and Subject: lines.

Because the ">>From" line comes first, the in-body From: was not parsed.
The recorded author is the bare address:

  Author: leegun25@proton.me <leegun25@proton.me>

That doesn't match the trailer:

  Signed-off-by: Lee Keon-Hyeong <leegun25@proton.me>

Could these header lines be stripped, and the author reset to
"Lee Keon-Hyeong <leegun25@proton.me>", before the patch is applied?
checkpatch reports this as a From:/Signed-off-by: mismatch.

The companion patch, "mac802154: fix locking for association response
TX", appears to have the same problem.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/179595738440.2351517.6900122072700162037%40proton.me

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2 2/2] mac802154: fix locking for association response TX
  2026-11-29 13:03 ` [PATCH net v2 2/2] mac802154: fix locking for association response TX leegun25
@ 2026-11-30 14:04   ` netdev-bot+sashiko
  0 siblings, 0 replies; 4+ messages in thread
From: netdev-bot+sashiko @ 2026-11-30 14:04 UTC (permalink / raw)
  To: leegun25; +Cc: miquel.raynal, alex.aring, stefan, linux-wpan, netdev, kuba

Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 1 · Low: 2

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] mac802154: unsynchronized TX and stop paths in
  ieee802154_mlme_tx_hw()
- [Medium] The new local->hw_mutex replaces the RTNL requirement that
  ieee802154_mlme_tx_locked() used to assert.
- [Low] The patch makes several behaviour and naming changes that the
  commit message does not mention: - In ieee802154_mlme_tx_hw() it drops…
- [Low] The commit was created from a mangled mbox.

--

mac802154: fix locking for association response TX

This patch adds a per-PHY hw_mutex that serializes MLME TX with interface
open and close, so the association response worker no longer needs RTNL.
ieee802154_mlme_tx_locked() is renamed to ieee802154_mlme_tx_hw(). The new
function holds hw_mutex from the interface state check until TX completes.

> mac802154: fix locking for association response TX
>
> >>From c5f32daa0f9e2322ad7ff5f098946d4364e8bb65 Mon Sep 17 00:00:00 2001
> From: Lee Keon-Hyeong <leegun25@proton.me>
> Date: Fri, 27 Nov 2026 11:42:51 +0900
> Subject: [PATCH net v2 2/2] mac802154: fix locking for association response TX

[Severity: Low]
This isn't a bug, but it looks like the patch was applied from a mangled
mbox. The format-patch headers ended up in the commit message body. Because
the ">>From" line comes first, the in-body From: was not picked up.

As a result, the git author is "leegun25@proton.me <leegun25@proton.me>"
with no real name, which doesn't match the Signed-off-by name "Lee
Keon-Hyeong". The author date is also the apply time rather than the date
of the patch.

The sibling commit "mac802154: free the skb when MLME TX is rejected" seems
to have the same problem. Could these be resubmitted with git send-email,
or fixed up when applied?

> diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
> index af5003b931bb0..baff40bac4427 100644
> --- a/net/mac802154/tx.c
> +++ b/net/mac802154/tx.c
> @@ -137,31 +137,26 @@ int ieee802154_mlme_op_pre(struct ieee802154_local *local)
>  	return ieee802154_sync_and_hold_queue(local);
>  }
>  
> -int ieee802154_mlme_tx_locked(struct ieee802154_local *local,
> -			      struct ieee802154_sub_if_data *sdata,
> -			      struct sk_buff *skb)
> +int ieee802154_mlme_tx_hw(struct ieee802154_local *local,
> +			  struct ieee802154_sub_if_data *sdata,
> +			  struct sk_buff *skb)
>  {
> -	/* Avoid possible calls to ->ndo_stop() when we asynchronously perform
> -	 * MLME transmissions.
> -	 */
> -	ASSERT_RTNL();
> +	int ret;
>  
> -	/* Ensure the device was not stopped, otherwise error out */
> -	if (!local->open_count) {
> -		kfree_skb(skb);
> -		return -ENETDOWN;
> -	}
> +	mutex_lock(&local->hw_mutex);
>  
> -	/* Warn if the ieee802154 core thinks MLME frames can be sent while the
> -	 * net interface expects this cannot happen.
> -	 */
> -	if (WARN_ON_ONCE(!netif_running(sdata->dev))) {
> +	if (!local->open_count || !ieee802154_sdata_running(sdata)) {

[Severity: High]
Does hw_mutex serialize this transmission against normal data TX?

mac802154_send_association_resp_locked() calls ieee802154_mlme_tx_hw()
directly. It does not use the ieee802154_mlme_op_pre() and
ieee802154_mlme_op_post() pair that ieee802154_mlme_tx_one_locked()
uses. Inside ieee802154_mlme_tx_hw(), ieee802154_tx() runs first.
ieee802154_sync_queue() only waits for ongoing_txs afterwards.

Data frames reach the driver without taking hw_mutex:

ieee802154_subif_start_xmit()
  ieee802154_hot_tx()
    ieee802154_tx()

ieee802154_tx() stops the netdev queues while a frame is in flight.
The MLME path calls ieee802154_tx() directly and ignores the queue
state. If a data frame is still in flight when an ASSOC REQ arrives,
the rx_mac_cmd worker hands a second frame to the driver. The core and
the transceiver drivers only expect one in-flight frame per PHY.

With xmit_sync drivers such as adf7242 or cc2520, the second call
overwrites local->tx_skb and leaks the first skb. It also raises
phy->ongoing_txs to 2. If sync_tx_work is still pending, queue_work()
is a no-op and only one completion follows. With xmit_async drivers
such as atusb, drv_xmit_async() overwrites atusb->tx_skb and resubmits
tx_urb while it is still active.

Once ongoing_txs is stuck above zero, the worker sleeps forever in the
wait_event() in ieee802154_sync_queue(). It does so while holding
hw_mutex and wpan_dev->association_lock. The next
mac802154_slave_close() would then block on hw_mutex with RTNL held.

The direct call without op_pre predates this patch. However, the
commit message says hw_mutex serializes MLME TX, and this path now
runs without RTNL by design. Should the response path also drain and
hold the queue? One option is to call ieee802154_mlme_op_pre() and
ieee802154_mlme_op_post() from mac802154_send_association_resp_locked().
Another is to do it inside ieee802154_mlme_tx_hw() under hw_mutex.

ieee802154_mlme_tx_one_locked() and mac802154_trigger_scan_locked()
also run ieee802154_mlme_op_pre() outside hw_mutex. The suspend and
scan cleanup paths also stop the device without taking it. Given that,
it isn't clear which TX and device state hw_mutex is meant to protect.
Could the commit message spell that out?

[Severity: Low]
This isn't a bug, but the commit message doesn't mention several of the
changes here:

- the WARN_ON_ONCE(!netif_running(sdata->dev)) diagnostic is dropped, so
  the function now returns -ENETDOWN silently
- the netif_running() check is replaced with SDATA_STATE_RUNNING
- ieee802154_mlme_tx_locked() is renamed to ieee802154_mlme_tx_hw()
- ieee802154_mlme_tx_one_locked() gains a new ASSERT_RTNL()

Dropping the WARN looks justified. __dev_close_many() clears
__LINK_STATE_START before ndo_stop, and the worker can now race with close.
Could the commit message say so?

Also, mac802154_send_association_resp_locked() keeps its _locked suffix. In
scan.c and tx.c that suffix means RTNL is held, but this function now runs
without RTNL by design. Would renaming it avoid misleading future readers?

>  		kfree_skb(skb);
> -		return -ENETDOWN;
> +		ret = -ENETDOWN;
> +		goto out;
>  	}
>  
>  	ieee802154_tx(local, skb);
> -	return ieee802154_sync_queue(local);
> +	ret = ieee802154_sync_queue(local);

[Severity: Medium]
Does hw_mutex cover every path that ASSERT_RTNL() used to exclude here?

Only mac802154_slave_open() and mac802154_slave_close() take hw_mutex.
Other paths stop and restart the transceiver with only RTNL held.
wpan_phy_suspend() takes rtnl_lock() and then calls ieee802154_suspend():

net/mac802154/cfg.c:ieee802154_suspend() {
    ...
	ieee802154_sync_and_hold_queue(local);
	synchronize_net();

	/* stop hardware - this must stop RX */
	ieee802154_stop_device(local);

suspend:
	local->suspended = true;
    ...
}

ieee802154_resume() also calls drv_start() with only RTNL held. So does
mac802154_scan_cleanup_locked(), which is reached from
mac802154_abort_scan_locked() via the abort-scan op or via slave_close:

net/mac802154/scan.c:mac802154_scan_cleanup_locked() {
    ...
	drv_stop(local);
	synchronize_net();
	sdata->required_filtering = sdata->iface_default_filtering;
	drv_start(local, sdata->required_filtering, &local->addr_filt);
    ...
}

Suspend leaves open_count and SDATA_STATE_RUNNING unchanged. The new check
also doesn't look at local->suspended, although mac802154_beacon_worker()
and mac802154_scan_worker() both check it. local->mac_wq is not freezable.

Could an ASSOC REQ from a remote peer, handled by the rx_mac_cmd worker,
then reach the driver while the transceiver is stopped?

mac802154_rx_mac_cmd_worker()
  mac802154_process_association_req()
    mac802154_send_association_resp_locked()
      ieee802154_mlme_tx_hw()
        ieee802154_tx()
          drv_xmit_async()

On mac802154_hwsim this would hit WARN_ON(current_phy->suspended) in
hwsim_hw_xmit(), because hwsim_hw_stop() sets suspended to true.

Some drivers drop the completion once stopped. With those, ongoing_txs
never returns to zero. The worker would then sleep forever in the
wait_event() in ieee802154_sync_queue() while holding hw_mutex and
wpan_dev->association_lock.

Would the next mac802154_slave_close() then block in
mutex_lock(&local->hw_mutex) with RTNL held?

The header comment above mac802154_scan_cleanup_locked() states:

    Concurrent modifications to the PHY, the interfaces or the hardware is in
    general prevented by the rtnl.

The commit message doesn't mention suspend/resume or scan abort. RTNL
excluded the scan cleanup window and a suspend in progress. Sending after a
completed suspend without checking local->suspended was already possible
before this patch.

> +
> +out:
> +	mutex_unlock(&local->hw_mutex);
> +	return ret;
>  }

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/179595738440.2351517.6900122072700162037%40proton.me

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-30 14:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 13:03 [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected leegun25
2026-11-29 13:03 ` [PATCH net v2 2/2] mac802154: fix locking for association response TX leegun25
2026-11-30 14:04   ` netdev-bot+sashiko
2026-11-30 14:03 ` [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox