From mboxrd@z Thu Jan 1 00:00:00 1970 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 AC139C4332F for ; Tue, 22 Nov 2022 08:17:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232468AbiKVIRq (ORCPT ); Tue, 22 Nov 2022 03:17:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232345AbiKVIRj (ORCPT ); Tue, 22 Nov 2022 03:17:39 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 678DE2DE8 for ; Tue, 22 Nov 2022 00:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lIi8jGVlGgg3eoghMdWB24FsEaTDuVeoT2XtEbvFFeA=; b=Uv9mfyPjPFdm8yWdptqC184WOl fBactgl0mrx1SaquuJNxkFOnHP7tE1LR9UjwbxaVwYFGO7Tr578XbCJOisROXMG6bcXHOIfTYXqU4 zgslwlWRHuiRwRSKTC28l6xGPdiv1b0l7U62AzwvEIwZDzs0xPh/9O0qEX/r7Yrg/IxaoP6Wp8rt/ QYHlmdkiBM0eZ6lfRzTNefSYUJNoC19UJO1VBuh6lTs9QQH7MrJHRSS4moM5pQbIxwKC8McwAlhF7 hqOIbg1wKYKq4wbFYt/i5zLRcu01y53c1I4hnluvc1E5szdPR/eCr85q4K/BkC5wdoGFvQRyKav6P KB9iO0vQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxOT8-0066XW-Rb; Tue, 22 Nov 2022 08:17:28 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F0FC5300282; Tue, 22 Nov 2022 09:17:18 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CF1832D65BCD9; Tue, 22 Nov 2022 09:17:18 +0100 (CET) Date: Tue, 22 Nov 2022 09:17:18 +0100 From: Peter Zijlstra To: Alexander Potapenko Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, Eric Biggers Subject: Re: [PATCH] x86: suppress KMSAN reports in arch_within_stack_frames() Message-ID: References: <20221118172305.3321253-1-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 21, 2022 at 03:27:49PM +0100, Alexander Potapenko wrote: > In other words, for normal instrumentation: > - locals are explicitly marked as uninitialized; > - shadow values are calculated for arithmetic operations based on their inputs; > - shadow values are checked for branches, pointer dereferences, and > before passing them as function arguments; > - memory stores update shadow for affected variables. > > For __no_kmsan_checks: > - locals are explicitly marked as initialized; > - no instrumentation is added for arithmetic operations, branches, > pointer dereferences; > - all function arguments are marked as initialized; > - stores always mark memory as initialized. > > For __no_sanitize_memory: > - no instrumentation for locals (they may end up being initialized or > uninitialized - doesn't matter, because their shadow values are never > used); > - no instrumentation for arithmetic operations, branches, pointer dereferences; > - no instrumentation for function calls (an instrumented function > will receive garbage shadow values from a non-instrumented one); > - no instrumentation for stores (initialization done in these > functions is invisible). Thanks! That is a great summary.