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 31C5FC433E2 for ; Thu, 17 Sep 2020 13:26:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 52B922083B for ; Thu, 17 Sep 2020 13:26:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52B922083B 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 915D66B0003; Thu, 17 Sep 2020 09:26:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C6216B0037; Thu, 17 Sep 2020 09:26:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DB496B0055; Thu, 17 Sep 2020 09:26:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id 64A076B0003 for ; Thu, 17 Sep 2020 09:26:27 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1D601362C for ; Thu, 17 Sep 2020 13:26:27 +0000 (UTC) X-FDA: 77272627614.25.quiet99_5a01bf827122 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id DFD191804E3A9 for ; Thu, 17 Sep 2020 13:26:26 +0000 (UTC) X-HE-Tag: quiet99_5a01bf827122 X-Filterd-Recvd-Size: 2590 Received: from mail3-164.sinamail.sina.com.cn (mail3-164.sinamail.sina.com.cn [202.108.3.164]) by imf32.hostedemail.com (Postfix) with SMTP for ; Thu, 17 Sep 2020 13:26:25 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([123.115.166.229]) by sina.com with ESMTP id 5F6363FC00037E06; Thu, 17 Sep 2020 21:26:22 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 7305815073777 From: Hillf Danton To: Marco Elver Cc: akpm@linux-foundation.org, glider@google.com, andreyknvl@google.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH v2 01/10] mm: add Kernel Electric-Fence infrastructure Date: Thu, 17 Sep 2020 21:26:10 +0800 Message-Id: <20200917132610.1964-1-hdanton@sina.com> In-Reply-To: <20200915132046.3332537-2-elver@google.com> References: <20200915132046.3332537-1-elver@google.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: DFD191804E3A9 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Tue, 15 Sep 2020 15:20:37 +0200 > From: Alexander Potapenko >=20 > 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. >=20 > 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. >=20 > 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= | |-----------------|-----------------------------------|-----------------= -| 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 AA2A6C43461 for ; Thu, 17 Sep 2020 13:28:08 +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 27AA82072E for ; Thu, 17 Sep 2020 13:28:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="e8eVVr6u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27AA82072E 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=HwfsFac0qeoMmfcl0NVHqs231v4ZIV5tFkLhZmJLZVY=; b=e8eVVr6ucZTIchDsbDQ2M03dE ECA2B4C2+vmEKvQb4a0NogTrGabBvaxplaicrdLIYOeNZT9Im8P9OzKTUtZXssdHTa1dGdpuQMY+L 3re1VTqCvRcosCFvOzTPFeiT1QiTPMoSIAAZ2K2i2BVkV46wyX+m2p4Y8hLbMUxdzgKdv+z/3BsO5 MIDkV1MWLfcCqSnLyTUY6nYXTxz75YF/ceS3wBx9R5y1Lvc3+ijhV1POVZEU4EZ08pxIzvoRztvH+ WpT4GHryaIVTNkICO0rJpeYqknql7FtLhOD3QCDzAnXN/RSc4amiTUeyRAArHbg1YPb9XGrTF6BMD frQMUDmHg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kItvv-0002lR-Tl; Thu, 17 Sep 2020 13:26:43 +0000 Received: from mail3-164.sinamail.sina.com.cn ([202.108.3.164]) by merlin.infradead.org with smtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kItvq-0002jB-HH for linux-arm-kernel@lists.infradead.org; Thu, 17 Sep 2020 13:26:41 +0000 Received: from unknown (HELO localhost.localdomain)([123.115.166.229]) by sina.com with ESMTP id 5F6363FC00037E06; Thu, 17 Sep 2020 21:26:22 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 7305815073777 From: Hillf Danton To: Marco Elver Subject: Re: [PATCH v2 01/10] mm: add Kernel Electric-Fence infrastructure Date: Thu, 17 Sep 2020 21:26:10 +0800 Message-Id: <20200917132610.1964-1-hdanton@sina.com> In-Reply-To: <20200915132046.3332537-2-elver@google.com> References: <20200915132046.3332537-1-elver@google.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200917_092638_866843_382F5F23 X-CRM114-Status: GOOD ( 10.24 ) 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: andreyknvl@google.com, akpm@linux-foundation.org, glider@google.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org 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 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 | |-----------------|-----------------------------------|------------------| _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel