[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210216115029.GA25795@amd>
Date: Tue, 16 Feb 2021 12:50:29 +0100
From: Pavel Machek <pavel@....cz>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Vincenzo Frascino <vincenzo.frascino@....com>,
Andrey Konovalov <andreyknvl@...gle.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Leon Romanovsky <leonro@...lanox.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>,
"Paul E . McKenney" <paulmck@...nel.org>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 5.10 043/104] kasan: add explicit preconditions to
kasan_report()
Hi!
> From: Vincenzo Frascino <vincenzo.frascino@....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...
Best regards,
Pavel
> +++ b/include/linux/kasan.h
> @@ -196,6 +196,13 @@ void kasan_init_tags(void);
>
> void *kasan_reset_tag(const void *addr);
>
> +/**
> + * kasan_report - print a report about a bad memory access detected by KASAN
> + * @addr: address of the bad access
> + * @size: size of the bad access
> + * @is_write: whether the bad access is a write or a read
> + * @ip: instruction pointer for the accessibility check or the bad access itself
> + */
> bool kasan_report(unsigned long addr, size_t size,
> bool is_write, unsigned long ip);
>
--
http://www.livejournal.com/~pavelmachek
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists