Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5501318rwb; Tue, 22 Nov 2022 00:27:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf53PSi7rmIIVZH5HloQYeOr9sPd6HITHeptqfn1oBFCRB9hwUUS3d4TAgpffKDv4srvQnVo X-Received: by 2002:a17:906:381:b0:78c:b8b0:9d35 with SMTP id b1-20020a170906038100b0078cb8b09d35mr10409745eja.586.1669105674066; Tue, 22 Nov 2022 00:27:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669105674; cv=none; d=google.com; s=arc-20160816; b=uFDpKJI7Pu4LR3uiXKPMk1cIb1TJZc4X3hl++GYLO6FIxSNvO43w7Jxt9x6iE2Izz0 93gtho0t2JMDn60xMVdZbAveqiv7Cha+PvghM6g28ZT+9S59gZUf1ln/JM9+6p12RlGe YwoL+7ycTabI/p8MCQ2fxTQxi4yGcUEahOMfcOl9V8uiXWwqIU80Cu62LBI+JaPd6UAX xLo8WOjbwR400z+k/8ekQn+Wd9MGIUr6NkcoYZfdD0IFGJUWydr+PRRlk9Cn9f/SdwGN azuo82/EiN7MiUfyYOiyHu9Js62fYWv50Peb/S78JgYA4HQkdm5JCtWA+M9N7k2hkbq+ NDUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lIi8jGVlGgg3eoghMdWB24FsEaTDuVeoT2XtEbvFFeA=; b=Xg4DL/pgfcVyHJCsEuiWEhERGTb4neNpE99OS27yN+EY6h+6AHoi1akWSn3GbI6btb YqFJESrkGAFsKpvhMKeKjsJrpedcVanm+p7/jt3jtVlUFUoECeRAb7ul1woqXfpTayz5 N0An82x53EAl+OwfPg6RvvOauAHWwIfCDM+8/dl4BIqKCbLRNBnyxS+iIELrSGDZenFi DZUXB/jMcSf2bvyan5UWq6Y7AXtlJkq3FR6llmuAM2YXQBSWtGWhvQQPDnzLZiiGLlUm 6H9iCL+0+4CILGY9ObAlLGxNj3c5/uhsvOVx3SqsVI0auZ7j+e0+f/6lem0VU3kK/xPf 3xMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Uv9mfyPj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z15-20020a17090655cf00b007b28c65ba9bsi8071095ejp.246.2022.11.22.00.27.31; Tue, 22 Nov 2022 00:27:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Uv9mfyPj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232297AbiKVIRo (ORCPT + 91 others); Tue, 22 Nov 2022 03:17:44 -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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.