From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id 222A66B0295 for ; Tue, 15 May 2018 09:27:11 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id e20-v6so60006pff.14 for ; Tue, 15 May 2018 06:27:11 -0700 (PDT) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0103.outbound.protection.outlook.com. [104.47.0.103]) by mx.google.com with ESMTPS id g15-v6si50681pgu.112.2018.05.15.06.27.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 May 2018 06:27:09 -0700 (PDT) Subject: Re: [PATCH v1 02/16] khwasan: move common kasan and khwasan code to common.c References: <454315e28d8bdd8e507de2e29f718f1fcae17d58.1525798753.git.andreyknvl@google.com> From: Andrey Ryabinin Message-ID: <69a5a7d3-e2ae-1100-f56f-9edfb0c4b3dd@virtuozzo.com> Date: Tue, 15 May 2018 16:28:04 +0300 MIME-Version: 1.0 In-Reply-To: <454315e28d8bdd8e507de2e29f718f1fcae17d58.1525798753.git.andreyknvl@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , Jonathan Corbet , Catalin Marinas , Will Deacon , Christopher Li , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Masahiro Yamada , Michal Marek , Mark Rutland , Nick Desaulniers , Yury Norov , Marc Zyngier , Kristina Martsenko , Suzuki K Poulose , Punit Agrawal , Dave Martin , Ard Biesheuvel , James Morse , Michael Weiser , Julien Thierry , Tyler Baicar , "Eric W . Biederman" , Thomas Gleixner , Ingo Molnar , Kees Cook , Sandipan Das , David Woodhouse , Paul Lawrence , Herbert Xu , Josh Poimboeuf , Geert Uytterhoeven , Tom Lendacky , Arnd Bergmann , Dan Williams , Michal Hocko , Jan Kara , Ross Zwisler , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Matthew Wilcox , "Kirill A . Shutemov" , Souptick Joarder , Hugh Dickins , Davidlohr Bueso , Greg Kroah-Hartman , Philippe Ombredanne , Kate Stewart , Laura Abbott , Boris Brezillon , Vlastimil Babka , Pintu Agarwal , Doug Berger , Anshuman Khandual , Mike Rapoport , Mel Gorman , Pavel Tatashin , Tetsuo Handa , kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sparse@vger.kernel.org, linux-mm@kvack.org, linux-kbuild@vger.kernel.org Cc: Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Kees Cook , Jann Horn , Mark Brand , Chintan Pandya On 05/08/2018 08:20 PM, Andrey Konovalov wrote: > + > +void set_track(struct kasan_track *track, gfp_t flags) This was - static inline void set_track(struct kasan_track *track, gfp_t flags) and still used only locally. > +{ > + track->pid = current->pid; > + track->stack = save_stack(flags); > +} > + > /* > * Adaptive redzone policy taken from the userspace AddressSanitizer runtime. > * For larger allocations larger redzones are used. > */ > -static unsigned int optimal_redzone(unsigned int object_size) > +unsigned int optimal_redzone(unsigned int object_size) I'd rather move this in common too. For khwasan you could just add: if (IS_ENABLED(CONFIG_KASAN_HW)) return 0;