[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAeHK+zLzajA8-TTJ4OjoMtgPB=hyJRxzz7WwG4gc=tHTuB3Yw@mail.gmail.com>
Date: Fri, 18 Sep 2020 14:26:43 +0200
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Catalin Marinas <catalin.marinas@....com>
Cc: Dmitry Vyukov <dvyukov@...gle.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
kasan-dev <kasan-dev@...glegroups.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Marco Elver <elver@...gle.com>,
Evgenii Stepanov <eugenis@...gle.com>,
Elena Petrova <lenaptr@...gle.com>,
Branislav Rankov <Branislav.Rankov@....com>,
Kevin Brodsky <kevin.brodsky@....com>,
Will Deacon <will.deacon@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 34/37] kasan, arm64: print report from tag fault handler
On Thu, Sep 17, 2020 at 7:04 PM Catalin Marinas <catalin.marinas@....com> wrote:
>
> On Tue, Sep 15, 2020 at 11:16:16PM +0200, Andrey Konovalov wrote:
> > diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> > index cdc23662691c..ac79819317f2 100644
> > --- a/arch/arm64/mm/fault.c
> > +++ b/arch/arm64/mm/fault.c
> > @@ -14,6 +14,7 @@
> > #include <linux/mm.h>
> > #include <linux/hardirq.h>
> > #include <linux/init.h>
> > +#include <linux/kasan.h>
> > #include <linux/kprobes.h>
> > #include <linux/uaccess.h>
> > #include <linux/page-flags.h>
> > @@ -295,17 +296,23 @@ static void die_kernel_fault(const char *msg, unsigned long addr,
> > do_exit(SIGKILL);
> > }
> >
> > +#ifdef CONFIG_KASAN_HW_TAGS
> > static void report_tag_fault(unsigned long addr, unsigned int esr,
> > struct pt_regs *regs)
> > {
> > - bool is_write = ((esr & ESR_ELx_WNR) >> ESR_ELx_WNR_SHIFT) != 0;
> > + bool is_write = ((esr & ESR_ELx_WNR) >> ESR_ELx_WNR_SHIFT) != 0;
> >
> > - pr_alert("Memory Tagging Extension Fault in %pS\n", (void *)regs->pc);
> > - pr_alert(" %s at address %lx\n", is_write ? "Write" : "Read", addr);
> > - pr_alert(" Pointer tag: [%02x], memory tag: [%02x]\n",
> > - mte_get_ptr_tag(addr),
> > - mte_get_mem_tag((void *)addr));
> > + /*
> > + * SAS bits aren't set for all faults reported in EL1, so we can't
> > + * find out access size.
> > + */
> > + kasan_report(addr, 0, is_write, regs->pc);
> > }
> > +#else
> > +/* Tag faults aren't enabled without CONFIG_KASAN_HW_TAGS. */
> > +static inline void report_tag_fault(unsigned long addr, unsigned int esr,
> > + struct pt_regs *regs) { }
> > +#endif
>
> So is there a point in introducing this function in an earlier patch,
> just to remove its content here?
I added it to make the first patch somewhat self-consistent. But we
can drop it in v3 if you think it's not needed.
Powered by blists - more mailing lists