Re: [PATCH 5.10 043/104] kasan: add explicit preconditions to kasan_report()

Greg Kroah-Hartman
2021-02-17T09:27:19Z

On Tue, Feb 16, 2021 at 12:50:29PM +0100, Pavel Machek wrote:
> Hi!
>
> > From: Vincenzo Frascino <vincenzo.frascino@arm.com>
> >
> > [ Upstream commit 49c6631d3b4f61a7b5bb0453a885a12bfa06ffd8 ]
> >
> > Patch series "kasan: Fix metadata detection for KASAN_HW_TAGS", v5.
> >
> > With the introduction of KASAN_HW_TAGS, kasan_report() currently assumes
> > that every location in memory has valid metadata associated. This is
> > due to the fact that addr_has_metadata() returns always true.
> >
> > As a consequence of this, an invalid address (e.g. NULL pointer
> > address) passed to kasan_report() when KASAN_HW_TAGS is enabled, leads
> > to a kernel panic.
> ...
> > This patch (of 2):
> >
> > With the introduction of KASAN_HW_TAGS, kasan_report() accesses the
> > metadata only when addr_has_metadata() succeeds.
> >
> > Add a comment to make sure that the preconditions to the function are
> > explicitly clarified.
>
> As the other patch from the series is not applied, I don't believe we
> need this in stable. Changelog does not make any sense with just
> comment change cherry-picked...

Good point, now dropped, the AUTOBOT triggered off of the changelog text
which is nice and scary :)

greg k-h