All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] Bluetooth: ISO: Fix invalid context error
@ 2023-09-28  7:52 Iulia Tanasescu
  2023-09-28  7:52 ` [PATCH v2 1/1] " Iulia Tanasescu
  2023-09-28 20:00 ` [PATCH v2 0/1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 4+ messages in thread
From: Iulia Tanasescu @ 2023-09-28  7:52 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	vlad.pruteanu, andrei.istodorescu, luiz.dentz, Iulia Tanasescu

This patch fixes the error introduced by commit a0bfde167b50
("Bluetooth: ISO: Add support for connecting multiple BISes"):

BUG: sleeping function called from invalid context in __hci_cmd_sync_sk

When handling the Create BIG Complete event, in case no bound BISes
have been found for the BIG handle, the hci_le_terminate_big_sync
call should be made from the cmd_sync_work, not from the rx_work.

This patch version addresses review comments.

Iulia Tanasescu (1):
  Bluetooth: ISO: Fix invalid context error

 net/bluetooth/hci_event.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)


base-commit: 091e25d6b54992d1d702ae91cbac139d4c243251
-- 
2.39.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/1] Bluetooth: ISO: Fix invalid context error
  2023-09-28  7:52 [PATCH v2 0/1] Bluetooth: ISO: Fix invalid context error Iulia Tanasescu
@ 2023-09-28  7:52 ` Iulia Tanasescu
  2023-09-28  8:44   ` bluez.test.bot
  2023-09-28 20:00 ` [PATCH v2 0/1] " patchwork-bot+bluetooth
  1 sibling, 1 reply; 4+ messages in thread
From: Iulia Tanasescu @ 2023-09-28  7:52 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	vlad.pruteanu, andrei.istodorescu, luiz.dentz, Iulia Tanasescu

This moves the hci_le_terminate_big_sync call from rx_work
to cmd_sync_work, to avoid calling sleeping function from
an invalid context.

Signed-off-by: Iulia Tanasescu <iulia.tanasescu@nxp.com>
---
 net/bluetooth/hci_event.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index d242f956dea8..89ba3e5a9c0e 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -7020,6 +7020,14 @@ static void hci_le_cis_req_evt(struct hci_dev *hdev, void *data,
 	hci_dev_unlock(hdev);
 }
 
+static int hci_iso_term_big_sync(struct hci_dev *hdev, void *data)
+{
+	u8 handle = PTR_UINT(data);
+
+	return hci_le_terminate_big_sync(hdev, handle,
+					 HCI_ERROR_LOCAL_HOST_TERM);
+}
+
 static void hci_le_create_big_complete_evt(struct hci_dev *hdev, void *data,
 					   struct sk_buff *skb)
 {
@@ -7064,16 +7072,17 @@ static void hci_le_create_big_complete_evt(struct hci_dev *hdev, void *data,
 		rcu_read_lock();
 	}
 
+	rcu_read_unlock();
+
 	if (!ev->status && !i)
 		/* If no BISes have been connected for the BIG,
 		 * terminate. This is in case all bound connections
 		 * have been closed before the BIG creation
 		 * has completed.
 		 */
-		hci_le_terminate_big_sync(hdev, ev->handle,
-					  HCI_ERROR_LOCAL_HOST_TERM);
+		hci_cmd_sync_queue(hdev, hci_iso_term_big_sync,
+				   UINT_PTR(ev->handle), NULL);
 
-	rcu_read_unlock();
 	hci_dev_unlock(hdev);
 }
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: Bluetooth: ISO: Fix invalid context error
  2023-09-28  7:52 ` [PATCH v2 1/1] " Iulia Tanasescu
@ 2023-09-28  8:44   ` bluez.test.bot
  0 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2023-09-28  8:44 UTC (permalink / raw)
  To: linux-bluetooth, iulia.tanasescu

[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=788378

---Test result---

Test Summary:
CheckPatch                    PASS      0.74 seconds
GitLint                       PASS      0.33 seconds
SubjectPrefix                 PASS      0.11 seconds
BuildKernel                   PASS      39.89 seconds
CheckAllWarning               PASS      43.70 seconds
CheckSparse                   WARNING   49.50 seconds
CheckSmatch                   WARNING   135.26 seconds
BuildKernel32                 PASS      38.48 seconds
TestRunnerSetup               PASS      592.66 seconds
TestRunner_l2cap-tester       PASS      35.07 seconds
TestRunner_iso-tester         PASS      66.51 seconds
TestRunner_bnep-tester        PASS      12.28 seconds
TestRunner_mgmt-tester        PASS      255.70 seconds
TestRunner_rfcomm-tester      PASS      18.86 seconds
TestRunner_sco-tester         PASS      22.78 seconds
TestRunner_ioctl-tester       PASS      21.26 seconds
TestRunner_mesh-tester        PASS      15.91 seconds
TestRunner_smp-tester         PASS      16.91 seconds
TestRunner_userchan-tester    PASS      13.22 seconds
IncrementalBuild              PASS      37.25 seconds

Details
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):


---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/1] Bluetooth: ISO: Fix invalid context error
  2023-09-28  7:52 [PATCH v2 0/1] Bluetooth: ISO: Fix invalid context error Iulia Tanasescu
  2023-09-28  7:52 ` [PATCH v2 1/1] " Iulia Tanasescu
@ 2023-09-28 20:00 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2023-09-28 20:00 UTC (permalink / raw)
  To: Iulia Tanasescu
  Cc: linux-bluetooth, claudia.rosu, mihai-octavian.urzica,
	silviu.barbulescu, vlad.pruteanu, andrei.istodorescu, luiz.dentz

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 28 Sep 2023 10:52:56 +0300 you wrote:
> This patch fixes the error introduced by commit a0bfde167b50
> ("Bluetooth: ISO: Add support for connecting multiple BISes"):
> 
> BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
> 
> When handling the Create BIG Complete event, in case no bound BISes
> have been found for the BIG handle, the hci_le_terminate_big_sync
> call should be made from the cmd_sync_work, not from the rx_work.
> 
> [...]

Here is the summary with links:
  - [v2,1/1] Bluetooth: ISO: Fix invalid context error
    https://git.kernel.org/bluetooth/bluetooth-next/c/62dc24251217

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-28 20:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-28  7:52 [PATCH v2 0/1] Bluetooth: ISO: Fix invalid context error Iulia Tanasescu
2023-09-28  7:52 ` [PATCH v2 1/1] " Iulia Tanasescu
2023-09-28  8:44   ` bluez.test.bot
2023-09-28 20:00 ` [PATCH v2 0/1] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.