Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B80DC433F5 for ; Fri, 17 Dec 2021 21:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230449AbhLQVwE (ORCPT ); Fri, 17 Dec 2021 16:52:04 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:35916 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230244AbhLQVv7 (ORCPT ); Fri, 17 Dec 2021 16:51:59 -0500 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1639777918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AT2D4l2B7gM1XeRgIpRAp9+Ku96ZpvKzPu5JSMbwNS0=; b=ZKVZHy79OUfLqeNlY9BPm+IvQJe2D/rq0NPmuXGTrAdH2NuBVX3cp0XeXpgNjpAhLFtf1Q azRrW/FLt5o8aRZhLfVTVcXhk+OYYTSpWP6MO6LLiEQ5eYlq/ZoMcPZ4/njjSgv/ihUALI XK0Tv4HliXC9VVuGFg9ouO7bjtA8ty63t5A/Owsq2rrigd/zwmMfRinDtX8fsyk1AzqEBk hFVkeoqDJEbDjygS8i97ohoTbxMn/PKKngPeHYLo8B1wbrrjDrVT4mlKD9niijSkc1pkT+ 2VRtsefqu+Lpk3i/9dWUorDuihvUE2+AjE3hQR7rDoTxz0xU8QjbV7UelGD/+Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1639777918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AT2D4l2B7gM1XeRgIpRAp9+Ku96ZpvKzPu5JSMbwNS0=; b=h6Nbh3aDlpBkkO5FE3mZMJIvZzB5kYR0sUKQn8VSX+/j1dQO8KrxZq3IrXhnx140ZkPHM8 1FKGLyqknjKHxpAg== To: Alexander Potapenko , glider@google.com Cc: Alexander Viro , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 39/43] x86: kmsan: handle register passing from uninstrumented code In-Reply-To: <20211214162050.660953-40-glider@google.com> References: <20211214162050.660953-1-glider@google.com> <20211214162050.660953-40-glider@google.com> Date: Fri, 17 Dec 2021 22:51:57 +0100 Message-ID: <87bl1ec32a.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexander, On Tue, Dec 14 2021 at 17:20, Alexander Potapenko wrote: > When calling KMSAN-instrumented functions from non-instrumented > functions, function parameters may not be initialized properly, leading > to false positive reports. In particular, this happens all the time when > calling interrupt handlers from `noinstr` IDT entries. > > Fortunately, x86 code has instrumentation_begin() and It's not only x86 code: > kernel/entry/common.c | 3 +++ > @@ -76,6 +77,7 @@ __visible noinstr void do_syscall_64(struct pt_regs *regs, int nr) > nr = syscall_enter_from_user_mode(regs, nr); > > instrumentation_begin(); > + kmsan_instrumentation_begin(regs); Can we please make this something like: instrumentation_begin_at_entry(regs); or some other sensible name which hides that kmsan gunk and avoids to touch all of this again when KFOOSAN comes around? Thanks, tglx