From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f72.google.com (mail-it0-f72.google.com [209.85.214.72]) by kanga.kvack.org (Postfix) with ESMTP id 3E0666B0006 for ; Tue, 3 Apr 2018 10:45:31 -0400 (EDT) Received: by mail-it0-f72.google.com with SMTP id h81-v6so17112508itb.0 for ; Tue, 03 Apr 2018 07:45:31 -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 n126-v6sor316751itd.106.2018.04.03.07.45.30 for (Google Transport Security); Tue, 03 Apr 2018 07:45:30 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Andrey Konovalov Date: Tue, 3 Apr 2018 16:45:26 +0200 Message-ID: Subject: Re: [RFC PATCH v2 08/15] khwasan: add tag related helper functions Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Andrey Ryabinin Cc: Alexander Potapenko , Dmitry Vyukov , Jonathan Corbet , Catalin Marinas , Will Deacon , Marc Zyngier , Christopher Li , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Masahiro Yamada , Michal Marek , Mark Rutland , Ard Biesheuvel , Yury Norov , Nick Desaulniers , Suzuki K Poulose , Kristina Martsenko , Punit Agrawal , Dave Martin , Michael Weiser , James Morse , Julien Thierry , Steve Capper , Tyler Baicar , "Eric W . Biederman" , Thomas Gleixner , Ingo Molnar , Paul Lawrence , Greg Kroah-Hartman , David Woodhouse , Sandipan Das , Kees Cook , Herbert Xu , Geert Uytterhoeven , Josh Poimboeuf , Arnd Bergmann , kasan-dev , linux-doc@vger.kernel.org, LKML , Linux ARM , kvmarm@lists.cs.columbia.edu, 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 , Kees Cook , Jann Horn , Mark Brand On Fri, Mar 30, 2018 at 6:13 PM, Andrey Ryabinin wrote: > > > On 03/23/2018 09:05 PM, Andrey Konovalov wrote: > >> diff --git a/mm/kasan/khwasan.c b/mm/kasan/khwasan.c >> index 24d75245e9d0..da4b17997c71 100644 >> --- a/mm/kasan/khwasan.c >> +++ b/mm/kasan/khwasan.c >> @@ -39,6 +39,57 @@ >> #include "kasan.h" >> #include "../slab.h" >> >> +int khwasan_enabled; > > This is not unused (set, but never used). It's used in the "khwasan: add hooks implementation" patch. I'll move it's declaration there as well. Thanks! > >> + >> +static DEFINE_PER_CPU(u32, prng_state); >> + >> +void khwasan_init(void) >> +{ >> + int cpu; >> + >> + for_each_possible_cpu(cpu) { >> + per_cpu(prng_state, cpu) = get_random_u32(); >> + } >> + WRITE_ONCE(khwasan_enabled, 1); >> +} >> + >