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 X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35D69C433DB for ; Fri, 12 Mar 2021 14:07:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BD03F64FDD for ; Fri, 12 Mar 2021 14:07:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD03F64FDD Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 466848D0357; Fri, 12 Mar 2021 09:07:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 416CD8D0346; Fri, 12 Mar 2021 09:07:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B7338D0357; Fri, 12 Mar 2021 09:07:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 0C5C78D0346 for ; Fri, 12 Mar 2021 09:07:51 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id ADAB91802BC8F for ; Fri, 12 Mar 2021 14:07:50 +0000 (UTC) X-FDA: 77911400700.06.2FBFFF1 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by imf25.hostedemail.com (Postfix) with ESMTP id BA041600013A for ; Fri, 12 Mar 2021 14:07:40 +0000 (UTC) Received: by mail-pf1-f177.google.com with SMTP id 16so1942054pfn.5 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=UsGrqILNdKSg9Hyjck7Xlpsv3MChderPSvPsKSH0PM9R58qH932V5xqt5uAoTQ1QFt QZjuvAiTHKGDbVlGYfR/H2ZPkH9x0izHpaCIukOvHGcrWzjev6/TKbjmfB8yuRHuqr64 Z2DFZPU9E28rctuV1gESOKXNvMYn7okmETrlsB/EKGyA4pQ1hwf3vvpJtzZ/+G/iUPBJ TCGFgd3oqeq1kvNN57+o4Kmu57bFI6/sWW+w+7dfGzjBBSw30XoZsQaDlCZaKduBDyRe D2dRFJKIAMDUdCqBsFr3vzVCHbn5HW1518UlT30/yUre7jtCPvYuB1faL4U4G2ZmUuH8 /vxg== X-Gm-Message-State: AOAM530y5Tb5iXsGusp8PXPTPw47e/CfOopmTJgc5CtdXd+LJZjE2Lct 4Ii0h3xLQEl/53UI9bCYArXeHDLIhYZRPJi1S0KKsw== X-Google-Smtp-Source: ABdhPJya/0Lrt69QiQ3tpO89kn9Jiesh9udHaZI0RtZUpMOO6un0Cirkv8nrQhOjTOawdWox2Gz4IGTOhZ/sx3fUCOk= 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" X-Stat-Signature: fg8s44oog6dswnfg69h8xd5j71szcfuk X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: BA041600013A Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf25; identity=mailfrom; envelope-from=""; helo=mail-pf1-f177.google.com; client-ip=209.85.210.177 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615558060-424279 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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!