lkml.org 
[lkml]   [2022]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: [PATCH] Bluetooth: L2CAP: Elide a string overflow warning
On Tue, 30 Aug 2022 01:21:58 +0530  Elliott, Robert (Servers)  wrote:
> > -----Original Message-----
> > From: Siddh Raman Pant code@siddh.me>
> > Sent: Thursday, August 25, 2022 6:01 AM
> > To: palmer@rivosinc.com
> > Cc: davem@davemloft.net; edumazet@google.com; johan.hedberg@gmail.com;
> > kuba@kernel.org; linux-bluetooth@vger.kernel.org; linux-
> > kernel@vger.kernel.org; linux@rivosinc.com; luiz.dentz@gmail.com;
> > marcel@holtmann.org; netdev@vger.kernel.org; pabeni@redhat.com
> > Subject: Re: [PATCH] Bluetooth: L2CAP: Elide a string overflow warning
> >
> > On Fri, 12 Aug 2022 11:22:49 +0530 Palmer Dabbelt wrote:
> > > From: Palmer Dabbelt palmer@rivosinc.com>
> > >
> > > Without this I get a string op warning related to copying from a
> > > possibly NULL pointer. I think the warning is spurious, but it's
> > > tripping up allmodconfig.
> >
> > I think it is not spurious, and is due to the following commit:
> > d0be8347c623 ("Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put")
>
> That commit was OK - it added an "if (!c) continue" to handle if
> the value c is changed to NULL.
>
> > The following commit fixes a similar problem (added the NULL check on line
> > 1996):
> > 332f1795ca20 ("Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression")
>
> That commit wiped out the "if (!c) continue" path escape clause
> from the previous patch, introducing a path back to code that
> doesn't check for NULL:

You are correct, thanks for clarifying. Sorry for getting it reversed.

So I think this patch can be modified to just introduce back the escape
clause rather than having an extra indentation.

Thanks,
Siddh

\
 
 \ /
  Last update: 2022-09-01 09:50    [W:0.064 / U:1.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site