[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-5ZMOqhca_Z6FV7@arm.com>
Date: Thu, 3 Apr 2025 10:47:28 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Peter Collingbourne <pcc@...gle.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <kees@...nel.org>, Andy Shevchenko <andy@...nel.org>,
Andrey Konovalov <andreyknvl@...il.com>,
Mark Rutland <mark.rutland@....com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, stable@...r.kernel.org
Subject: Re: [PATCH v5 1/2] string: Add load_unaligned_zeropad() code path to
sized_strscpy()
On Wed, Apr 02, 2025 at 05:06:59PM -0700, Peter Collingbourne wrote:
> The call to read_word_at_a_time() in sized_strscpy() is problematic
> with MTE because it may trigger a tag check fault when reading
> across a tag granule (16 bytes) boundary. To make this code
> MTE compatible, let's start using load_unaligned_zeropad()
> on architectures where it is available (i.e. architectures that
> define CONFIG_DCACHE_WORD_ACCESS). Because load_unaligned_zeropad()
> takes care of page boundaries as well as tag granule boundaries,
> also disable the code preventing crossing page boundaries when using
> load_unaligned_zeropad().
>
> Signed-off-by: Peter Collingbourne <pcc@...gle.com>
> Link: https://linux-review.googlesource.com/id/If4b22e43b5a4ca49726b4bf98ada827fdf755548
> Fixes: 94ab5b61ee16 ("kasan, arm64: enable CONFIG_KASAN_HW_TAGS")
> Cc: stable@...r.kernel.org
Up to you if you want to keep the panic behaviour on unmapped pages.
Either way:
Reviewed-by: Catalin Marinas <catalin.marinas@....com>
Powered by blists - more mailing lists