lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Jul 2021 16:54:26 +0800
From:   Kuan-Ying Lee <Kuan-Ying.Lee@...iatek.com>
To:     Marco Elver <elver@...gle.com>
CC:     Nicholas Tang <nicholas.tang@...iatek.com>,
        Andrew Yang <andrew.yang@...iatek.com>,
        Andrey Konovalov <andreyknvl@...il.com>,
        "Andrey Ryabinin" <ryabinin.a.a@...il.com>,
        Alexander Potapenko <glider@...gle.com>,
        Chinwen Chang <chinwen.chang@...iatek.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        <kasan-dev@...glegroups.com>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-mediatek@...ts.infradead.org>, <Kuan-Ying.Lee@...iatek.com>
Subject: Re: [PATCH 2/2] kasan, mm: reset tag for hex dump address

On Tue, 2021-07-27 at 09:20 +0200, Marco Elver wrote:
> On Tue, 27 Jul 2021 at 06:00, Kuan-Ying Lee <
> Kuan-Ying.Lee@...iatek.com> wrote:
> > 
> > Text is a string. We need to move this kasan_reset_tag()
> > to address but text.
> > 
> > Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@...iatek.com>
> 
> This patch also makes sense (I think), thanks for sending. But it's
> unclear what the problem is. The fact that when the address is
> printed
> it still includes the tag? Or a false positive?
> It'd be good to clarify in the commit message.

Yes, printed address includes the tag, so when we access the
metadata, we will encounter tag mismatch with HW tag-based kasan
enabled.

> 
> Here I'd also use a more descriptive patch title, something like
> "kasan, slub: reset tag when printing address".
> 
> Also, I think this patch requires a:
> 
>   Fixes: aa1ef4d7b3f6 ("kasan, mm: reset tags when accessing
> metadata")
> 
> So that stable kernels can pick this up if appropriate.

Thank you, Marco.
I will refine commit message in the v2.

> 
> > ---
> >  mm/slub.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/mm/slub.c b/mm/slub.c
> > index 6dad2b6fda6f..d20674f839ba 100644
> > --- a/mm/slub.c
> > +++ b/mm/slub.c
> > @@ -576,8 +576,8 @@ static void print_section(char *level, char
> > *text, u8 *addr,
> >                           unsigned int length)
> >  {
> >         metadata_access_enable();
> > -       print_hex_dump(level, kasan_reset_tag(text),
> > DUMP_PREFIX_ADDRESS,
> > -                       16, 1, addr, length, 1);
> > +       print_hex_dump(level, text, DUMP_PREFIX_ADDRESS,
> > +                       16, 1, kasan_reset_tag((void *)addr),
> > length, 1);
> >         metadata_access_disable();
> >  }
> > 
> > --
> > 2.18.0
> > 
> > --
> > You received this message because you are subscribed to the Google
> > Groups "kasan-dev" group.
> > To unsubscribe from this group and stop receiving emails from it,
> > send an email to kasan-dev+unsubscribe@...glegroups.com.
> > To view this discussion on the web visit 
> > https://urldefense.com/v3/__https://groups.google.com/d/msgid/kasan-dev/20210727040021.21371-3-Kuan-Ying.Lee*40mediatek.com__;JQ!!CTRNKA9wMg0ARbw!13XOuYbzPQrBvIDMNbrT7vm8RGc56Oqr402PDfQRDmHrrBsujrZUr7O9q24JeDJ_3NlWSQ$
> >  .

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ