[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211119144359.b70d2fde7631bd14cd9652e3@linux-foundation.org>
Date: Fri, 19 Nov 2021 14:43:59 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Kuan-Ying Lee <Kuan-Ying.Lee@...iatek.com>
Cc: Andrey Konovalov <andreyknvl@...il.com>,
Catalin Marinas <catalin.marinas@....com>,
Matthias Brugger <matthias.bgg@...il.com>,
Chinwen Chang (張錦文)
<chinwen.chang@...iatek.com>,
Nicholas Tang (鄭秦輝)
<nicholas.tang@...iatek.com>,
James Hsu ( 徐慶薰)
<James.Hsu@...iatek.com>,
Yee Lee (李建誼)
<Yee.Lee@...iatek.com>, "linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
kasan-dev <kasan-dev@...glegroups.com>,
<kuan-ying.lee@...iatek.com>
Subject: Re: [PATCH] kmemleak: fix kmemleak false positive report with HW
tag-based kasan enable
On Fri, 19 Nov 2021 23:12:55 +0800 Kuan-Ying Lee <Kuan-Ying.Lee@...iatek.com> wrote:
> > > > Call sequence:
> > > > ptr = kmalloc(size, GFP_KERNEL);
> > > > page = virt_to_page(ptr);
> > > > kfree(page_address(page));
> > > > ptr = kmalloc(size, GFP_KERNEL);
> >
> > How is this call sequence valid? page_address returns the address of
> > the start of the page, while kmalloced object could have been located
> > in the middle of it.
>
> Thanks for pointing out. I miss the offset.
>
> It should be listed as below.
>
> ptr = kmalloc(size, GFP_KERNEL);
> page = virt_to_page(ptr);
> offset = offset_in_page(ptr);
> kfree(page_address(page) + offset);
> ptr = kmalloc(size, GFP_KERNEL);
I updated the changelog to reflect this.
Powered by blists - more mailing lists