From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by kanga.kvack.org (Postfix) with ESMTP id 296806B0007 for ; Mon, 14 May 2018 12:55:22 -0400 (EDT) Received: by mail-pf0-f200.google.com with SMTP id q15-v6so10994922pff.17 for ; Mon, 14 May 2018 09:55:22 -0700 (PDT) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0098.outbound.protection.outlook.com. [104.47.0.98]) by mx.google.com with ESMTPS id w2-v6si10187100plk.79.2018.05.14.09.55.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 May 2018 09:55:20 -0700 (PDT) Subject: Re: [PATCH v1 01/16] khwasan, mm: change kasan hooks signatures References: <427db6b29eaf61d77cb485e9e0a393d34741e498.1525798753.git.andreyknvl@google.com> From: Andrey Ryabinin Message-ID: Date: Mon, 14 May 2018 19:56:20 +0300 MIME-Version: 1.0 In-Reply-To: <427db6b29eaf61d77cb485e9e0a393d34741e498.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: > 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?