Message ID | 20241115155941.2118683-1-luiz.dentz@gmail.com |
---|---|
State | New |
Headers | show |
Series | [v1] Bluetooth: MGMT: Fix slab-use-after-free Read in set_powered_sync | expand |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 1f6d083682b8..6a26c1ea0d04 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1441,6 +1441,10 @@ static void settings_rsp(struct mgmt_pending_cmd *cmd, void *data) sock_hold(match->sk); } + /* dequeue cmd_sync entries using cmd as data as that is about to be + * removed/freed. + */ + hci_cmd_sync_dequeue(match->hdev, NULL, cmd, NULL); mgmt_pending_free(cmd); }