From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f71.google.com (mail-oi0-f71.google.com [209.85.218.71]) by kanga.kvack.org (Postfix) with ESMTP id 57C796B7ED6 for ; Fri, 7 Sep 2018 12:06:34 -0400 (EDT) Received: by mail-oi0-f71.google.com with SMTP id l14-v6so17419336oii.9 for ; Fri, 07 Sep 2018 09:06:34 -0700 (PDT) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0106.outbound.protection.outlook.com. [104.47.1.106]) by mx.google.com with ESMTPS id q205-v6si5656087oib.63.2018.09.07.09.06.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Sep 2018 09:06:33 -0700 (PDT) Subject: Re: [PATCH v6 16/18] khwasan, mm, arm64: tag non slab memory allocated via pagealloc References: From: Andrey Ryabinin Message-ID: <3f2dee71-1615-4a34-d611-3ccaf407551e@virtuozzo.com> Date: Fri, 7 Sep 2018 19:06:42 +0300 MIME-Version: 1.0 In-Reply-To: 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 , 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 On 08/29/2018 02:35 PM, Andrey Konovalov wrote: > void kasan_poison_slab(struct page *page) > { > + unsigned long i; > + > + if (IS_ENABLED(CONFIG_SLAB)) > + page->s_mem = reset_tag(page->s_mem); Why reinitialize here, instead of single initialization in alloc_slabmgmt()? > + for (i = 0; i < (1 << compound_order(page)); i++) > + page_kasan_tag_reset(page + i); > kasan_poison_shadow(page_address(page), > PAGE_SIZE << compound_order(page), > KASAN_KMALLOC_REDZONE);