[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <16a26e56-3795-50f8-a32f-d3528696847f@deltatee.com>
Date: Mon, 6 Feb 2023 11:21:09 -0700
From: Logan Gunthorpe <logang@...tatee.com>
To: Chaitanya Kulkarni <chaitanyak@...dia.com>
Cc: "oe-kbuild-all@...ts.linux.dev" <oe-kbuild-all@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jens Axboe <axboe@...nel.dk>,
kernel test robot <lkp@...el.com>,
Christoph Hellwig <hch@....de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: drivers/pci/p2pdma.c:199:44: sparse: sparse: dereference of
noderef expression
On 2023-02-06 8:26 a.m., Chaitanya Kulkarni wrote:
> Logan,
>
>> If you fix the issue, kindly add following tag where applicable
>> | Reported-by: kernel test robot <lkp@...el.com>
>>
>> sparse warnings: (new ones prefixed by >>)
>>>> drivers/pci/p2pdma.c:199:44: sparse: sparse: dereference of noderef expression
>>
>> vim +199 drivers/pci/p2pdma.c
>>
>> 193
>> 194 static void p2pdma_page_free(struct page *page)
>> 195 {
>> 196 struct pci_p2pdma_pagemap *pgmap = to_p2p_pgmap(page->pgmap);
>> 197 struct percpu_ref *ref;
>> 198
>> > 199 gen_pool_free_owner(pgmap->provider->p2pdma->pool,
>> 200 (uintptr_t)page_to_virt(page), PAGE_SIZE,
>> 201 (void **)&ref);
>> 202 percpu_ref_put(ref);
>> 203 }
>> 204
>>
>
> Did you get a chance to look into this ?
Oh, I didn't notice that email. Wonder why it took this long for sparse
to see that.
Looks like we need to add a rcu_derference_protected() around the p2pdma
dereference there. I can send a patch later this week.
Thanks,
Logan
Powered by blists - more mailing lists