[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220122194615.GA914030@euler>
Date: Sat, 22 Jan 2022 11:46:15 -0800
From: Colin Foster <colin.foster@...advantage.com>
To: Jesper Dangaard Brouer <jbrouer@...hat.com>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>,
brouer@...hat.com, LKML <linux-kernel@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>,
Toke Høiland-Jørgensen <toke@...hat.com>,
John Fastabend <john.fastabend@...il.com>,
Alexei Starovoitov <ast@...nel.org>,
Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
Jesper Dangaard Brouer <hawk@...nel.org>
Subject: Re: [net RFC v1 1/1] page_pool: fix NULL dereference crash
On Sat, Jan 22, 2022 at 09:31:17AM +0100, Jesper Dangaard Brouer wrote:
>
>
> On 22/01/2022 03.40, Colin Foster wrote:
> > 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@...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@...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
>
> Can you confirm if your crash is fixed by this change?
Yes, this is confirmed. I'd obviously like to make a more comprehensive
commit message - my main question is "is this an issue for all DSA
configurations?" Seemingly that is the case, but like I said, I'm
unfamiliar with this code. I'll see if I can get a better understanding
before sending the real patch early next week.
>
>
> > > > pool->p.init_callback(page, pool->p.init_arg);
> > > > }
>
Powered by blists - more mailing lists