[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAN8dotnOgU5cgi3y3f74=bJQt_G7qKpP9imB+REvT7AUeFbQ2Q@mail.gmail.com>
Date: Sun, 4 Feb 2024 13:12:17 +0300
From: Rand Deeb <rand.sec96@...il.com>
To: Fedor Pchelkin <pchelkin@...ras.ru>
Cc: Wolfram Sang <wsa@...nel.org>, Tali Perry <tali.perry1@...il.com>, lvc-project@...uxtesting.org,
voskresenski.stanislav@...fident.ru, Benjamin Fair <benjaminfair@...gle.com>,
Avi Fishman <avifishman70@...il.com>, Patrick Venture <venture@...gle.com>, openbmc@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, Nancy Yuen <yuenn@...gle.com>, linux-i2c@...r.kernel.org,
deeb.rand@...fident.ru, Tomer Maimon <tmaimon77@...il.com>
Subject: Re: Re: Re: [lvc-project] [PATCH] i2c: Fix NULL pointer dereference
in npcm_i2c_reg_slave
On Sun, Feb 4, 2024 at 11:54 AM Fedor Pchelkin <pchelkin@...ras.ru> wrote:
>
> On 24/02/03 09:44PM, Wolfram Sang wrote:
> >
> > > If I'm not missing something, npcm_i2c_reg_slave() is called via a
> > > function pointer ->reg_slave here [1]. And seems `client` can't be NULL
> > > there. Other drivers implementing ->reg_slave function don't check its
> > > argument.
> >
> > Correct, we trust ourselves here.
> >
> > > Maybe we should just drop `if (!bus->slave)` check?
> >
> > Yes.
> >
>
> Okay, thanks for confirmation.
>
> Rand, would you like to prepare the patch, please?
>
Hi Fedor!,
Sure, In fact, there were two scenarios from the beginning, either
redundant condition or potential NULL pointer dereference.I relied on
the condition to determine the type of issue because I did not find
it logical to add a useless condition, but based on the Wolfram Sang
words "we trust ourselves here." then the scenario will change to
redundant condition, so i'll write a new patch and send it in new
thread.
Powered by blists - more mailing lists