[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231129034247.226365-1-haibo.li@mediatek.com>
Date: Wed, 29 Nov 2023 11:42:47 +0800
From: Haibo Li <haibo.li@...iatek.com>
To: <andreyknvl@...il.com>
CC: <akpm@...ux-foundation.org>,
<angelogioacchino.delregno@...labora.com>, <dvyukov@...gle.com>,
<glider@...gle.com>, <haibo.li@...iatek.com>,
<kasan-dev@...glegroups.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>, <linux-mm@...ck.org>,
<lkp@...el.com>, <matthias.bgg@...il.com>,
<ryabinin.a.a@...il.com>, <vincenzo.frascino@....com>,
<xiaoming.yu@...iatek.com>
Subject: Re: [PATCH] fix comparison of unsigned expression < 0
> On Wed, Nov 29, 2023 at 2:22 AM Andrew Morton <akpm@...ux-foundation.org> wrote:
> >
> > On Tue, 28 Nov 2023 15:55:32 +0800 Haibo Li <haibo.li@...iatek.com> wrote:
> >
> > > Kernel test robot reported:
> > >
> > > '''
> > > mm/kasan/report.c:637 kasan_non_canonical_hook() warn:
> > > unsigned 'addr' is never less than zero.
> > > '''
> > > The KASAN_SHADOW_OFFSET is 0 on loongarch64.
> > >
> > > To fix it,check the KASAN_SHADOW_OFFSET before do comparison.
> > >
> > > --- a/mm/kasan/report.c
> > > +++ b/mm/kasan/report.c
> > > @@ -634,10 +634,10 @@ void kasan_non_canonical_hook(unsigned long addr)
> > > {
> > > unsigned long orig_addr;
> > > const char *bug_type;
> > > -
> > > +#if KASAN_SHADOW_OFFSET > 0
> > > if (addr < KASAN_SHADOW_OFFSET)
> > > return;
> > > -
> > > +#endif
> >
> > We'd rather not add ugly ifdefs for a simple test like this. If we
> > replace "<" with "<=", does it fix? I suspect that's wrong.
>
> Changing the comparison into "<=" would be wrong.
>
> But I actually don't think we need to fix anything here.
>
> This issue looks quite close to a similar comparison with 0 issue
> Linus shared his opinion on here:
>
> https://lore.kernel.org/all/Pine.LNX.4.58.0411230958260.20993@ppc970.osdl.org/
>
> I don't know if the common consensus with the regard to issues like
> that changed since then. But if not, perhaps we can treat this kernel
> test robot report as a false positive.
>
> Thanks!
Thanks for the information.Let's keep it as unchanged.
Powered by blists - more mailing lists