[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABBYNZLA2aTwRFqeDNLaT6Q4cytLB1e-q5oON=KVK1ts-0dz1w@mail.gmail.com>
Date: Mon, 9 Oct 2023 12:50:25 -0700
From: Luiz Augusto von Dentz <luiz.dentz@...il.com>
To: Yuran Pereira <yuran.pereira@...mail.com>
Cc: Greg KH <gregkh@...uxfoundation.org>,
"marcel@...tmann.org" <marcel@...tmann.org>,
"johan.hedberg@...il.com" <johan.hedberg@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-bluetooth@...r.kernel.org" <linux-bluetooth@...r.kernel.org>,
"syzbot+39ec16ff6cc18b1d066d@...kaller.appspotmail.com"
<syzbot+39ec16ff6cc18b1d066d@...kaller.appspotmail.com>,
"linux-kernel-mentees@...ts.linuxfoundation.org"
<linux-kernel-mentees@...ts.linuxfoundation.org>
Subject: Re: [PATCH] Bluetooth: hci_conn_failed: Fixes memory leak
Hi Yuran,
On Sat, Oct 7, 2023 at 10:39 AM Yuran Pereira <yuran.pereira@...mail.com> wrote:
>
> Hello Greg,
> My apologies, I just noticed that my patch is based on the mainline tree. I'll re-submit one based on the Bluetooth tree and I'll ensure to include the commit id that it's fixing.
>
> Thanks,
> Yuran Pereira
> ________________________________
> De: Greg KH <gregkh@...uxfoundation.org>
> Enviado: 7 de outubro de 2023 11:41
> Para: Yuran Pereira <yuran.pereira@...mail.com>
> Cc: marcel@...tmann.org <marcel@...tmann.org>; johan.hedberg@...il.com <johan.hedberg@...il.com>; linux-kernel@...r.kernel.org <linux-kernel@...r.kernel.org>; linux-bluetooth@...r.kernel.org <linux-bluetooth@...r.kernel.org>; luiz.dentz@...il.com <luiz.dentz@...il.com>; syzbot+39ec16ff6cc18b1d066d@...kaller.appspotmail.com <syzbot+39ec16ff6cc18b1d066d@...kaller.appspotmail.com>; linux-kernel-mentees@...ts.linuxfoundation.org <linux-kernel-mentees@...ts.linuxfoundation.org>
> Assunto: Re: [PATCH] Bluetooth: hci_conn_failed: Fixes memory leak
>
> On Sat, Oct 07, 2023 at 05:09:01PM +0530, Yuran Pereira wrote:
> > The hci_conn_failed() function currently calls hci_connect_cfm(), which
> > indirectly leads to the allocation of an l2cap_conn struct in l2cap_conn_add().
> > This operation results in a memory leak, as the l2cap_conn structure
> > becomes unreferenced.
> >
> > To address this issue and prevent the memory leak, this patch modifies
> > hci_conn_failed() to replace the call to hci_connect_cfm() with a
> > call to hci_disconn_cfm().
I suspect this is not quite right, hci_disconn_cfm is called when a
disconnection has been requested, hci_connect_cfm is correct here
since it is meant to notify the result of connection request procedure
so I can only assume that the culprit here is that hci_conn_failed is
called with status 0 which is invalid and needs fixing.
> > Reported-by: syzbot+39ec16ff6cc18b1d066d@...kaller.appspotmail.com
> > Signed-off-by: Yuran Pereira <yuran.pereira@...mail.com>
> > ---
> > net/bluetooth/hci_conn.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> What commit id does this fix?
>
> thanks,
>
> greg k-h
--
Luiz Augusto von Dentz
Powered by blists - more mailing lists