From: Colin Foster <colin.foster@in-advantage.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Network Development" <netdev@vger.kernel.org>,
"Toke Høiland-Jørgensen" <toke@redhat.com>,
"John Fastabend" <john.fastabend@gmail.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
"Jesper Dangaard Brouer" <hawk@kernel.org>
Subject: Re: [net RFC v1 1/1] page_pool: fix NULL dereference crash
Date: Fri, 21 Jan 2022 18:40:51 -0800 [thread overview]
Message-ID: <20220122024051.GA905413@euler> (raw)
In-Reply-To: <CAADnVQK8xrQ92+=wm8AoDkC93SEKz3G=CoOnkPgvs=spJk5UZA@mail.gmail.com>
On Fri, Jan 21, 2022 at 05:13:28PM -0800, Alexei Starovoitov wrote:
> On Fri, Jan 21, 2022 at 4:57 PM Colin Foster
> <colin.foster@in-advantage.com> wrote:
> >
> > Check for the existence of page pool params before dereferencing. This can
> > cause crashes in certain conditions.
>
> In what conditions?
> Out of tree driver?
>
> > Fixes: 35b2e549894b ("page_pool: Add callback to init pages when they are
> > allocated")
> >
> > Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> > ---
> > net/core/page_pool.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> > index bd62c01a2ec3..641f849c95e7 100644
> > --- a/net/core/page_pool.c
> > +++ b/net/core/page_pool.c
> > @@ -213,7 +213,7 @@ static void page_pool_set_pp_info(struct page_pool *pool,
> > {
> > page->pp = pool;
> > page->pp_magic |= PP_SIGNATURE;
> > - if (pool->p.init_callback)
> > + if (pool->p && pool->p.init_callback)
And my apologies - this should be if (pool... not if (pool->p. kernelbot
will be sure to tell me of this blunder soon
> > pool->p.init_callback(page, pool->p.init_arg);
> > }
> >
> > --
> > 2.25.1
> >
next prev parent reply other threads:[~2022-01-22 2:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-22 0:56 [net RFC v1 0/1] Fix NULL pointer dereference in page_pool Colin Foster
2022-01-22 0:56 ` [net RFC v1 1/1] page_pool: fix NULL dereference crash Colin Foster
2022-01-22 1:13 ` Alexei Starovoitov
2022-01-22 2:20 ` Colin Foster
2022-01-22 2:47 ` Alexei Starovoitov
2022-01-24 12:12 ` Toke Høiland-Jørgensen
2022-01-22 2:40 ` Colin Foster [this message]
2022-01-22 8:31 ` Jesper Dangaard Brouer
2022-01-22 19:46 ` Colin Foster
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=20220122024051.GA905413@euler \
--to=colin.foster@in-advantage.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=davem@davemloft.net \
--cc=hawk@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=toke@redhat.com \
/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 NNTP newsgroup(s).