Message ID | 76e40ec9137224352051f1e3ebcd8e8ee95044e1.1541525354.git.andreyknvl@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BEC591803 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 6 Nov 2018 17:30:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A55912ABB5 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 6 Nov 2018 17:30:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 990562AB89; Tue, 6 Nov 2018 17:30:50 +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=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=unavailable 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 44A672AB89 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 6 Nov 2018 17:30:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D4736B034F; Tue, 6 Nov 2018 12:30:46 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7795C6B0353; Tue, 6 Nov 2018 12:30:46 -0500 (EST) 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 5F5C86B0352; Tue, 6 Nov 2018 12:30:46 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by kanga.kvack.org (Postfix) with ESMTP id EB8036B034F for <linux-mm@kvack.org>; Tue, 6 Nov 2018 12:30:45 -0500 (EST) Received: by mail-wm1-f70.google.com with SMTP id j124-v6so11417744wmd.4 for <linux-mm@kvack.org>; Tue, 06 Nov 2018 09:30:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=bOEKal8RBRTtWSpTxNA94ZGJWCyGRWdgsr1BoKcGe9Y=; b=tz/7Ye3DT49MtZmt2C5c9qpfCVvkihTCcTvDnIaHlGgejVlnULEUiqF+lnTwndzfBC FtgNiKF1Pj1StsVPN0CMBqtM0k1SCILbtiBsPab3xA7WqwBg/554mM4Js5Nxwka40/R0 ZwRCHlRClwAw06yn4wBLNE/kuC/OWg4MdX664nxd1O5D308teAi9JdivcrdT1E2cViK4 zTBLr/yGYPrqLMWBU4ejGaVDCcqXH90PvfJwrcjcYxuiuIGc5K0egXhNVfUs5NamI5Vd L8upyDkM8yeZgaaoAIqipVb95m8pdDRNOAYXluwR5FjDgHvH1IQ/T95r6lXbf/5wiSmA 2u3g== X-Gm-Message-State: AGRZ1gL8vuhnAi+b/3H0HbcpKDJEds/M8hKPM7dGkmkljdSAbrwuIjPR n2jqXj7NQCppu0j+TX29M9O4cK3UymWikvZqfqGjYOK6EOsAf0KNQwnwD6tV3wXqc9sxOg6LA38 DZ3Hc3RJuh2IJXxg8R266apyR+7kenm1sCVmj1H/vSfKdpBQiWoN4SBMqIL9oZXMPtP6s5aNPL2 QwxiTM6iaMxL5XuIQSwG8//shb65Ojtr1pFZy0SLRjcmKVfZUwHXXa9uZ/1qzs9nziVi/+91kAu YyPLSM1d12WCY4GhEz4qBiqUlxUDtIknIB50zNQPfCjBNlOckDmSDCHEMhkS7Y7ZyQ4TpPU8Izr kblt4pD5xmBQdt09eGmRAhO5UnGRvWW1SMTpk15iXqg6x7LdeI2SAq6i1XDVzEQL3b1zcJO3i4X 8 X-Received: by 2002:a1c:4407:: with SMTP id r7-v6mr2815536wma.16.1541525445476; Tue, 06 Nov 2018 09:30:45 -0800 (PST) X-Received: by 2002:a1c:4407:: with SMTP id r7-v6mr2815487wma.16.1541525444528; Tue, 06 Nov 2018 09:30:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541525444; cv=none; d=google.com; s=arc-20160816; b=yzZUtvAs3Zi8j19OiS14BDwu/W3hpPrTSPWw5cm+m1RxgSohmlXtv9w0AAP0sUgi4l G80GYyv+DN6FndCLvvuk9QrKv8b9V0TapEpy3qLQ/A57q+ir+BcVI53reSu2yg2dJ7zh lMvTo5gb8WDoyyZNOvaO2L3Ya+KPJ9AGkXaTx7UWH03tflc26GgHQgvsDLMlQN2Hw4dg j8ixzePhKu38JMjTLW0SCX6tiV70TnepuMzY128SgS9Ux6q4N1b4deewZ6T5zU4jrnOQ 21nDnnDOO01NClOP7mnRUPM/KKTkOIafyph5Ghq3BrFAm+b8HjW7QI6OXAXkVZWcRrEt m6WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=bOEKal8RBRTtWSpTxNA94ZGJWCyGRWdgsr1BoKcGe9Y=; b=0gSw8Is72q/CzgYBV4vB2Jw0m4FMf5hgn7CxmS4DgA7uYXT00jjEL9SPlHWcx/qBQA jDD2NLcfI16WkAiMe0Pt1I0z58UVv3u28b6SiNI8Uhwt5Pe+WtKE7ekhyfK9ZXfUjL9U OJVWPSXM/TXAkq5xaauZJLHlVsBjrYnLW3MZXeyVhF+wa3EBiO1mNbI4Ay+p169YMUNw 8gqu8NheFnaRHqGLI2RWtShRbToP7LsN6fb/fkPVAbGffePdaxkJgiyfl3AsYeZ8pJnF 4TZjRvNTZZEHhUEa/0fLuHAYde+a1AhKekTtUCbsHncWkbk7DYRup73GOFS308NMLiep ENtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Y+JaKNNg; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id k140-v6sor1680147wmd.25.2018.11.06.09.30.44 for <linux-mm@kvack.org> (Google Transport Security); Tue, 06 Nov 2018 09:30:44 -0800 (PST) Received-SPF: pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Y+JaKNNg; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bOEKal8RBRTtWSpTxNA94ZGJWCyGRWdgsr1BoKcGe9Y=; b=Y+JaKNNgXBgr6Jwh77JFn54Ud9LeC25orGV/QEwMUJVZJOpZMlBYwv++U+CYCLelPU vj0qUgYsRe3ImvGiWtzR0lfkqoNrpLrIeBHcuByNoVKslQJ9vxAUJSnYAr0poPt78I7D mWqMTMtiao+3C5hZyPLfjow9DWPjGjEwY2dy7x8MPT46QXCjUDa+fOuywqKiokAeQM1j qgoRzxOd08r7H/xMb2tEYutlTFK3SS/4M8LhMUTq2wa29hMVBvGFDu5SYN5Z0r+gF0mW rRw9MzJ+cNMEN8kqmxC1y7d0T7MalzIruz+SoiVY1SLeX4wVbktJFPzOHahQPV5d7jBd pxBQ== X-Google-Smtp-Source: AJdET5dBD0E5xJ40vEso8U5nzyUsyOPliGVN3y8L7pt7/Ig65473+BQawanYnU0kxpouZIDmv1Cubw== X-Received: by 2002:a1c:2dd0:: with SMTP id t199-v6mr2801475wmt.50.1541525444008; Tue, 06 Nov 2018 09:30:44 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:84be:a42a:826d:c530]) by smtp.gmail.com with ESMTPSA id z17-v6sm16328416wrm.65.2018.11.06.09.30.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 09:30:43 -0800 (PST) From: Andrey Konovalov <andreyknvl@google.com> To: Andrey Ryabinin <aryabinin@virtuozzo.com>, Alexander Potapenko <glider@google.com>, Dmitry Vyukov <dvyukov@google.com>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, Christoph Lameter <cl@linux.com>, Andrew Morton <akpm@linux-foundation.org>, Mark Rutland <mark.rutland@arm.com>, Nick Desaulniers <ndesaulniers@google.com>, Marc Zyngier <marc.zyngier@arm.com>, Dave Martin <dave.martin@arm.com>, Ard Biesheuvel <ard.biesheuvel@linaro.org>, "Eric W . Biederman" <ebiederm@xmission.com>, Ingo Molnar <mingo@kernel.org>, Paul Lawrence <paullawrence@google.com>, Geert Uytterhoeven <geert@linux-m68k.org>, Arnd Bergmann <arnd@arndb.de>, "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Kate Stewart <kstewart@linuxfoundation.org>, Mike Rapoport <rppt@linux.vnet.ibm.com>, 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 <kcc@google.com>, Evgeniy Stepanov <eugenis@google.com>, Lee Smith <Lee.Smith@arm.com>, Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>, Jacob Bramley <Jacob.Bramley@arm.com>, Ruben Ayrapetyan <Ruben.Ayrapetyan@arm.com>, Jann Horn <jannh@google.com>, Mark Brand <markbrand@google.com>, Chintan Pandya <cpandya@codeaurora.org>, Vishwath Mohan <vishwath@google.com>, Andrey Konovalov <andreyknvl@google.com> Subject: [PATCH v10 02/22] kasan, slub: handle pointer tags in early_kmem_cache_node_alloc Date: Tue, 6 Nov 2018 18:30:17 +0100 Message-Id: <76e40ec9137224352051f1e3ebcd8e8ee95044e1.1541525354.git.andreyknvl@google.com> X-Mailer: git-send-email 2.19.1.930.g4563a0d9d0-goog In-Reply-To: <cover.1541525354.git.andreyknvl@google.com> References: <cover.1541525354.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
kasan: add software tag-based mode for arm64
|
expand
|
diff --git a/mm/slub.c b/mm/slub.c index fdd4a86aa882..8561a32910dd 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3364,16 +3364,16 @@ static void early_kmem_cache_node_alloc(int node) n = page->freelist; BUG_ON(!n); - page->freelist = get_freepointer(kmem_cache_node, n); - page->inuse = 1; - page->frozen = 0; - kmem_cache_node->node[node] = n; #ifdef CONFIG_SLUB_DEBUG init_object(kmem_cache_node, n, SLUB_RED_ACTIVE); init_tracking(kmem_cache_node, n); #endif - kasan_kmalloc(kmem_cache_node, n, sizeof(struct kmem_cache_node), + n = kasan_kmalloc(kmem_cache_node, n, sizeof(struct kmem_cache_node), GFP_KERNEL); + page->freelist = get_freepointer(kmem_cache_node, n); + page->inuse = 1; + page->frozen = 0; + kmem_cache_node->node[node] = n; init_kmem_cache_node(n); inc_slabs_node(kmem_cache_node, node, page->objects);
The previous patch updated KASAN hooks signatures and their usage in SLAB and SLUB code, except for the early_kmem_cache_node_alloc function. This patch handles that function separately, as it requires to reorder some of the initialization code to correctly propagate a tagged pointer in case a tag is assigned by kasan_kmalloc. Signed-off-by: Andrey Konovalov <andreyknvl@google.com> --- mm/slub.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)