* [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded
@ 2024-01-09 8:37 Zijun Hu
2024-01-09 9:32 ` [v1,1/1] " bluez.test.bot
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Zijun Hu @ 2024-01-09 8:37 UTC (permalink / raw)
To: luiz.dentz, marcel, johan.hedberg; +Cc: linux-bluetooth, quic_zijuhu, stable
hci_store_wake_reason() wrongly parses event HCI_Connection_Request
as HCI_Connection_Complete and HCI_Connection_Complete as
HCI_Connection_Request, so causes recording wakeup BD_ADDR error and
stability issue, it is fixed by this change.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
net/bluetooth/hci_event.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ef8c3bed7361..22b22c264c2a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -7420,10 +7420,10 @@ static void hci_store_wake_reason(struct hci_dev *hdev, u8 event,
* keep track of the bdaddr of the connection event that woke us up.
*/
if (event == HCI_EV_CONN_REQUEST) {
- bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
+ bacpy(&hdev->wake_addr, &conn_request->bdaddr);
hdev->wake_addr_type = BDADDR_BREDR;
} else if (event == HCI_EV_CONN_COMPLETE) {
- bacpy(&hdev->wake_addr, &conn_request->bdaddr);
+ bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
hdev->wake_addr_type = BDADDR_BREDR;
} else if (event == HCI_EV_LE_META) {
struct hci_ev_le_meta *le_ev = (void *)skb->data;
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [v1,1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded
2024-01-09 8:37 [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded Zijun Hu
@ 2024-01-09 9:32 ` bluez.test.bot
2024-01-09 9:58 ` [PATCH v1 1/1] " Paul Menzel
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: bluez.test.bot @ 2024-01-09 9:32 UTC (permalink / raw)
To: linux-bluetooth, quic_zijuhu
[-- Attachment #1: Type: text/plain, Size: 1826 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=815323
---Test result---
Test Summary:
CheckPatch PASS 0.50 seconds
GitLint PASS 0.24 seconds
SubjectPrefix PASS 0.09 seconds
BuildKernel PASS 28.04 seconds
CheckAllWarning PASS 30.74 seconds
CheckSparse WARNING 36.92 seconds
CheckSmatch WARNING 99.22 seconds
BuildKernel32 PASS 27.10 seconds
TestRunnerSetup PASS 436.36 seconds
TestRunner_l2cap-tester PASS 22.97 seconds
TestRunner_iso-tester PASS 47.10 seconds
TestRunner_bnep-tester PASS 6.76 seconds
TestRunner_mgmt-tester PASS 163.40 seconds
TestRunner_rfcomm-tester PASS 10.85 seconds
TestRunner_sco-tester PASS 14.37 seconds
TestRunner_ioctl-tester PASS 11.93 seconds
TestRunner_mesh-tester PASS 8.86 seconds
TestRunner_smp-tester PASS 9.68 seconds
TestRunner_userchan-tester PASS 7.27 seconds
IncrementalBuild PASS 25.85 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] 8+ messages in thread
* Re: [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded
2024-01-09 8:37 [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded Zijun Hu
2024-01-09 9:32 ` [v1,1/1] " bluez.test.bot
@ 2024-01-09 9:58 ` Paul Menzel
2024-01-09 10:39 ` quic_zijuhu
2024-01-09 11:03 ` [PATCH v2 1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR Zijun Hu
2024-01-09 17:00 ` [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded patchwork-bot+bluetooth
3 siblings, 1 reply; 8+ messages in thread
From: Paul Menzel @ 2024-01-09 9:58 UTC (permalink / raw)
To: Zijun Hu; +Cc: luiz.dentz, marcel, johan.hedberg, linux-bluetooth, stable
Dear Zijun,
Thank you very much for your patch. Should you resent, some nits for the
commit message. For the summary, I suggest:
Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR
Am 09.01.24 um 09:37 schrieb Zijun Hu:
> hci_store_wake_reason() wrongly parses event HCI_Connection_Request
> as HCI_Connection_Complete and HCI_Connection_Complete as
> HCI_Connection_Request, so causes recording wakeup BD_ADDR error and
> stability issue, it is fixed by this change.
Maybe: … stability issue. Fix it by using the correct field.
How did you reproduce the stability issues?
As you sent it to stable@vger.kernel.org, could you please add a Fixes: tag?
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
> net/bluetooth/hci_event.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index ef8c3bed7361..22b22c264c2a 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -7420,10 +7420,10 @@ static void hci_store_wake_reason(struct hci_dev *hdev, u8 event,
> * keep track of the bdaddr of the connection event that woke us up.
> */
> if (event == HCI_EV_CONN_REQUEST) {
> - bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
> + bacpy(&hdev->wake_addr, &conn_request->bdaddr);
> hdev->wake_addr_type = BDADDR_BREDR;
> } else if (event == HCI_EV_CONN_COMPLETE) {
> - bacpy(&hdev->wake_addr, &conn_request->bdaddr);
> + bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
> hdev->wake_addr_type = BDADDR_BREDR;
> } else if (event == HCI_EV_LE_META) {
> struct hci_ev_le_meta *le_ev = (void *)skb->data;
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Kind regards,
Paul
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded
2024-01-09 9:58 ` [PATCH v1 1/1] " Paul Menzel
@ 2024-01-09 10:39 ` quic_zijuhu
0 siblings, 0 replies; 8+ messages in thread
From: quic_zijuhu @ 2024-01-09 10:39 UTC (permalink / raw)
To: Paul Menzel; +Cc: luiz.dentz, marcel, johan.hedberg, linux-bluetooth, stable
On 1/9/2024 5:58 PM, Paul Menzel wrote:
> Dear Zijun,
>
>
> Thank you very much for your patch. Should you resent, some nits for the commit message. For the summary, I suggest:
>
> Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR
>
will take your suggestions and send v2 patch
> Am 09.01.24 um 09:37 schrieb Zijun Hu:
>> hci_store_wake_reason() wrongly parses event HCI_Connection_Request
>> as HCI_Connection_Complete and HCI_Connection_Complete as
>> HCI_Connection_Request, so causes recording wakeup BD_ADDR error and
>> stability issue, it is fixed by this change.
>
> Maybe: … stability issue. Fix it by using the correct field.
> will correct commit messages based on your suggestions.
> How did you reproduce the stability issues?
>
> As you sent it to stable@vger.kernel.org, could you please add a Fixes: tag?
>
i will take it as potential stability issue since it maybe access unexpected memory area.
don't send it to stable@vger.kernel.org any more.
actually. i just read code and find this issue.
>> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
>> ---
>> net/bluetooth/hci_event.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
>> index ef8c3bed7361..22b22c264c2a 100644
>> --- a/net/bluetooth/hci_event.c
>> +++ b/net/bluetooth/hci_event.c
>> @@ -7420,10 +7420,10 @@ static void hci_store_wake_reason(struct hci_dev *hdev, u8 event,
>> * keep track of the bdaddr of the connection event that woke us up.
>> */
>> if (event == HCI_EV_CONN_REQUEST) {
>> - bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
>> + bacpy(&hdev->wake_addr, &conn_request->bdaddr);
>> hdev->wake_addr_type = BDADDR_BREDR;
>> } else if (event == HCI_EV_CONN_COMPLETE) {
>> - bacpy(&hdev->wake_addr, &conn_request->bdaddr);
>> + bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
>> hdev->wake_addr_type = BDADDR_BREDR;
>> } else if (event == HCI_EV_LE_META) {
>> struct hci_ev_le_meta *le_ev = (void *)skb->data;
>
> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
>
>
> Kind regards,
>
> Paul
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR
2024-01-09 8:37 [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded Zijun Hu
2024-01-09 9:32 ` [v1,1/1] " bluez.test.bot
2024-01-09 9:58 ` [PATCH v1 1/1] " Paul Menzel
@ 2024-01-09 11:03 ` Zijun Hu
2024-01-09 11:30 ` [v2,1/1] " bluez.test.bot
2024-01-09 17:00 ` [PATCH v2 1/1] " patchwork-bot+bluetooth
2024-01-09 17:00 ` [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded patchwork-bot+bluetooth
3 siblings, 2 replies; 8+ messages in thread
From: Zijun Hu @ 2024-01-09 11:03 UTC (permalink / raw)
To: luiz.dentz, marcel, johan.hedberg; +Cc: linux-bluetooth, quic_zijuhu
hci_store_wake_reason() wrongly parses event HCI_Connection_Request
as HCI_Connection_Complete and HCI_Connection_Complete as
HCI_Connection_Request, so causes recording wakeup BD_ADDR error and
potential stability issue, fix it by using the correct field.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
Changes since v1:
- Correct tile and commit message based on Paul's suggestions
net/bluetooth/hci_event.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ef8c3bed7361..22b22c264c2a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -7420,10 +7420,10 @@ static void hci_store_wake_reason(struct hci_dev *hdev, u8 event,
* keep track of the bdaddr of the connection event that woke us up.
*/
if (event == HCI_EV_CONN_REQUEST) {
- bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
+ bacpy(&hdev->wake_addr, &conn_request->bdaddr);
hdev->wake_addr_type = BDADDR_BREDR;
} else if (event == HCI_EV_CONN_COMPLETE) {
- bacpy(&hdev->wake_addr, &conn_request->bdaddr);
+ bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
hdev->wake_addr_type = BDADDR_BREDR;
} else if (event == HCI_EV_LE_META) {
struct hci_ev_le_meta *le_ev = (void *)skb->data;
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [v2,1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR
2024-01-09 11:03 ` [PATCH v2 1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR Zijun Hu
@ 2024-01-09 11:30 ` bluez.test.bot
2024-01-09 17:00 ` [PATCH v2 1/1] " patchwork-bot+bluetooth
1 sibling, 0 replies; 8+ messages in thread
From: bluez.test.bot @ 2024-01-09 11:30 UTC (permalink / raw)
To: linux-bluetooth, quic_zijuhu
[-- Attachment #1: Type: text/plain, Size: 1826 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=815358
---Test result---
Test Summary:
CheckPatch PASS 1.10 seconds
GitLint PASS 0.61 seconds
SubjectPrefix PASS 0.14 seconds
BuildKernel PASS 27.62 seconds
CheckAllWarning PASS 30.25 seconds
CheckSparse WARNING 35.68 seconds
CheckSmatch WARNING 98.22 seconds
BuildKernel32 PASS 26.63 seconds
TestRunnerSetup PASS 426.80 seconds
TestRunner_l2cap-tester PASS 22.73 seconds
TestRunner_iso-tester PASS 44.83 seconds
TestRunner_bnep-tester PASS 6.73 seconds
TestRunner_mgmt-tester PASS 160.15 seconds
TestRunner_rfcomm-tester PASS 10.78 seconds
TestRunner_sco-tester PASS 14.29 seconds
TestRunner_ioctl-tester PASS 11.87 seconds
TestRunner_mesh-tester PASS 8.68 seconds
TestRunner_smp-tester PASS 9.63 seconds
TestRunner_userchan-tester PASS 7.19 seconds
IncrementalBuild PASS 25.91 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] 8+ messages in thread
* Re: [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded
2024-01-09 8:37 [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded Zijun Hu
` (2 preceding siblings ...)
2024-01-09 11:03 ` [PATCH v2 1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR Zijun Hu
@ 2024-01-09 17:00 ` patchwork-bot+bluetooth
3 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+bluetooth @ 2024-01-09 17:00 UTC (permalink / raw)
To: Zijun Hu; +Cc: luiz.dentz, marcel, johan.hedberg, linux-bluetooth, stable
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Tue, 9 Jan 2024 16:37:30 +0800 you wrote:
> hci_store_wake_reason() wrongly parses event HCI_Connection_Request
> as HCI_Connection_Complete and HCI_Connection_Complete as
> HCI_Connection_Request, so causes recording wakeup BD_ADDR error and
> stability issue, it is fixed by this change.
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
>
> [...]
Here is the summary with links:
- [v1,1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded
https://git.kernel.org/bluetooth/bluetooth-next/c/7974b2128489
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] 8+ messages in thread
* Re: [PATCH v2 1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR
2024-01-09 11:03 ` [PATCH v2 1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR Zijun Hu
2024-01-09 11:30 ` [v2,1/1] " bluez.test.bot
@ 2024-01-09 17:00 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 8+ messages in thread
From: patchwork-bot+bluetooth @ 2024-01-09 17:00 UTC (permalink / raw)
To: Zijun Hu; +Cc: luiz.dentz, marcel, johan.hedberg, 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, 9 Jan 2024 19:03:23 +0800 you wrote:
> hci_store_wake_reason() wrongly parses event HCI_Connection_Request
> as HCI_Connection_Complete and HCI_Connection_Complete as
> HCI_Connection_Request, so causes recording wakeup BD_ADDR error and
> potential stability issue, fix it by using the correct field.
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
>
> [...]
Here is the summary with links:
- [v2,1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR
https://git.kernel.org/bluetooth/bluetooth-next/c/7974b2128489
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] 8+ messages in thread
end of thread, other threads:[~2024-01-09 17:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-09 8:37 [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded Zijun Hu
2024-01-09 9:32 ` [v1,1/1] " bluez.test.bot
2024-01-09 9:58 ` [PATCH v1 1/1] " Paul Menzel
2024-01-09 10:39 ` quic_zijuhu
2024-01-09 11:03 ` [PATCH v2 1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR Zijun Hu
2024-01-09 11:30 ` [v2,1/1] " bluez.test.bot
2024-01-09 17:00 ` [PATCH v2 1/1] " patchwork-bot+bluetooth
2024-01-09 17:00 ` [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).