Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp6313808imd; Wed, 31 Oct 2018 09:50:31 -0700 (PDT) X-Google-Smtp-Source: AJdET5f9vroSmhRZpYfhgYjPA3SwckQfajlSjtwi4y4e+O4eE6WRqRCdUJfWrGSZgg6Yya+8w5Az X-Received: by 2002:a63:77ce:: with SMTP id s197mr3835722pgc.89.1541004631264; Wed, 31 Oct 2018 09:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541004631; cv=none; d=google.com; s=arc-20160816; b=Tprw6/49HKYmBH5+rm4G34HAV8p9IjIhGZM7MM/Z/vDWPvb7o3YvvfTW7ikpelax8j 1gkf3mMKLROyFAz1Y5tGlP5Tye3pOs0cNfk26Wlph6KHLWYL4Dm09XCutVUWXzh/hPQa KlHHDCSyWZG8QI+l6QyJEBfsbWf+RRX0WAK++NiJguYD3RYewUbovhfVYDF/rQr1UTVi UQsSJp0nrS4ZNTwT5YyFRxXDagXI++WeER775NxXDG2MMUtuK74l1T4aSbNzAf5BB/cE Dsce+jNjk5WijhwNu6YU4tbl+rsQthEEKTvHSmCnk8GSelpaITbyYEFOj/F8s2+jevbY HLLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=xy4oimXDgxaqVqVu0b8JZfZ6Ylkw6DhHYPXlNTQB2IY=; b=iSo5tM0Zr4GZc4VI9Ssq5LGc3vAFQT5iG9HIFbirtmoWQ+JVrr4iGVoenff/BxkiIm nNODSatnEcL3zs3ir5Gv+k969iFNwKad+/jvSs9TiZA8Mm3tAX/4Y7dTSzOzm9SW3kGk 5AuAu9xrf3sKBeOB+wsnbATujrikaywLWWVNHks+Ktpp7ZIWen0uBeba7+CIE8ptWbO1 EgiX0FuJ/ZQRJv4kPXPQXxm+9PKpXjG8rCNR1wNoBeREwozDF/sxzh+ZdlCuwZnwq+dW s0635ygvEBmpCONazNNCbWiDb5ln/cUQ5HwaIDFsAX3xyujPkFIn+kQB5LA/qp2rr5Z/ Fteg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62-v6si5952880pla.217.2018.10.31.09.50.16; Wed, 31 Oct 2018 09:50:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730006AbeKABsp (ORCPT + 99 others); Wed, 31 Oct 2018 21:48:45 -0400 Received: from relay.sw.ru ([185.231.240.75]:42510 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729916AbeKABso (ORCPT ); Wed, 31 Oct 2018 21:48:44 -0400 X-Greylist: delayed 1020 seconds by postgrey-1.27 at vger.kernel.org; Wed, 31 Oct 2018 21:48:42 EDT Received: from [172.16.25.12] by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1gHtQH-0005eh-C5; Wed, 31 Oct 2018 19:32:49 +0300 Subject: Re: [PATCH v9 01/20] kasan, mm: change hooks signatures To: Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Will Deacon , Christoph Lameter , Andrew Morton , Mark Rutland , 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@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 , Jann Horn , Mark Brand , Chintan Pandya , Vishwath Mohan References: <37b1d7e7c372b60e2323b33bf2e57d4e3409df0b.1537542735.git.andreyknvl@google.com> From: Andrey Ryabinin Message-ID: <64a7030a-d6bf-3b52-aa7d-dbb1b25a7bc8@virtuozzo.com> Date: Wed, 31 Oct 2018 19:33:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <37b1d7e7c372b60e2323b33bf2e57d4e3409df0b.1537542735.git.andreyknvl@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/21/2018 06:13 PM, Andrey Konovalov wrote: > Tag-based KASAN changes the value of the top byte of pointers returned > from the kernel allocation functions (such as kmalloc). This patch updates > KASAN hooks signatures and their usage in SLAB and SLUB code to reflect > that. > > Signed-off-by: Andrey Konovalov > --- > include/linux/kasan.h | 43 +++++++++++++++++++++++++++++-------------- > mm/kasan/kasan.c | 30 ++++++++++++++++++------------ > mm/slab.c | 12 ++++++------ > mm/slab.h | 2 +- > mm/slab_common.c | 4 ++-- > mm/slub.c | 15 +++++++-------- > 6 files changed, 63 insertions(+), 43 deletions(-) > > diff --git a/include/linux/kasan.h b/include/linux/kasan.h > index 46aae129917c..52c86a568a4e 100644 > --- a/include/linux/kasan.h > +++ b/include/linux/kasan.h > @@ -51,16 +51,16 @@ void kasan_cache_shutdown(struct kmem_cache *cache); > void kasan_poison_slab(struct page *page); > void kasan_unpoison_object_data(struct kmem_cache *cache, void *object); > void kasan_poison_object_data(struct kmem_cache *cache, void *object); > -void kasan_init_slab_obj(struct kmem_cache *cache, const void *object); > +void *kasan_init_slab_obj(struct kmem_cache *cache, const void *object); > > -void kasan_kmalloc_large(const void *ptr, size_t size, gfp_t flags); > +void *kasan_kmalloc_large(const void *ptr, size_t size, gfp_t flags); > void kasan_kfree_large(void *ptr, unsigned long ip); > void kasan_poison_kfree(void *ptr, unsigned long ip); > -void kasan_kmalloc(struct kmem_cache *s, const void *object, size_t size, > +void *kasan_kmalloc(struct kmem_cache *s, const void *object, size_t size, > gfp_t flags); This patch missed couple call-sites, in kmem_cache_alloc_trace() and kmem_cache_alloc_node_trace() in include/linux/slab.h, the return value of kasan_kmalloc() is ignored. Probably worth adding __must_check to functions like this. Once that fixed you can add Reviewed-by: Andrey Ryabinin here and to the rest of the patches. They look fine me.