From patchwork Tue May 15 14:06:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Ryabinin X-Patchwork-Id: 10401177 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D26B600F4 for ; Tue, 15 May 2018 14:05:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05C432881E for ; Tue, 15 May 2018 14:05:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8E3C2882E; Tue, 15 May 2018 14:05:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 908B22881E for ; Tue, 15 May 2018 14:05:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 33D156B029D; Tue, 15 May 2018 10:05:44 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2EE4A6B029E; Tue, 15 May 2018 10:05:44 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 141EC6B029F; Tue, 15 May 2018 10:05:44 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id B4BC46B029D for ; Tue, 15 May 2018 10:05:43 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id r63-v6so125952pfl.12 for ; Tue, 15 May 2018 07:05:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=XSY0gMLCmb5i9IQ9fIaG4WLl7MVUJ7L382jws/5dtOE=; b=a069G46ayJg9R5TcXC91TWbgLUU4qkADXPfqCr919zuGRsUNTAX2S9BekknVfMJAwB IKcgyWQL5TCcZQBznLSdj1TN2X+uK2VeK7TkiNwH0Yd70LepaTQi3YfYBmpbFdrzE3W2 ltt0TDWQYTUQT0qJXI5K0E9poqcBnl5ZW9PV1tUFaVNIjMqlwqO1722cXgeuhLXWBtxX K/gsLnD7KBQBHnuuoA6ZRNRTcZV5MsQYoldqPTvQrqN7lbFyKe+q+gNjbLYA2ft05bE8 oARMM1hJ/gb4qs8ndLs2jFFPyQRuJR+JQWHZ6+7qETSNiQi3Fa0mQgSOXJ5YdA3GCkCP K41g== X-Gm-Message-State: ALKqPwcFowWwo9FJbGpSTBZz/fC0qSBVDzHKCTXzgk6fnKJhwCH5gdqr muIavYglmdnoZse8F8Jt9gsO1BJYbTYuFN9nmoI1lERmU1m9I3EJ/1MD0yas1v9NxJuhM1ZXC9R /TcKZl7glwJRf/RXrWZllh0jFotcFO5KVEaI6nFx7PqcGoJWTkNg3/xLm1h9+THQqzA== X-Received: by 2002:a63:730c:: with SMTP id o12-v6mr12203630pgc.1.1526393143284; Tue, 15 May 2018 07:05:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqC+zX1MS/unpqc7smfxCM1JyrqWkIXAPybGjXZDcVs1ZUmkX9jJlzZQHSVkrbRXTQDYxVD X-Received: by 2002:a63:730c:: with SMTP id o12-v6mr12203575pgc.1.1526393142223; Tue, 15 May 2018 07:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526393142; cv=none; d=google.com; s=arc-20160816; b=edqG5JMb80m8vWWq4U6IT2ioD03W2MpKjZ1sKA7YVFttHviELjH90SApHvAMKoOx85 13R3gXU6oqXUmElF2JhBXd7OjwtxGbONdAhPKvAmEWLWjrgdZ3FuAZ7TonpUego9ePLK FNdRscEIkXsOjX1CU2xFrDn8jLIuyV28e7F6KASLYfMunsP1FdCBi+SSVeryIe96Paum H6n/Og+Bl6Cu1fyXdBeh6YKq1ORPwGtiLgLZL3lkHXYjEvERZpkhjkyoj7pBWke4ogoW KUdiL1dE9mzWzwygO06ycCDRZiEeU9cGM0nVgyb8G6WfcoQcgEaE02cJTjjVbbp7BOUW pHtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=spamdiagnosticmetadata:spamdiagnosticoutput :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=XSY0gMLCmb5i9IQ9fIaG4WLl7MVUJ7L382jws/5dtOE=; b=HUIaRluN+NEwTciYVi6rVBEtjkgpJM8NodDWEIGOD/8fqRjeBoUNJRBQMwhHxTUFR0 s6BWU8jLZzCKnK8liJJOsn+VB4DxM68OOnikj5XZyxrDTGFfSi6ir9b5yto1U3uR0Y1M D1+d1PnWYKFKlVjq7sYN3QFcFOgkNQXYWeh9IZgNmhWZhyUB70pwi4sr0HK3AtvODQUm 52jZ2ANNMCWm8H3m9XzPL2+pIQNPJNYSNwWxUybio8BeFk2mQVpDgSyu/zSaUD0Hr5FX P4HB/POSL5XrMQ1LevYIF7LIb3hm0XExl0i3PZcuLLq8VcLDTiLxAuZsvR4qJviQ0qa+ umKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=PvJS7VW5; spf=pass (google.com: domain of aryabinin@virtuozzo.com designates 40.107.3.102 as permitted sender) smtp.mailfrom=aryabinin@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30102.outbound.protection.outlook.com. [40.107.3.102]) by mx.google.com with ESMTPS id k130-v6si108884pgc.81.2018.05.15.07.05.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 May 2018 07:05:42 -0700 (PDT) Received-SPF: pass (google.com: domain of aryabinin@virtuozzo.com designates 40.107.3.102 as permitted sender) client-ip=40.107.3.102; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=PvJS7VW5; spf=pass (google.com: domain of aryabinin@virtuozzo.com designates 40.107.3.102 as permitted sender) smtp.mailfrom=aryabinin@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=XSY0gMLCmb5i9IQ9fIaG4WLl7MVUJ7L382jws/5dtOE=; b=PvJS7VW5ZSGZUo211nn/rK7qc0zCZ7eD9IkS3+M7I1EBQEi8VcPsWpgTyZSBmY2Ui1GVLQJLTu0tjejz6zuEEBOdQ1eEVar1JzTEre4FAEMRHuU4HnR43nC3nac8EXuN+3E0TYmHnwvLuXy7QBWTHoqmpVBmOidOejsKt1VcRuk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; Received: from [172.16.25.12] (195.214.232.6) by DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:1f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Tue, 15 May 2018 14:05:32 +0000 Subject: Re: [PATCH v1 15/16] khwasan, mm, arm64: tag non slab memory allocated via pagealloc 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 References: <52d2542323262ede3510754bb07cbc1ed8c347b0.1525798754.git.andreyknvl@google.com> From: Andrey Ryabinin Message-ID: <0043ffdf-4a75-d41c-966e-073eac3dc557@virtuozzo.com> Date: Tue, 15 May 2018 17:06:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <52d2542323262ede3510754bb07cbc1ed8c347b0.1525798754.git.andreyknvl@google.com> Content-Language: en-US X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR05CA0173.eurprd05.prod.outlook.com (2603:10a6:3:f8::21) To DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:1f::22) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB7PR08MB3260; X-Microsoft-Exchange-Diagnostics: 1; DB7PR08MB3260; 3:p+ZMuBSlDMjMUEMG/NuOsgZioKo3fCtyLGwKIOmCi8nbNpBkv36oH8dW0y0UWhbnO3GyVM8qlnCBFIpdpPAuiymcSy0SBs+SoyPyz4JMd/8kkLRsM1+L9ZeytoeoTiSac2/1Lo+jV0WaZpAwtpluXx9PV8WHUknJvTtDEbxnFSKz4zUWPj/VUEAojJbdYhUNQHd4+rVCRUQpCQpcva5qbW5gpTO+3Jaqi/ko9mktmhpARhA9A5KrApwQYCXdhSRH; 25:mp8aQTIM2tumw3ddNYeqhoPwH6Hxws1XIfdQEfR1GuzzDSWTPETAjw5Vx/ou8EhjB/vCMFQw+JRlg3cxfUmJwp03rtmLrIq7aS2NAb70s+ObeTe3RWbaascjuz2GWzWYYyfuOlGaPm+dZGBOdxU+Fyb73f/kMoQxluemxV8IIAXe27wpRHFpLyldngeZohowc0StKu44ySIw4r8Y3NwnDdEBXDC31gDr7BOLtG4e6xZEwT10+nz83eL1uzluRjSVUgHQEeaRT+dETTfs1WkctdeAlAkKiQnUzCNXqblF0qA51Xuyw3jYHtudcx6bKfDmtj6UjjdUd4RE7YUM94Q8Zg==; 31:YVsrJcV1jQU7D6g5xwIafKOmgFgLhIRoegYqyb7WGVQu71DcdUb/zzawrcOnNigtDI7xQ1n+kCl3BRwxIeggR7r7cIktgBKfoyfIPAlgAESdJAyrtztW9yWc5qauT7FD0rA927Sc6cMMOAIuMTHJAVznco1ZRGB7F3RbKDVDhVVR4iHPDgVzBtf9j2yka0P4Xy8QNYIByN2nWuvnoKi3QACdi22W717GxRkzHl0O1wU= X-MS-TrafficTypeDiagnostic: DB7PR08MB3260: X-Microsoft-Exchange-Diagnostics: 1; DB7PR08MB3260; 20:adnQXCc+j+rdJL9JFmv7g627xb7JUlR03W0qpw6kCBrIwrRfYRJGDQdXuU8+ry5XDJ5knvBmmKhJWcUZ6/EweGxTyNVTHmhcfV2z8V3dkrZAq0DPVXIq2BoAvUCNAWzfTJhI+Dnb3AROnp6DfOdm3vJ0MM9sn1wkh/wXEgJPWHuaG+zrcPycCH2uOvivWLoYgSbnyK9PHwFSjlAoU/p7FQvFsC/GVeLeJuRO+RE+2eWDCJs8dm1eWlEEwu48pv2YVrDEcFCicYt8VniIQn8F6xngnOOATDpbSkX70WR9ynGvS6v/38xaqbJRTdLSgHTC6X57HWk17Yp3Uyfz3xljS7FOaZO+0VT3C9RGiPRGrvKjvMIzHrEprr+5Cu/32JlnQdQbuGXEAEo3913ME7OxNpTs6QMbwvYxCyLc3WAbswvUTnC4642ldcvX8zSDLPJpYT+fp6TEaQLovuf+TgEK6UGUyQu/KIBPi9Cc+wn82ax+eKk2/3+j1a4U9jmkj+j7; 4:fhlxvJBOMWgC7+amJVJkJbhg3OYxGrzWaal8Lf6wue9746ifGUTpTGzOGuxKZ+KgLaHy6Imkq8wyJGVHC4HhoSBsXdapEb1vavwQTfBmX0PII1bPG1gCmHglJbOn6rKXRRZCkMMhEpETXYt3HgdAgA8uVdIvIdPXVBexgRYgWWKhLGokJc5/jh0xzY8SEhiub+w65CJl4YO9uv7gt14b9mYBItrpvjGCs1kkBpqxjwPdjCyPznR/EKc3kxM3d401B1bcpC2WRTePkeyZHf0/Zg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:DB7PR08MB3260; BCL:0; PCL:0; RULEID:; SRVR:DB7PR08MB3260; X-Forefront-PRVS: 0673F5BE31 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6049001)(376002)(366004)(396003)(346002)(39850400004)(39380400002)(189003)(199004)(53936002)(66066001)(478600001)(6246003)(65806001)(65956001)(4326008)(7336002)(6666003)(36756003)(47776003)(5660300001)(65826007)(97736004)(1191002)(64126003)(230700001)(7416002)(39060400002)(229853002)(25786009)(7366002)(305945005)(7406005)(6486002)(1511001)(7736002)(31686004)(26005)(186003)(16526019)(50466002)(6116002)(31696002)(575784001)(86362001)(68736007)(3846002)(105586002)(106356001)(54906003)(2906002)(52146003)(23676004)(76176011)(52116002)(2486003)(386003)(8676002)(55236004)(53546011)(8936002)(59450400001)(81156014)(77096007)(476003)(2616005)(11346002)(8666007)(486006)(110136005)(956004)(316002)(16576012)(81166006)(446003)(58126008)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:DB7PR08MB3260; H:[172.16.25.12]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjdQUjA4TUIzMjYwOzIzOmkxVjAzWnRaN3pxM2RLZ0lzWEhTcUJqbjlO?= =?utf-8?B?YkoyYXB6RWwzWjdLSVh0U3ZaVHZYOTRxYmNORFo1bm02NjNVb3hUQ09EbjV2?= =?utf-8?B?QjhSOUg1S2hieHFtbjVhMGc1ODZLNlc1S1RONGpxUHI3UWZLQ29WNzk3Q2kv?= =?utf-8?B?aWczZldXZWo0bFo0VjBTekoybE0vM1Vmb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4c+6bul5wzvsMhFJZQutlbE4csVrfateNPdA==; 5:UdiM3GrO2oWR/jk+MTzJrldtreqN+f3V5EoGXHDXRSsTPTaxXbvS7kKl5F6HiWw7PDpFfqVWzZtQJ6gGCpvL5Iom5zdzmIo6y+OL2hJFGwWEo6jl6UnNLgERV3yC6toCwBfVzK+Xb6SbYH/vHJHRYTw4IC/TCCqSGuf1c0FVMVY=; 24:rYjD1g9ywD15vRNNMpDu5bg8eGu4AlcWni8GoJBtKrokX7UeLVFNmP0oct5IfvhveL4gG2pM7/jl9F/R8he0C2yf8qKIHO6GssR3XsKuISg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB7PR08MB3260; 7:Ff0cuN4VJO5RCMVPCTetuI902t30Wx4RfunL9oOuTyk/UoJUOgE06KclfHoziI6G5Z129zmAUmECgODulm/cjsk/ARBqIPgau5JtO6uDOEI7LpZZO6iUq0tq79J0cKIeMVRLEl8Q6fBybBInvybD6c28BCUPdZu6wVPQIrUDbgOD+c+JuYu3Jq8OVqZiWzwtf2Yy/JE+OUgiVAT6eS1ofcNkrAfBjlN0Mq0h1BVpkSGic6xzGVKDBLH+7xne/l5q; 20:eaazj2VQ17aDFxFzjDnC/DSiwFnZABl0/gzLyHxXMHV37dkZ+FnIjmjcpqsFscd8pk/+qgwONLTLOw9sb5X/eOlpGarTMlxHg1wAfqGUokj9ZrxfVeRQeEuJLEMwy5muYMRjCxF7ZKhinF0gL4xCawzf+89bBmSyfQyCoAQkjIk= X-MS-Office365-Filtering-Correlation-Id: bb0a4fc5-3f0b-4768-226b-08d5ba6cf01a X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2018 14:05:32.9021 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb0a4fc5-3f0b-4768-226b-08d5ba6cf01a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3260 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP On 05/08/2018 08:21 PM, Andrey Konovalov wrote: > +#ifndef CONFIG_KASAN_HW > #define page_to_virt(page) ((void *)((__page_to_voff(page)) | PAGE_OFFSET)) > +#else > +#define page_to_virt(page) ({ \ > + unsigned long __addr = \ > + ((__page_to_voff(page)) | PAGE_OFFSET); \ > + if (!PageSlab((struct page *)page)) \ > + __addr = KASAN_SET_TAG(__addr, page_kasan_tag(page)); \ You could avoid 'if (!PageSlab())' check by adding page_kasan_tag_reset() into kasan_poison_slab(). > + ((void *)__addr); \ > +}) > +#endif > + > #define virt_to_page(vaddr) ((struct page *)((__virt_to_pgoff(vaddr)) | VMEMMAP_START)) > > #define _virt_addr_valid(kaddr) pfn_valid((((u64)(kaddr) & ~PAGE_OFFSET) \ > diff --git a/mm/cma.c b/mm/cma.c > index aa40e6c7b042..f657db289bba 100644 > --- a/mm/cma.c > +++ b/mm/cma.c > @@ -526,6 +526,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, > } > > trace_cma_alloc(pfn, page, count, align); > + page_kasan_tag_reset(page); Why? Comment needed. > if (ret && !(gfp_mask & __GFP_NOWARN)) { > pr_err("%s: alloc failed, req-size: %zu pages, ret: %d\n", > diff --git a/mm/kasan/common.c b/mm/kasan/common.c > index 0654bf97257b..7cd4a4e8c3be 100644 > --- a/mm/kasan/common.c > +++ b/mm/kasan/common.c > @@ -207,8 +207,18 @@ void kasan_unpoison_stack_above_sp_to(const void *watermark) > > void kasan_alloc_pages(struct page *page, unsigned int order) > { > +#ifdef CONFIG_KASAN_GENERIC > if (likely(!PageHighMem(page))) > kasan_unpoison_shadow(page_address(page), PAGE_SIZE << order); > +#else > + if (!PageSlab(page)) { > + u8 tag = random_tag(); > + > + kasan_poison_shadow(page_address(page), PAGE_SIZE << order, > + tag); > + page_kasan_tag_set(page, tag); > + } > +#endif > } diff --git a/mm/kasan/common.c b/mm/kasan/common.c index b8e0a8215021..f9f2181164a2 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -207,18 +207,11 @@ void kasan_unpoison_stack_above_sp_to(const void *watermark) void kasan_alloc_pages(struct page *page, unsigned int order) { -#ifdef CONFIG_KASAN_GENERIC - if (likely(!PageHighMem(page))) - kasan_unpoison_shadow(page_address(page), PAGE_SIZE << order); -#else - if (!PageSlab(page)) { - u8 tag = random_tag(); + if (unlikely(PageHighMem(page))) + return; - kasan_poison_shadow(page_address(page), PAGE_SIZE << order, - tag); - page_kasan_tag_set(page, tag); - } -#endif + page_kasan_tag_set(page, random_tag()); + kasan_unpoison_shadow(page_address(page), PAGE_SIZE << order); } void kasan_free_pages(struct page *page, unsigned int order)