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.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,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 781A0C388F9 for ; Wed, 4 Nov 2020 15:17:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D7F092076D for ; Wed, 4 Nov 2020 15:17:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="H4vUVRsl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7F092076D 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 622F06B0073; Wed, 4 Nov 2020 10:17:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F7AC6B007D; Wed, 4 Nov 2020 10:17:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50DB26B0081; Wed, 4 Nov 2020 10:17:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id 236646B0073 for ; Wed, 4 Nov 2020 10:17:03 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B3E661EE6 for ; Wed, 4 Nov 2020 15:17:02 +0000 (UTC) X-FDA: 77447088684.12.size86_0401fa9272c2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 8D78018054902 for ; Wed, 4 Nov 2020 15:17:02 +0000 (UTC) X-HE-Tag: size86_0401fa9272c2 X-Filterd-Recvd-Size: 7242 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Wed, 4 Nov 2020 15:17:01 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id p1so3284592wrf.12 for ; Wed, 04 Nov 2020 07:17:01 -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:content-transfer-encoding; bh=3oz+jge3s+KLxPkjd9JJaeKDtMt4BIAKRrZrd3MFLg0=; b=H4vUVRslVGswQktW6uTlKz4ERUC7RF0H6BU61qylvAbEAF9gd3bft3mtlaPRXGvPXX foxhvpjekNSIn5xpv18qmgCbZGa2qJX4NkLO+XFyIt5IIJ54iq+mWbP448RHhfQkIR2Q opqQxhNzu/y44xFfEPnzXdmo12N/9WlKQ+7hZeKXG0i8ki1OperdYUhucZqgo/VFEKb+ BWfaMz/ggp0YPke5eVHns+YjWZW/lhYoNh95CMcPZhzsNAxxJJOcF3PbgLk0vuqC8ySX UXThh30Q7yQtu19I7M/iW6LU9U7u6CV4bIqONIoA/g3d1eW1TOISqbf2ndQDKQDYIWyc QZ9A== 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:content-transfer-encoding; bh=3oz+jge3s+KLxPkjd9JJaeKDtMt4BIAKRrZrd3MFLg0=; b=fuVbZy+8sGsixnQOIGKYsmeHV5FC6U6tOT/VaL0T0rkHTzwYAIHTRsV4SV88PHG6bt +DJ2Nq+7Z/HqJitiuHGq7dWQGkcEXty58JkAo6+rV/0zs8qBEnPjqgQwjL1xskx5ZyV5 Ka8HRtinoCd7Z6M3nT62+mHkwg0Iz7XGcq5gCRYLQTQzVNF8cOWlCCIO4QIdkteZOTZM wUms/fSspI6SocSryFIv3exP6gPh1o8+b67nsSMp3ZnlyirflAvDjdJzZ9ocRVVekmLR 8AwqQ0ec86CNtyWZbCe4KAzmPvtNR5jTNfoD80wetZBrhtAGL8bBz7r+dpiVHVeBPhju 2WBw== X-Gm-Message-State: AOAM531HMOqekryhQgswT7XuJmNjlzXvUcQORijXcT/Bd+rAkBlh2VRi noBiLoJ3PmJDWk3DHNNUs+BA9HIsyLjGXJdbwF5cgA== X-Google-Smtp-Source: ABdhPJyDgXGI/PJcCnAYlipgyUWtUpd2n0eMy2oUke7ZUq3ABr2ft1z4Yy2zt0k/xLyq/L7e1MvnVurfagWCQ2rLFmQ= X-Received: by 2002:adf:e486:: with SMTP id i6mr32693599wrm.397.1604503020514; Wed, 04 Nov 2020 07:17:00 -0800 (PST) MIME-Version: 1.0 References: <20201103175841.3495947-1-elver@google.com> <20201103163103.109deb9d49a140032d67434f@linux-foundation.org> In-Reply-To: From: Alexander Potapenko Date: Wed, 4 Nov 2020 16:16:49 +0100 Message-ID: Subject: Re: [PATCH v7 0/9] KFENCE: A low-overhead sampling-based memory safety error detector To: Marco Elver , Dmitriy Vyukov , Vlastimil Babka , Andrey Konovalov , Andrew Morton , Andrey Ryabinin , Jann Horn , Thomas Gleixner Cc: "H. Peter Anvin" , "Paul E. McKenney" , Andy Lutomirski , Borislav Petkov , Catalin Marinas , Christoph Lameter , Dave Hansen , David Rientjes , Eric Dumazet , Greg Kroah-Hartman , Hillf Danton , Ingo Molnar , Jonathan Cameron , Jonathan Corbet , Joonsoo Kim , =?UTF-8?Q?J=C3=B6rn_Engel?= , Kees Cook , Mark Rutland , Pekka Enberg , Peter Zijlstra , SeongJae Park , Will Deacon , "the arch/x86 maintainers" , "open list:DOCUMENTATION" , LKML , kasan-dev , Linux ARM , Linux Memory Management List Content-Type: text/plain; charset="UTF-8" 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 Wed, Nov 4, 2020 at 1:36 PM Marco Elver wrote: > > On Wed, 4 Nov 2020 at 01:31, Andrew Morton wr= ote: > > On Tue, 3 Nov 2020 18:58:32 +0100 Marco Elver wrote= : > > > > > This adds the Kernel Electric-Fence (KFENCE) infrastructure. KFENCE i= s a > > > low-overhead sampling-based memory safety error detector of heap > > > use-after-free, invalid-free, and out-of-bounds access errors. This > > > series enables KFENCE for the x86 and arm64 architectures, and adds > > > KFENCE hooks to the SLAB and SLUB allocators. > > > > > > KFENCE is designed to be enabled in production kernels, and has near > > > zero performance overhead. Compared to KASAN, KFENCE trades performan= ce > > > for precision. The main motivation behind KFENCE's design, is that wi= th > > > enough total uptime KFENCE will detect bugs in code paths not typical= ly > > > exercised by non-production test workloads. One way to quickly achiev= e a > > > large enough total uptime is when the tool is deployed across a large > > > fleet of machines. > > > > Has kfence detected any kernel bugs yet? What is its track record? > > Not yet, but once we deploy in various production kernels, we expect > to find new bugs (we'll report back with results once deployed). > Especially in drivers or subsystems that syzkaller+KASAN can't touch, > e.g. where real devices are required to get coverage. We expect to > have first results on this within 3 months, and can start backports > now that KFENCE for mainline is being finalized. This will likely also > make it into Android, but deployment there will take much longer. > > The story is similar with the user space version of the tool > (GWP-ASan), where results started to materialize once it was deployed > across the fleet. > > > Will a kfence merge permit us to remove some other memory debugging > > subsystem? We seem to have rather a lot of them. > > Nothing obvious I think. KFENCE is unique in that it is meant for > production fleets of machines (with ~zero overhead and no new HW > features), with the caveat that due to it being sampling based, it's > not so suitable for single machine testing. The other debugging tools > are suitable for the latter, but not former. Agreeing with everything Marco said I can only add that it would be nice to have a separate discussion about the existing memory debugging subsystems and the need to remove any of them. Having many tools in a toolbox does not hurt, but we need to ensure that all the tools in question are visible to the users (so that people know when and how to use them), can find important bugs and do not duplicate each other. > Thanks, > -- Marco --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg