Revert "Bluetooth: fix use-after-free in accessing skb after sending it"

This reverts commit 715264ad09 which is
commit 947ec0d002dce8577b655793dcc6fc78d67b7cb6 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: Icc979230a67566ee6a64cee43c91ec710c53c019
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-05-16 13:43:47 +00:00
parent 7386876ffd
commit c0dded0f8b

View File

@@ -4174,7 +4174,7 @@ static void hci_send_cmd_sync(struct hci_dev *hdev, struct sk_buff *skb)
if (hci_req_status_pend(hdev) &&
!hci_dev_test_and_set_flag(hdev, HCI_CMD_PENDING)) {
kfree_skb(hdev->req_skb);
hdev->req_skb = skb_clone(hdev->sent_cmd, GFP_KERNEL);
hdev->req_skb = skb_clone(skb, GFP_KERNEL);
}
atomic_dec(&hdev->cmd_cnt);