All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression
@ 2022-08-01 22:57 Luiz Augusto von Dentz
  2022-08-02  0:04 ` [v2] " bluez.test.bot
  2022-08-04  0:00 ` [PATCH v2] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2022-08-01 22:57 UTC (permalink / raw
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

The patch d0be8347c623: "Bluetooth: L2CAP: Fix use-after-free caused
by l2cap_chan_put" from Jul 21, 2022, leads to the following Smatch
static checker warning:

        net/bluetooth/l2cap_core.c:1977 l2cap_global_chan_by_psm()
        error: we previously assumed 'c' could be null (see line 1996)

Fixes: d0be8347c623: "Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put"
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
v2: Fix lkp findings.

 net/bluetooth/l2cap_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 77c0aac14539..1c39fc40591b 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1970,11 +1970,11 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,
 						   bdaddr_t *dst,
 						   u8 link_type)
 {
-	struct l2cap_chan *c, *c1 = NULL;
+	struct l2cap_chan *c, *tmp, *c1 = NULL;
 
 	read_lock(&chan_list_lock);
 
-	list_for_each_entry(c, &chan_list, global_l) {
+	list_for_each_entry_safe(c, tmp, &chan_list, global_l) {
 		if (state && c->state != state)
 			continue;
 
-- 
2.37.1


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

* RE: [v2] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression
  2022-08-01 22:57 [PATCH v2] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression Luiz Augusto von Dentz
@ 2022-08-02  0:04 ` bluez.test.bot
  2022-08-04  0:00 ` [PATCH v2] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-08-02  0:04 UTC (permalink / raw
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1099 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=664639

---Test result---

Test Summary:
CheckPatch                    PASS      2.76 seconds
GitLint                       PASS      1.00 seconds
SubjectPrefix                 PASS      0.88 seconds
BuildKernel                   PASS      35.02 seconds
BuildKernel32                 PASS      29.23 seconds
Incremental Build with patchesPASS      40.79 seconds
TestRunner: Setup             PASS      484.64 seconds
TestRunner: l2cap-tester      PASS      17.78 seconds
TestRunner: bnep-tester       PASS      6.74 seconds
TestRunner: mgmt-tester       PASS      101.36 seconds
TestRunner: rfcomm-tester     PASS      10.23 seconds
TestRunner: sco-tester        PASS      9.72 seconds
TestRunner: smp-tester        PASS      10.17 seconds
TestRunner: userchan-tester   PASS      6.57 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH v2] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression
  2022-08-01 22:57 [PATCH v2] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression Luiz Augusto von Dentz
  2022-08-02  0:04 ` [v2] " bluez.test.bot
@ 2022-08-04  0:00 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2022-08-04  0:00 UTC (permalink / raw
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

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

On Mon,  1 Aug 2022 15:57:02 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> The patch d0be8347c623: "Bluetooth: L2CAP: Fix use-after-free caused
> by l2cap_chan_put" from Jul 21, 2022, leads to the following Smatch
> static checker warning:
> 
>         net/bluetooth/l2cap_core.c:1977 l2cap_global_chan_by_psm()
>         error: we previously assumed 'c' could be null (see line 1996)
> 
> [...]

Here is the summary with links:
  - [v2] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression
    https://git.kernel.org/bluetooth/bluetooth-next/c/600f1aff2dcb

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] 3+ messages in thread

end of thread, other threads:[~2022-08-04  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-01 22:57 [PATCH v2] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression Luiz Augusto von Dentz
2022-08-02  0:04 ` [v2] " bluez.test.bot
2022-08-04  0:00 ` [PATCH v2] " 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.