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 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,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 DBF10C43463 for ; Thu, 17 Sep 2020 23:47:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B07020707 for ; Thu, 17 Sep 2020 23:47:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Wk51x6DR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B07020707 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wBPmtGi8YVH9zVg3uJZUiOLH6RCWRvZ5hY0xVOrY9y4=; b=Wk51x6DR5OQ+xojM4svrypoFl VYycO/lbUd9J9AkUcS/VnF3qBa32WrfIVcJ7/HayYTV8aEYd2WA9qtguQrv48DlulzwZQxqVu4J6z DIOJ5Dz8XAqJVEP3A3xzZ0j53r4E7r2217IV5Pv8mBO24lW3okcWZoYMU/PJ6JLRlqEGpmBAEyokH bpFZm6Fi9TsC6pvoYuJQYqK3wnt4ndiRYvV8LTfdJOdNh/Fy0wdA4qJFvh5zt0PBVAXuwCmcqoZ/Q a5xu3YYnqz5PCKJZRqEhjqP8z63LIwxiXN317g76CbyTALKlCLUY7OEWOtI2N6LQn2FlqsoJ+ssrS Ha0osB8vw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJ3bF-0002Ax-TD; Thu, 17 Sep 2020 23:46:01 +0000 Received: from r3-19.sinamail.sina.com.cn ([202.108.3.19]) by merlin.infradead.org with smtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJ3bB-0002A6-Mb for linux-arm-kernel@lists.infradead.org; Thu, 17 Sep 2020 23:45:59 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200917_194557_959916_56BBA2BD X-CRM114-Status: GOOD ( 17.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hillf Danton , Andrey Konovalov , Linux Memory Management List , Alexander Potapenko , Andrew Morton , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 near > > > zero performance overhead. Compared to KASAN, KFENCE trades performance > > > for precision. The main motivation behind KFENCE's design, is that with > > > enough total uptime KFENCE will detect bugs in code paths not typically > > > exercised by non-production test workloads. One way to quickly achieve a > > > large enough total uptime is when the tool is deployed across a large > > > 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 object > > > 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 | > > |-----------------|-----------------------------------|------------------| > > > > Would the one we have in Documentation be what you're after? Yes, that's great. > > https://lore.kernel.org/linux-arm-kernel/20200915132046.3332537-10-elver@google.com/ > (at "The following figure illustrates the page layout::") > > Let us know if you'd like that copied into the commit message. Then the copy can help more readers. Thanks Hillf _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel