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

   
   ## Summary
   
   devif_poll_bluetooth_connections() ran the Bluetooth socket poll for every 
network device it was called for, and bluetooth_poll() casts the struct 
net_driver_s it is handed to struct radio_driver_s and writes through it.  On a 
system with an open PF_BLUETOOTH socket and any non-Bluetooth device - PPP or 
Ethernet, say - the poll wrote through fields that the device's allocation does 
not contain.
   
   Skip devices whose link type is not NET_LL_BLUETOOTH.
   
   This restores the guard proposed in PR #18989, which was closed without 
being merged; the approach is that PR author's.
   
   Testing: builds for sim:bluetooth with Make; every commit in this series 
verified to build individually.  The mixed-device configuration that exercises 
the guard is not covered by the in-tree simulator configurations and is 
untested here.
   
   ## Impact
   
   Improvement
   
   ## Testing
   
   Before:
   ```
   ifup bnep0
   bt bnep0 gatt connect 11:22:33:44:55:66 public
   bt bnep0 gatt exchange-mtu 11:22:33:44:55:66 public
   ```
   result:
   ```
     #0 bt_att_create_pdu (conn=g_conns, op=2, len=2) at bluetooth/bt_att.c:1874
     #1 bt_gatt_exchange_mtu (...)                    at bluetooth/bt_gatt.c:612
     #2 btnet_ioctl (cmd=SIOCBTEXCHANGE ...)          at 
bluetooth/bt_ioctl.c:732
   ```
   
   After:
   
   No crash!


-- 
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