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=-11.4 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,URIBL_BLOCKED,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 0EA7AC433E2 for ; Thu, 17 Sep 2020 13:36:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 865EC2076D for ; Thu, 17 Sep 2020 13:36:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="HXYs+8eC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 865EC2076D 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 837F76B0055; Thu, 17 Sep 2020 09:36:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 80E506B005A; Thu, 17 Sep 2020 09:36:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 723B06B005C; Thu, 17 Sep 2020 09:36:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0237.hostedemail.com [216.40.44.237]) by kanga.kvack.org (Postfix) with ESMTP id 5A4FC6B0055 for ; Thu, 17 Sep 2020 09:36:52 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 11C33180AD806 for ; Thu, 17 Sep 2020 13:36:52 +0000 (UTC) X-FDA: 77272653864.02.line17_3f0404c27122 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id E17171005B0FC for ; Thu, 17 Sep 2020 13:36:51 +0000 (UTC) X-HE-Tag: line17_3f0404c27122 X-Filterd-Recvd-Size: 4842 Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.67]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 13:36:51 +0000 (UTC) Received: by mail-ot1-f67.google.com with SMTP id h17so1924989otr.1 for ; Thu, 17 Sep 2020 06:36:51 -0700 (PDT) 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=7MUyxXt0omr5Z++3de7TCUjvA82CnAeEC/F56vNMODk=; b=HXYs+8eC1GslmfL/aX+kKHMPx8rvrBdB2TrgYcMgsbfd5wgdT9mct2H4VVUYguVybm NwywZerov+vh96IbzqZ3D2VPHvwOikISP8Ir/SFAr9lyPc/u2QAdxBL01rF1kFUFxEMW JVRAK21wa1m8i3rXci4/+ZzIelzbf+Kk669ybbR3ChBAl0TaqOh4H8AbTzPjUmB5wVro PrXJSrWHxQsAjkB5ngixVHbfpu1xqgziXyGm8sJ7bXp9xnhy1SVWlq+qF1ck0B8/TUEC FtI63u1W0rwjcXJPOmM22R/FwCbJK0p51XcRWustImItBDfhI7RucBb3skgoU68x0unh PHNw== 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=7MUyxXt0omr5Z++3de7TCUjvA82CnAeEC/F56vNMODk=; b=TTCvAyha84WZdDdhFTb486mqNBE/4gikK/utOPdqGVwu6bz2RI4jWueNdAa/qU82uH HFFgIGB8rQMKZQPpS0ywau+PilH6wuv/AxeVHQ47uO4L4JSGwLf+lyHCLdJ5jGUE1UGi vHCxVnHCU+Vw8Yt2ElG+w1WG/+xcsRYGJGspBh0Ob3RmMb/nKzc6tr5yVtXYG+CbOSro vIEy4cPd5KvN3hWMjShhMUd3W5rtaNxjTXsrdBHdaQjvF9zsHoNaR9mnczSgktC8FcSz Iyww2QQCA4eoudEkggAfYbL8fOPpu5+8GWe5ICWiwWJ333/lg5OISKEoVSUqlU9rHO6U sSJg== X-Gm-Message-State: AOAM532xUNg+HTRbjSOyjpeoLzwCjeeZOCVssWsoMV08APeF78Dub9Y6 R5WEREknGHHeMAEcOsftF1RNP6jkSOQLamdzk8KytA== X-Google-Smtp-Source: ABdhPJxU0xVmau4OEGmnhsyytheTJoy8l/k52wxgEQ7xbpBN4eo+/T77qCCaEZhvAqls/265mnU7hUVZjZSM0+yswms= X-Received: by 2002:a05:6830:1e8c:: with SMTP id n12mr20767604otr.17.1600349810413; Thu, 17 Sep 2020 06:36:50 -0700 (PDT) MIME-Version: 1.0 References: <20200915132046.3332537-1-elver@google.com> <20200915132046.3332537-2-elver@google.com> <20200917132610.1964-1-hdanton@sina.com> In-Reply-To: <20200917132610.1964-1-hdanton@sina.com> From: Marco Elver Date: Thu, 17 Sep 2020 15:36:38 +0200 Message-ID: Subject: Re: [PATCH v2 01/10] mm: add Kernel Electric-Fence infrastructure To: Hillf Danton Cc: Andrew Morton , Alexander Potapenko , Andrey Konovalov , Linux ARM , Linux Memory Management List Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: E17171005B0FC X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 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? 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. Thanks, -- Marco 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=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,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 B6625C43461 for ; Thu, 17 Sep 2020 13:38:25 +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 4C97F2075E for ; Thu, 17 Sep 2020 13:38:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YcMZ4R1x"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="HXYs+8eC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C97F2075E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mvdVowvwhd0kUQkgpY4kycc+hKqy0TNW4Nn0t0V5ExE=; b=YcMZ4R1xUbwooVsjPNo36L+LN HlwL4m3fB4M0+v7JrdMwKANQyPpnXzJ8J8hWurSgt77W+gVKNwB7IRekgx0aBpXfH2FUvavwrTGMY zFutUwB8lFYgo/XoBX/Rm9BuSeTd66yQq+JJH0D2v/YDXtP6Q1b76cumJdhz6SeyPawndQO/Y2Pgq /VEhLsP+LT19+m8xWqO+WEZOiCg/vj5kyXnaoBtMPuvC5GtVc4O5fmRIiMm7erFNTzF7ZupdOJZ7u fOYJZ9Wagj8/Wvcyx1k3oAXIGwCbRKsuppGVbabTFdBp6PoE/jE4zgTLqE9JdwSAdRhsWvW5eW4B1 XTjUH8+Fg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIu5p-00040v-Jh; Thu, 17 Sep 2020 13:36:57 +0000 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIu5l-0003zy-RR for linux-arm-kernel@lists.infradead.org; Thu, 17 Sep 2020 13:36:55 +0000 Received: by mail-ot1-x343.google.com with SMTP id u25so1904217otq.6 for ; Thu, 17 Sep 2020 06:36:52 -0700 (PDT) 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=7MUyxXt0omr5Z++3de7TCUjvA82CnAeEC/F56vNMODk=; b=HXYs+8eC1GslmfL/aX+kKHMPx8rvrBdB2TrgYcMgsbfd5wgdT9mct2H4VVUYguVybm NwywZerov+vh96IbzqZ3D2VPHvwOikISP8Ir/SFAr9lyPc/u2QAdxBL01rF1kFUFxEMW JVRAK21wa1m8i3rXci4/+ZzIelzbf+Kk669ybbR3ChBAl0TaqOh4H8AbTzPjUmB5wVro PrXJSrWHxQsAjkB5ngixVHbfpu1xqgziXyGm8sJ7bXp9xnhy1SVWlq+qF1ck0B8/TUEC FtI63u1W0rwjcXJPOmM22R/FwCbJK0p51XcRWustImItBDfhI7RucBb3skgoU68x0unh PHNw== 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=7MUyxXt0omr5Z++3de7TCUjvA82CnAeEC/F56vNMODk=; b=H8uWWB9PBYzkRr+B7m9+u4smUMBS1lYQEQvypD4n3nG6IX26JFHqMyEjUx8upDfbRL zjXrf5S8+41TSIY395yzwXgvgyUIBNFKk4sQiY+ig6yc4U3DjV0JhXfwpb8TTAndzR9m s9l4mDXdB3z5j22KF6CLMx4aJS86Yxx4yaf5MepQsRTfKuwjQlw12z8rMLIFeWa/cAOG k6I0cI6j6NmCS/KdQCFErxPMy7UzUlSXHqjWeHiLeSBaIzHYIVFhy57rysFTQj/cSv6V aLuE+7topIfjL4i2F8qx34VIXir3NxpBHlxnb2x4B4OgZOJwLX+IBUazGYQl209ecoI7 PwOA== X-Gm-Message-State: AOAM530JXLqvUa6bpNUpS0sJ7LLPeXt0PwjJzk+oLqAO6z43mUlinJ/5 QvS04EwoGOKb4iC5UlXcG9S6yODwg8PLzGNAjcEGaw== X-Google-Smtp-Source: ABdhPJxU0xVmau4OEGmnhsyytheTJoy8l/k52wxgEQ7xbpBN4eo+/T77qCCaEZhvAqls/265mnU7hUVZjZSM0+yswms= X-Received: by 2002:a05:6830:1e8c:: with SMTP id n12mr20767604otr.17.1600349810413; Thu, 17 Sep 2020 06:36:50 -0700 (PDT) MIME-Version: 1.0 References: <20200915132046.3332537-1-elver@google.com> <20200915132046.3332537-2-elver@google.com> <20200917132610.1964-1-hdanton@sina.com> In-Reply-To: <20200917132610.1964-1-hdanton@sina.com> From: Marco Elver Date: Thu, 17 Sep 2020 15:36:38 +0200 Message-ID: Subject: Re: [PATCH v2 01/10] mm: add Kernel Electric-Fence infrastructure To: Hillf Danton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200917_093654_225707_37BFA49F X-CRM114-Status: GOOD ( 19.39 ) 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: Andrey Konovalov , Andrew Morton , Alexander Potapenko , Linux ARM , Linux Memory Management List 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 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? 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. Thanks, -- Marco _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel