[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220330084615.GH8939@worktop.programming.kicks-ass.net>
Date: Wed, 30 Mar 2022 10:46:15 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Alexander Potapenko <glider@...gle.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrey Konovalov <andreyknvl@...gle.com>,
Andy Lutomirski <luto@...nel.org>,
Arnd Bergmann <arnd@...db.de>, Borislav Petkov <bp@...en8.de>,
Christoph Hellwig <hch@....de>,
Christoph Lameter <cl@...ux.com>,
David Rientjes <rientjes@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Eric Dumazet <edumazet@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
Ilya Leoshkevich <iii@...ux.ibm.com>,
Ingo Molnar <mingo@...hat.com>, Jens Axboe <axboe@...nel.dk>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Kees Cook <keescook@...omium.org>,
Marco Elver <elver@...gle.com>,
Mark Rutland <mark.rutland@....com>,
Matthew Wilcox <willy@...radead.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Pekka Enberg <penberg@...nel.org>,
Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
Vasily Gorbik <gor@...ux.ibm.com>,
Vegard Nossum <vegard.nossum@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>, linux-mm@...ck.org,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 38/48] objtool: kmsan: list KMSAN API functions as
uaccess-safe
On Tue, Mar 29, 2022 at 02:40:07PM +0200, Alexander Potapenko wrote:
> KMSAN inserts API function calls in a lot of places (function entries
> and exits, local variables, memory accesses), so they may get called
> from the uaccess regions as well.
That's insufficient. Explain how you did the right thing and made these
functions actually safe to be called in this context.
> Signed-off-by: Alexander Potapenko <glider@...gle.com>
> ---
> Link: https://linux-review.googlesource.com/id/I242bc9816273fecad4ea3d977393784396bb3c35
> ---
> tools/objtool/check.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index 7c33ec67c4a95..8518eaf05bff0 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -943,6 +943,25 @@ static const char *uaccess_safe_builtin[] = {
> "__sanitizer_cov_trace_cmp4",
> "__sanitizer_cov_trace_cmp8",
> "__sanitizer_cov_trace_switch",
> + /* KMSAN */
> + "kmsan_copy_to_user",
> + "kmsan_report",
> + "kmsan_unpoison_memory",
> + "__msan_chain_origin",
> + "__msan_get_context_state",
> + "__msan_instrument_asm_store",
> + "__msan_metadata_ptr_for_load_1",
> + "__msan_metadata_ptr_for_load_2",
> + "__msan_metadata_ptr_for_load_4",
> + "__msan_metadata_ptr_for_load_8",
> + "__msan_metadata_ptr_for_load_n",
> + "__msan_metadata_ptr_for_store_1",
> + "__msan_metadata_ptr_for_store_2",
> + "__msan_metadata_ptr_for_store_4",
> + "__msan_metadata_ptr_for_store_8",
> + "__msan_metadata_ptr_for_store_n",
> + "__msan_poison_alloca",
> + "__msan_warning",
> /* UBSAN */
> "ubsan_type_mismatch_common",
> "__ubsan_handle_type_mismatch",
> --
> 2.35.1.1021.g381101b075-goog
>
Powered by blists - more mailing lists