From: Rand Deeb <rand.sec96@gmail.com>
To: Fedor Pchelkin <pchelkin@ispras.ru>
Cc: voskresenski.stanislav@confident.ru,
Benjamin Fair <benjaminfair@google.com>,
Avi Fishman <avifishman70@gmail.com>,
Patrick Venture <venture@google.com>,
openbmc@lists.ozlabs.org, Tomer Maimon <tmaimon77@gmail.com>,
linux-kernel@vger.kernel.org, Tali Perry <tali.perry1@gmail.com>,
Wolfram Sang <wsa@kernel.org>,
linux-i2c@vger.kernel.org, deeb.rand@confident.ru,
lvc-project@linuxtesting.org
Subject: Re: Re: Re: [lvc-project] [PATCH] i2c: Fix NULL pointer dereference in npcm_i2c_reg_slave
Date: Sun, 4 Feb 2024 13:12:17 +0300 [thread overview]
Message-ID: <CAN8dotnOgU5cgi3y3f74=bJQt_G7qKpP9imB+REvT7AUeFbQ2Q@mail.gmail.com> (raw)
In-Reply-To: <f5f26a7d-973a-4232-b0cb-b0543fddefe0-pchelkin@ispras.ru>
On Sun, Feb 4, 2024 at 11:54 AM Fedor Pchelkin <pchelkin@ispras.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.
prev parent reply other threads:[~2024-02-05 10:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-09 14:51 [PATCH] i2c: Fix NULL pointer dereference in npcm_i2c_reg_slave Rand Deeb
2024-01-10 8:43 ` Tali Perry
2024-01-10 9:23 ` Re: [lvc-project] " Fedor Pchelkin
2024-02-03 20:44 ` Wolfram Sang
2024-02-04 8:54 ` Fedor Pchelkin
2024-02-04 10:01 ` Rand Deeb
2024-02-04 10:12 ` Rand Deeb [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAN8dotnOgU5cgi3y3f74=bJQt_G7qKpP9imB+REvT7AUeFbQ2Q@mail.gmail.com' \
--to=rand.sec96@gmail.com \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=deeb.rand@confident.ru \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=openbmc@lists.ozlabs.org \
--cc=pchelkin@ispras.ru \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=voskresenski.stanislav@confident.ru \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).