From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f70.google.com (mail-it0-f70.google.com [209.85.214.70]) by kanga.kvack.org (Postfix) with ESMTP id AE7B26B0010 for ; Fri, 29 Jun 2018 10:40:22 -0400 (EDT) Received: by mail-it0-f70.google.com with SMTP id m131-v6so1836886itm.5 for ; Fri, 29 Jun 2018 07:40:22 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id d13-v6sor575064itj.17.2018.06.29.07.40.21 for (Google Transport Security); Fri, 29 Jun 2018 07:40:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180629130155.e7ztz5ikxfl352ff@lakrids.cambridge.arm.com> References: <20180627160800.3dc7f9ee41c0badbf7342520@linux-foundation.org> <20180628124039.8a42ab5e2994fb2876ff4f75@linux-foundation.org> <20180629130155.e7ztz5ikxfl352ff@lakrids.cambridge.arm.com> From: Andrey Konovalov Date: Fri, 29 Jun 2018 16:40:20 +0200 Message-ID: Subject: Re: [PATCH v4 00/17] khwasan: kernel hardware assisted address sanitizer Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Mark Rutland Cc: Andrew Morton , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Will Deacon , Christoph Lameter , Nick Desaulniers , Marc Zyngier , Dave Martin , Ard Biesheuvel , "Eric W . Biederman" , Ingo Molnar , Paul Lawrence , Geert Uytterhoeven , Arnd Bergmann , "Kirill A . Shutemov" , Greg Kroah-Hartman , Kate Stewart , Mike Rapoport , kasan-dev , linux-doc@vger.kernel.org, LKML , Linux ARM , linux-sparse@vger.kernel.org, Linux Memory Management List , Linux Kbuild mailing list , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Jann Horn , Mark Brand , Chintan Pandya On Fri, Jun 29, 2018 at 3:01 PM, Mark Rutland wrote: > On Fri, Jun 29, 2018 at 02:45:08PM +0200, Andrey Konovalov wrote: >> So with clean kernel after boot we get 40 kb memory usage. With KASAN >> it is ~120 kb, which is 200% overhead. With KHWASAN it's 50 kb, which >> is 25% overhead. This should approximately scale to any amounts of >> used slab memory. For example with 100 mb memory usage we would get >> +200 mb for KASAN and +25 mb with KHWASAN. (And KASAN also requires >> quarantine for better use-after-free detection). I can explicitly >> mention the overhead in %s in the changelog. > > Could you elaborate on where that SLAB overhead comes from? > > IIUC that's not for the shadow itself (since it's allocated up-front and > not accounted to SLAB), and that doesn't take into account the > quarantine, so what's eating that space? Redzones. KHWASAN doesn't need them since the next slab object is marked with a different tag (with a high probability) and acts as a redzone.