From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f200.google.com (mail-io0-f200.google.com [209.85.223.200]) by kanga.kvack.org (Postfix) with ESMTP id EE82A6B0006 for ; Tue, 22 May 2018 10:17:13 -0400 (EDT) Received: by mail-io0-f200.google.com with SMTP id s2-v6so14919460ioa.22 for ; Tue, 22 May 2018 07:17:13 -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 k82-v6sor8966427iok.239.2018.05.22.07.17.11 for (Google Transport Security); Tue, 22 May 2018 07:17:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <427db6b29eaf61d77cb485e9e0a393d34741e498.1525798753.git.andreyknvl@google.com> From: Andrey Konovalov Date: Tue, 22 May 2018 16:17:09 +0200 Message-ID: Subject: Re: [PATCH v1 01/16] khwasan, mm: change kasan hooks signatures 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 , 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 , 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 , Kees Cook , Jann Horn , Mark Brand , Chintan Pandya On Mon, May 14, 2018 at 6:56 PM, Andrey Ryabinin wrote: > > > On 05/08/2018 08:20 PM, Andrey Konovalov wrote: > >> diff --git a/mm/slub.c b/mm/slub.c >> index 44aa7847324a..4fcd1442a761 100644 >> --- a/mm/slub.c >> +++ b/mm/slub.c >> @@ -1351,10 +1351,10 @@ static inline void dec_slabs_node(struct kmem_cache *s, int node, >> * Hooks for other subsystems that check memory allocations. In a typical >> * production configuration these hooks all should produce no code at all. >> */ >> -static inline void kmalloc_large_node_hook(void *ptr, size_t size, gfp_t flags) >> +static inline void kmalloc_large_node_hook(void **ptr, size_t size, gfp_t flags) >> { >> - kmemleak_alloc(ptr, size, 1, flags); >> - kasan_kmalloc_large(ptr, size, flags); >> + kmemleak_alloc(*ptr, size, 1, flags); >> + *ptr = kasan_kmalloc_large(*ptr, size, flags); > > Why not 'return ptr' like everywhere else? Will fix in v2, thanks!