Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1373455pxb; Wed, 4 Nov 2020 07:19:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzF2IvVP2CHwd7thZCY5yh5lXFUUTGF+skipcAiJe1L9OIchDU+6uJMfhPIe1aMh3Ku5jys X-Received: by 2002:a17:906:22c6:: with SMTP id q6mr25222461eja.433.1604503165938; Wed, 04 Nov 2020 07:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604503165; cv=none; d=google.com; s=arc-20160816; b=n953e02Xu5+QhHlZ20mruLKJ6JfvwwAykFTv7pEidO96w/MrLpufGla+g/bn4ykoYs qU8OoTho65MULGE14H46VzX+olWUswCDBoCrUoQnCLzaOXfiNhY+cbWao+tpl2t74p/B Rm0XSg6SGIcQLgHAvIBT0Cif4ncy4lCNA+Butieu2y6thcN9F73wS9x3rp538zrVi/dO SkgZqweAP0wN7rpsZKao3bWUwhSSF7AGKpgcCjgDe/gbJ9opJJ6U73BzdtajctjKDP8b 49VJZ5K7CNyIXQTslxzOcz6UlxgzknBDnui5g3Qfyt3mZnsDU1xAEC6JxSYomBzqzpdr K/+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=3oz+jge3s+KLxPkjd9JJaeKDtMt4BIAKRrZrd3MFLg0=; b=wQtSDybWECRXCskxTOvjW4r71vhJJzv+Aes1qbktFIqqZC0RzX083aZHMRp/6+qQO0 ZzEbGSrPwQg6IR3EHdRY9nIl2+3XrgMBiD5IfKeAaE+Oxaq/5Xgmu7J1IV48YIrWBeZ+ P9KTxvGvsmjfG6bvlzhxC6qnzb0A1HQmUfu1mWYcY6UcgrOcAkJnbpoXnTq5QzO3kZp8 GpCh4QFEwwCZtc9de73bOcizWjgxtm91JTkyPmB196CWL6f1YM/UdrezGa1ZjAX7MS7f 6UeGVRXkjYyYd66munvdIJsb9yQE/1yNYF0QFKg8zX/VvRu4KgwIaaU0qMZo1Aoj3VKi 8p3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=H4vUVRsl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q13si1511653edv.421.2020.11.04.07.19.02; Wed, 04 Nov 2020 07:19:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=H4vUVRsl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730488AbgKDPRD (ORCPT + 99 others); Wed, 4 Nov 2020 10:17:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730391AbgKDPRC (ORCPT ); Wed, 4 Nov 2020 10:17:02 -0500 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F2CCC0613D4 for ; Wed, 4 Nov 2020 07:17:02 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id s9so22426015wro.8 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=S9X9PxGol16tSYixwr6g7n/ECyhJLHIOHt8Ha6h/+4e99cl1TJCW4tSYViVw/MuFTW ltigUObbVWFqUG5OKj4GrjWhMtKuEKny4yY8iV4Qr7a/MxZThKhj76mOz2GGBap5lGLC 5b7NIRJq7RwxXuzjNJTXX0nFjYPOHhtxsr5OcKW/CgMZl/9G/Y/Iqx6pVtfKjwI6aTav j+FHzhjJtibs7jg1yxLPHgHQYa+N/vMbuSle6NUjJPkBXh6H0d23nD6uLRDz2rBo1SnQ 1aFPJURm7D/6wwo6h2syz4nCzzXOZenV0NNpxwilJz5H6vMRYjI8/Xo7QiKBOcCE20s/ N2EQ== X-Gm-Message-State: AOAM533oygq+rjqrsRO04hb8ZG68n1unFy85RSbsqjUVftBcaz4EWXpq Vlv08bqmlE2Q/Q1Xqx58zMf0D3yLZr2BoMHwEw30Qw== 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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