jerpelea opened a new pull request, #21263:
URL: https://github.com/apache/nuttx/pull/21263

   ## Summary
   
   In full-duplex forwarding / NAT scenarios between two network devices (e.g. 
wlan0 and wlan1 in SoftAP + Station mode), both netdev RX worker threads could 
deadlock (ABBA):
   - Thread netdev-wlan0 holds netdev_lock(wlan0) during RX poll. When 
forwarding a packet to wlan1, it invokes netdev_txnotify_dev(wlan1), which 
calls wlan1->d_txavail(). netdev_upper_txavail() was directly calling 
netdev_upper_txavail_work(), which synchronously acquires netdev_lock(wlan1).
   - Concurrently, thread netdev-wlan1 holds netdev_lock(wlan1) during RX poll 
and forwards a packet to wlan0, trying to synchronously acquire 
netdev_lock(wlan0).
   
   This resulted in a cross-deadlock where both RX workers waited indefinitely 
on each other's device lock.
   
   Fix this by checking upper->lower->rxtype in netdev_upper_txavail(). If 
rxtype is not NETDEV_RX_DIRECT, delegate via netdev_upper_queue_work(dev) to 
wake the target device's worker thread asynchronously without holding peer 
device locks synchronously.
   
   Fixes: #20619
   
   ## Impact
   
   RELEASE
   
   ## Testing
   
   CI


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to