Re: [PATCH] mm: kmemleak: take a full lowmem check in kmemleak_*_phys()

From: patrick wang
Date: Wed Apr 13 2022 - 22:41:11 EST


On Thu, Apr 14, 2022 at 3:28 AM Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Wed, 13 Apr 2022 20:29:25 +0800 Patrick Wang <patrick.wang.shcn@xxxxxxxxx> wrote:
>
> > The kmemleak_*_phys() apis do not check the address for lowmem's min
> > boundary, while the caller may pass an address below lowmem, which
> > will trigger an oops:
>
> Do you believe this fix should be backported into -stable kernels?

Yes, I think so. The callers may not quite know the actual address they
pass(e.g. from devicetree). So the kmemleak_*_phys() apis should guarantee
the address they finally use is in lowmem range.