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=-3.5 required=3.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 9DD84C43463 for ; Thu, 17 Sep 2020 23:45:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C80D3206BE for ; Thu, 17 Sep 2020 23:45:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C80D3206BE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DB5DA6B0003; Thu, 17 Sep 2020 19:45:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D3FC86B0055; Thu, 17 Sep 2020 19:45:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C55D86B005A; Thu, 17 Sep 2020 19:45:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id AF4B16B0003 for ; Thu, 17 Sep 2020 19:45:55 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 78743362B for ; Thu, 17 Sep 2020 23:45:55 +0000 (UTC) X-FDA: 77274188670.12.dirt01_31036e127126 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 496CD180050E7 for ; Thu, 17 Sep 2020 23:45:55 +0000 (UTC) X-HE-Tag: dirt01_31036e127126 X-Filterd-Recvd-Size: 3443 Received: from r3-18.sinamail.sina.com.cn (r3-18.sinamail.sina.com.cn [202.108.3.18]) by imf08.hostedemail.com (Postfix) with SMTP for ; Thu, 17 Sep 2020 23:45:53 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([123.115.166.229]) by sina.com with ESMTP id 5F63F52C00025A37; Thu, 18 Sep 2020 07:45:50 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 60282715073452 From: Hillf Danton To: Marco Elver Cc: Hillf Danton , Andrew Morton , Alexander Potapenko , Andrey Konovalov , Linux ARM , Linux Memory Management List Subject: Re: [PATCH v2 01/10] mm: add Kernel Electric-Fence infrastructure Date: Fri, 18 Sep 2020 07:45:39 +0800 Message-Id: <20200917234539.13276-1-hdanton@sina.com> In-Reply-To: References: <20200915132046.3332537-1-elver@google.com> <20200915132046.3332537-2-elver@google.com> <20200917132610.1964-1-hdanton@sina.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Thu, 17 Sep 2020 15:36:38 +0200 Marco Elver wrote: > On Thu, 17 Sep 2020 at 15:26, Hillf Danton wrote: > > Tue, 15 Sep 2020 15:20:37 +0200 > > > From: Alexander Potapenko > > > > > > This adds the Kernel Electric-Fence (KFENCE) infrastructure. KFENCE= is a > > > low-overhead sampling-based memory safety error detector of heap > > > use-after-free, invalid-free, and out-of-bounds access errors. > > > > > > KFENCE is designed to be enabled in production kernels, and has nea= r > > > zero performance overhead. Compared to KASAN, KFENCE trades perform= ance > > > for precision. The main motivation behind KFENCE's design, is that = with > > > enough total uptime KFENCE will detect bugs in code paths not typic= ally > > > exercised by non-production test workloads. One way to quickly achi= eve a > > > large enough total uptime is when the tool is deployed across a lar= ge > > > fleet of machines. > > > > > > KFENCE objects each reside on a dedicated page, at either the left = or > > > right page boundaries. The pages to the left and right of the objec= t > > > page are "guard pages", whose attributes are changed to a protected > > > state, and cause page faults on any attempted access to them. Such = page > > > faults are then intercepted by KFENCE, which handles the fault > > > gracefully by reporting a memory access error. > > > > To help understand the magic of KFENCE, a simple diagram looks needed= to > > illustrate the relations between obj and guard pages, something like = the > > below asiic chart. > > > > |-----------------|-----------------------------------|------= ------------| > > | left guard page | the page containing KFENCE object | right= guard page | > > |-----------------|-----------------------------------|------= ------------| > > >=20 > Would the one we have in Documentation be what you're after? Yes, that's great. >=20 > https://lore.kernel.org/linux-arm-kernel/20200915132046.3332537-10-elve= r@google.com/ > (at "The following figure illustrates the page layout::") >=20 > Let us know if you'd like that copied into the commit message. Then the copy can help more readers. Thanks Hillf