From: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Andrey Konovalov" <andreyknvl@gmail.com>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Chinwen Chang (張錦文)" <chinwen.chang@mediatek.com>,
"Nicholas Tang (鄭秦輝)" <nicholas.tang@mediatek.com>,
"Yee Lee (李建誼)" <Yee.Lee@mediatek.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
kasan-dev <kasan-dev@googlegroups.com>,
james.hsu@mediatek.com, kuan-ying.lee@mediatek.com
Subject: Re: [PATCH] kmemleak: fix kmemleak false positive report with HW tag-based kasan enable
Date: Wed, 24 Nov 2021 10:00:45 +0800 [thread overview]
Message-ID: <3de431c5711c0f6475f54e89c3de601e1279752a.camel@mediatek.com> (raw)
In-Reply-To: <20211119144359.b70d2fde7631bd14cd9652e3@linux-foundation.org>
On Sat, 2021-11-20 at 06:43 +0800, Andrew Morton wrote:
> On Fri, 19 Nov 2021 23:12:55 +0800 Kuan-Ying Lee <
> Kuan-Ying.Lee@mediatek.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.
Thanks for updating changelog. :)
next prev parent reply other threads:[~2021-11-24 2:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 5:44 Kuan-Ying Lee
2021-11-18 9:20 ` Kuan-Ying Lee
2021-11-19 14:15 ` Andrey Konovalov
2021-11-19 15:12 ` Kuan-Ying Lee
2021-11-19 22:43 ` Andrew Morton
2021-11-24 2:00 ` Kuan-Ying Lee [this message]
2021-11-25 16:13 ` Andrey Konovalov
2021-11-28 0:20 ` Andrew Morton
2021-12-02 18:19 ` Catalin Marinas
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=3de431c5711c0f6475f54e89c3de601e1279752a.camel@mediatek.com \
--to=kuan-ying.lee@mediatek.com \
--cc=Yee.Lee@mediatek.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=chinwen.chang@mediatek.com \
--cc=james.hsu@mediatek.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=matthias.bgg@gmail.com \
--cc=nicholas.tang@mediatek.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