Message ID | 20240501014335.2329860-1-iam@sung-woo.kim (mailing list archive) |
---|---|
State | Accepted |
Commit | c2d3fedad3ad5240a19a68ad001894ac352f7878 |
Headers | show |
Series | [v4] Bluetooth: msft: fix slab-use-after-free in msft_do_close() | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | fail | error: patch failed: net/bluetooth/hci_core.c:2768 error: net/bluetooth/hci_core.c: patch does not apply error: patch failed: net/bluetooth/msft.c:769 error: net/bluetooth/msft.c: patch does not apply error: patch failed: net/bluetooth/msft.h:14 error: net/bluetooth/msft.h: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch |
This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: net/bluetooth/hci_core.c:2768 error: net/bluetooth/hci_core.c: patch does not apply error: patch failed: net/bluetooth/msft.c:769 error: net/bluetooth/msft.c: patch does not apply error: patch failed: net/bluetooth/msft.h:14 error: net/bluetooth/msft.h: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth
Hello: This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Tue, 30 Apr 2024 21:43:36 -0400 you wrote: > Dear Luiz, could you revert the v3 patch and apply this? > > Fix the use-after-free bug in msft->data by tying the > msft->data lifectime to hdev. > Also, change msft_unregister() name to msft_release(). > > How msft is used after freed: > > [...] Here is the summary with links: - [v4] Bluetooth: msft: fix slab-use-after-free in msft_do_close() https://git.kernel.org/bluetooth/bluetooth-next/c/c2d3fedad3ad You are awesome, thank you!
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index a7028d38c..bc5086423 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2768,8 +2768,6 @@ void hci_unregister_dev(struct hci_dev *hdev) hci_unregister_suspend_notifier(hdev); - msft_unregister(hdev); - hci_dev_do_close(hdev); if (!test_bit(HCI_INIT, &hdev->flags) && @@ -2823,6 +2821,7 @@ void hci_release_dev(struct hci_dev *hdev) hci_discovery_filter_clear(hdev); hci_blocked_keys_clear(hdev); hci_codec_list_clear(&hdev->local_codecs); + msft_release(hdev); hci_dev_unlock(hdev); ida_destroy(&hdev->unset_handle_ida); diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c index 9612c5d1b..d039683d3 100644 --- a/net/bluetooth/msft.c +++ b/net/bluetooth/msft.c @@ -769,7 +769,7 @@ void msft_register(struct hci_dev *hdev) mutex_init(&msft->filter_lock); } -void msft_unregister(struct hci_dev *hdev) +void msft_release(struct hci_dev *hdev) { struct msft_data *msft = hdev->msft_data; diff --git a/net/bluetooth/msft.h b/net/bluetooth/msft.h index 2a63205b3..fe538e9c9 100644 --- a/net/bluetooth/msft.h +++ b/net/bluetooth/msft.h @@ -14,7 +14,7 @@ bool msft_monitor_supported(struct hci_dev *hdev); void msft_register(struct hci_dev *hdev); -void msft_unregister(struct hci_dev *hdev); +void msft_release(struct hci_dev *hdev); void msft_do_open(struct hci_dev *hdev); void msft_do_close(struct hci_dev *hdev); void msft_vendor_evt(struct hci_dev *hdev, void *data, struct sk_buff *skb); @@ -35,7 +35,7 @@ static inline bool msft_monitor_supported(struct hci_dev *hdev) } static inline void msft_register(struct hci_dev *hdev) {} -static inline void msft_unregister(struct hci_dev *hdev) {} +static inline void msft_release(struct hci_dev *hdev) {} static inline void msft_do_open(struct hci_dev *hdev) {} static inline void msft_do_close(struct hci_dev *hdev) {} static inline void msft_vendor_evt(struct hci_dev *hdev, void *data,