Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp248756imw; Fri, 15 Jul 2022 02:20:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vOm1F5mjxcWaenxyvXJSIrPTAiiQyExB0591HVqGEuGZ97dWNm5OijjA4dehmCud5H6R4O X-Received: by 2002:a05:6402:5201:b0:43a:d797:b9c with SMTP id s1-20020a056402520100b0043ad7970b9cmr17979869edd.343.1657876857984; Fri, 15 Jul 2022 02:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657876857; cv=none; d=google.com; s=arc-20160816; b=yR9SS86TSpwpoxuYpkXYIhP7PJfykvGyM3IVqEVJjUA1pRzQqsc/8F38zSoLnwxPg6 LjXjrab2UK6o5rG+AA6m09JDyIqKocluw/ZAlvbQZXQ029q9HDtzhBjV9N9+gqBe+dQZ GnhNI8Y85jv1RlwQ0aAFp8EEeV8XsO0YFKM7hIgQTED5St9qkXpqcyRUz8241QWndxbb zg79Xvf5/7zLV2QsF6sFttr7IAegGBGsex5ZIAxwwoj7LyJmjjjNfWscqC3HSY60vyxz OmVUXhUI3A2zUJBM8KE8LqUQoGlxaIw3QIS7qRzohaQbo/2ppWv46B+WSBG+dXTweaYF rvBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lnbKwcn88f6NuJinTbm+K+QRokDztEAvNGDk/1bg6OE=; b=igx7O1iryI/2txcHx0uL+qD45WpuX9IYOrub9iNvVIMQG2Xly7Z6gOQ5gWwByF9cU8 mg9t2odbvigdNgZdJ0CPCylAWxK41au5Kqloanv5q4KTdxtlc2JwSArDwZvYtZz256t2 TfrEpGIptRwbEckMFv6pYqFnRxyM9X6N150FZxIs85jW3o+jV6WR/YAjPlTpGAqHScKV 37pvCvk7n6jHlEOs1jeEb3h5RGh6ZTzwDaS/r52nPFVyRgIXN/9yvd21+XjXPPNxuWuQ feW7LT9t9NZUuhQvr1+/iFLK8l3ig7GkEx+hCmypobqvUuHt98oosuWt2Y/ek9b9kyo2 jiFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EPbgaSiE; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne35-20020a1709077ba300b0072b30e2e4a1si6529589ejc.538.2022.07.15.02.20.32; Fri, 15 Jul 2022 02:20:57 -0700 (PDT) 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=@google.com header.s=20210112 header.b=EPbgaSiE; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233723AbiGOIyH (ORCPT + 99 others); Fri, 15 Jul 2022 04:54:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233669AbiGOIxy (ORCPT ); Fri, 15 Jul 2022 04:53:54 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB8C383F26 for ; Fri, 15 Jul 2022 01:52:58 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 8-20020a05600c024800b003a2fe343db1so2618846wmj.1 for ; Fri, 15 Jul 2022 01:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lnbKwcn88f6NuJinTbm+K+QRokDztEAvNGDk/1bg6OE=; b=EPbgaSiEgC0y6d0plpABJbe4WhG92iJsdO7dU4p4mGED6SykJ/QDLH8/N2MxjUYHLX qVDpoVZVSrTIEGtj5KQFMHqpe9JYWRRZDrXn2v3rXeazNEUOWy1DUOcrai9kkXEGTF6r Zorc70RXImp1DoNbN7gOVkLYiKKr0zAgFDhslcXhBW1frZb9YL6LGtquavH5ImbiumLf HUjYzzAfkRf7I3yGNLmsMogn7wQTzJWPX+9gDPv59k8FDoh+Ws/bvhFWFmYkGhTrDud6 qS5XqssX+c/dSGecigcLJNoTijBqR9PRcLFbV7SqARVFen9kuXNNiMutKStWZWzooUJD jaHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lnbKwcn88f6NuJinTbm+K+QRokDztEAvNGDk/1bg6OE=; b=HusYQe/BN+/sAYm119JkbsTYbYBs/Nm8pZqPY5pFcZdDugh/fS3+K/N++RXdNIQ9aI XsmXm1swYbFBuY5hA0Rj3l6rxSpXBKfKggLUTf2d3myM1Oc8pGWECuB3k2jgmxyrQbxh 2t4b2xTfxKmyk4Nlij6MsGNNyl7IJs+SS+/wmzyAMO8OgRy4XNa+bgu46Anvwv883Z8u VwBxOlb7ZsXipoWPUmfLd7h/EpKTLq7GImXhvS9VZ+VYcA6lkEZty1XfBpebNPHNZhUo MtsVyOJxYxUjqzXI6Jb9Wx6bPm3Wb2B8rOG1K4jYf8xMp9Ha+2lVqrqBx0RerHrI66Ru UJzA== X-Gm-Message-State: AJIora90fxLWcWTK3sxC6lm7U9SEiNccxs9ekjSKcOK7NRVFeOz7Wabf EDheQRGEmGI4TSetXI+71ESBIQ== X-Received: by 2002:a05:600c:354e:b0:3a1:9ddf:468d with SMTP id i14-20020a05600c354e00b003a19ddf468dmr18784274wmq.145.1657875177165; Fri, 15 Jul 2022 01:52:57 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:9c:201:b388:52a3:7014:22f5]) by smtp.gmail.com with ESMTPSA id i15-20020a5d438f000000b0021d4d6355efsm3285703wrq.109.2022.07.15.01.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 01:52:56 -0700 (PDT) Date: Fri, 15 Jul 2022 10:52:49 +0200 From: Marco Elver To: Alexander Potapenko Cc: Alexander Viro , Alexei Starovoitov , Andrew Morton , Andrey Konovalov , Andy Lutomirski , 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 , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev , Linux Memory Management List , Linux-Arch , LKML Subject: Re: [PATCH v4 06/45] kmsan: add ReST documentation Message-ID: References: <20220701142310.2188015-1-glider@google.com> <20220701142310.2188015-7-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.4 (2022-04-30) X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Fri, Jul 15, 2022 at 09:42AM +0200, Alexander Potapenko wrote: [...] > > This sentence might still be confusing. I think it should highlight > > that runtime and compiler go together, but depending on the scope of > > the value, the compiler invokes the runtime to persist the shadow. > > Changed to: > """ > Compiler instrumentation also tracks the shadow values as they are used along > the code. When needed, instrumentation code invokes the runtime library in > ``mm/kmsan/`` to persist shadow values. > """ Ack. [...] > > > +Passing uninitialized values to functions > > > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > + > > > +KMSAN instrumentation pass has an option, ``-fsanitize-memory-param-retval``, > > > > "KMSAN instrumentation pass" -> "Clang's instrumentation support" ? > > Because it seems wrong to say that KMSAN has the instrumentation pass. > How about "Clang's MSan instrumentation pass"? Maybe just "Clang's MemorySanitizer instrumentation" - no abbreviation, and "pass" is very compiler-implementation specific and not everyone might know what "pass" even means in this context, so I'd leave it out. [...] > > It would be useful to move this section somewhere to the beginning, > > closer to usage and the example, as this is information that a user of > > KMSAN might want to know (but they might not want to know much about > > how KMSAN works). > > I restructured the TOC as follows: > > == The Kernel Memory Sanitizer (KMSAN) > == Usage > --- Building the kernel > --- Example report > --- Disabling the instrumentation > == Support > == How KMSAN works > --- KMSAN shadow memory > --- Origin tracking > ~~~~ Origin chaining > --- Clang instrumentation API > ~~~~ Shadow manipulation > ~~~~ Handling locals > ~~~~ Access to per-task data > ~~~~ Passing uninitialized values to functions > ~~~~ String functions > ~~~~ Error reporting > ~~~~ Inline assembly instrumentation > --- Runtime library > ~~~~ Per-task KMSAN state > ~~~~ KMSAN contexts > ~~~~ Metadata allocation > == References LGTM. Thanks, -- Marco