Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1268905pxf; Fri, 12 Mar 2021 06:09:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzK8hHhLp5KjPOkYbbgE3HPSQriVS9/QhifzdRVB8r8hvzMcyVYXG2ZpqnQ2xzFc81d9jgm X-Received: by 2002:a17:906:c9c2:: with SMTP id hk2mr8820723ejb.244.1615558184017; Fri, 12 Mar 2021 06:09:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615558184; cv=none; d=google.com; s=arc-20160816; b=erTxu0DKdEeAUhOfa7AtGRUcuLqlUHblEWHlqaA5MGZJzMjd8WPWaOOfcme5/9VRAg 922Ze0XJ97gQojtzjaSRunfdo4Vq+8ytQHbjsUVkzUCxOmsGhJIYctKsUR28dj87moZn pT2AMWSraxi+iIMbwlY4b6Lqz+1EcAGDBxmVrqSr6VwnBJ5HatufuI3Wb++3q6f25KAr sxaWolJLLzH5R6PqverPL9Jty3odxi0UWSyHZ+5te9rBSkGaBaoe/TFjx2G1QyD7bocM HGIok+fV/qk+4pctbVXxkneecmp6sNyjYGN+9Yg/+iHe0rsGw6zHeu4SD8ewtN2Q0g89 CqMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=v/GgEAlBKF2uwsyk9hjE5RIXHym45HMkX/lhiSnnj6Y=; b=n1OhEDGzEEi0d03d5QsHqdEIhyOKFSYHml6Ox++MRaLgM4J+tgLRa33fN7gEqcyhZW n43ethbOG2osJMgZqyJ8B3TLs7CyJsaSB9oJgfxg0nzpyI1+nlHSH7pYatwPVcyQ3dF6 iNDvXoP7Kix79W+pLc0jP5qbtv+EgAMI2y5zu68ez+8o0IMWi40AK/PNrJVB3/87zYWV k2R9Uw1RBItmVL7MHGxukYsI4rjbwpq6IWoP7njAUmy+qbE5trIw1F9/3aV3rYoqqr6B kLkg5fIRbrNlidoO91pGqiUFH6H6Hgho95UVTIe2+e4s1V/1bEI+K0ugBxDV8lL2Sedq IbVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="C/1wEkaq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si4291116edr.249.2021.03.12.06.09.20; Fri, 12 Mar 2021 06:09:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="C/1wEkaq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231416AbhCLOIJ (ORCPT + 99 others); Fri, 12 Mar 2021 09:08:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231657AbhCLOHl (ORCPT ); Fri, 12 Mar 2021 09:07:41 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1829C061761 for ; Fri, 12 Mar 2021 06:07:41 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id r16so617526pfh.10 for ; Fri, 12 Mar 2021 06:07:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v/GgEAlBKF2uwsyk9hjE5RIXHym45HMkX/lhiSnnj6Y=; b=C/1wEkaq2DArnZL1/GKsWDElinzSEvByJcU1MrlhORKFvXRtJSQuIiv7rG6xlMcUWN wfXmkQdGX3Auf9GWbfhfa1ZYHWI3w6hj4PYQjWsZG+ScmXBQfUw0GnvIv34j3Q5QdHA7 E932zYPWGo3Gt58BFOLDSG0hweGbfOKJOwK/Y6yt49HW8ixAVJFx9t1IuYsfQcOiyFur WyWDRJP+KNPZ4xRPwH9aA8E3viHPf70RseobR3GyS+Yj8NN5Xg0k2ZGNpMie5ObUXQir qy7Sd+J4daBpeU3gAxn1Z0roFL7Q0NxsPXenl/1evSKNeSz+GN76rkxtDmsiYRw8htqH tc0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v/GgEAlBKF2uwsyk9hjE5RIXHym45HMkX/lhiSnnj6Y=; b=SiSER7SNVhM1203O1p/U7p0SWyvxfFmXGJ3JgZ9bXuAVMb5HDtuCQfA7RYGxAx3MGV 9jfrAfO01eSEnmr+ksTUVDZRMr9Z7KGzLip0teq/8JqBCgmIrthZjkcA5Bt/M+CdM6mB iEzFpCV/ZIt8iMk9pZy5GCyR6pM0RWsaW3USg7zjLmLU00w6Dj/s4R55YXrzn+aiZZ13 VS7+EC0mLW5LBP0tSkAIuZly46zzk6Y3l2V/t4/8+urazr6LtlGSYNTKFn/DIntt7nNj x9gF7dfleVASDvCkMcL91U3GfI+gH/7U7LKxcOsSVyp0blD3+Bt51I7Ve/Wa3oiQvvRx vPtw== X-Gm-Message-State: AOAM532uZZLgGTIDvdes2aUpTEnmOLN4h5YUAfYCwdWW31grcoyAbNEC SsPXjOiQJwUz1hBDeMd92hn8lhMxd7VQ9oOECqT5bg== X-Received: by 2002:a63:f14b:: with SMTP id o11mr11989658pgk.440.1615558061031; Fri, 12 Mar 2021 06:07:41 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Fri, 12 Mar 2021 15:07:30 +0100 Message-ID: Subject: Re: [PATCH 10/11] kasan: docs: update ignoring accesses section To: Marco Elver Cc: Andrew Morton , Alexander Potapenko , Andrey Ryabinin , Dmitry Vyukov , kasan-dev , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 12, 2021 at 12:02 PM Marco Elver wrote: > > On Thu, Mar 11, 2021 at 10:37PM +0100, Andrey Konovalov wrote: > [...] > > +Other parts of the kernel might access metadata for allocated objects. Normally, > > +KASAN detects and reports such accesses, but in certain cases (e.g., in memory > > +allocators) these accesses are valid. Disabling instrumentation for memory > > +allocators files helps with accesses that happen directly in that code for > > +software KASAN modes. But it does not help when the accesses happen indirectly > > +(through generic function calls) or with the hardware tag-based mode that does > > +not use compiler instrumentation. > > + > > +To disable KASAN reports in a certain part of the kernel code: > > + > > +- For software modes, add a > > + ``kasan_disable_current()``/``kasan_enable_current()`` critical section. > > Should we mention function attribute __no_sanitize_address (and noinstr, > which just applies to any kind of instrumentation) here? Perhaps with > the note that called functions may still be instrumented, and in such > cases would require combining with kasan_{disable,enable}_current(). Indeed, forgot about the attributes.. Will add, thank you!