From patchwork Mon Oct 11 12:32:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 12549853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0796C433F5 for ; Mon, 11 Oct 2021 12:17:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8157860F3A for ; Mon, 11 Oct 2021 12:17:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8157860F3A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id F19F56B006C; Mon, 11 Oct 2021 08:17:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EC90C6B0071; Mon, 11 Oct 2021 08:17:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB7B9900002; Mon, 11 Oct 2021 08:17:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id CBF7F6B006C for ; Mon, 11 Oct 2021 08:17:26 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6E7D7181555F6 for ; Mon, 11 Oct 2021 12:17:26 +0000 (UTC) X-FDA: 78684056892.39.C909E51 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf12.hostedemail.com (Postfix) with ESMTP id A74DF1000692 for ; Mon, 11 Oct 2021 12:17:24 +0000 (UTC) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HSd3N5MVrzbn3m; Mon, 11 Oct 2021 20:12:48 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 20:17:15 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 20:17:14 +0800 From: Kefeng Wang To: , CC: , , , , , , , , , Kefeng Wang , "Linux Kernel Functional Testing" , Catalin Marinas Subject: [PATCH] mm: kasan: Fix redefinition of 'kasan_populate_early_vm_area_shadow' Date: Mon, 11 Oct 2021 12:32:11 +0000 Message-ID: <20211011123211.3936196-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A74DF1000692 X-Stat-Signature: ey58qxkcwpnqpjg8m1n9c7x9qsf8h3pz Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=huawei.com; spf=pass (imf12.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com X-HE-Tag: 1633954644-885704 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: Move kasan_populate_early_vm_area_shadow() from mm/kasan/init.c to mm/kasan/shadow.c, make it under CONFIG_KASAN_VMALLOC to fix the redefinition issue. Reported-by: Linux Kernel Functional Testing Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: kasan-dev@googlegroups.com Signed-off-by: Kefeng Wang --- Hi Andrew, Could you help to merge this into previos patch "kasan: arm64: fix pcpu_page_first_chunk crash with KASAN_VMALLOC", sorry for the build error. mm/kasan/init.c | 5 ----- mm/kasan/shadow.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/kasan/init.c b/mm/kasan/init.c index d39577d088a1..cc64ed6858c6 100644 --- a/mm/kasan/init.c +++ b/mm/kasan/init.c @@ -279,11 +279,6 @@ int __ref kasan_populate_early_shadow(const void *shadow_start, return 0; } -void __init __weak kasan_populate_early_vm_area_shadow(void *start, - unsigned long size) -{ -} - static void kasan_free_pte(pte_t *pte_start, pmd_t *pmd) { pte_t *pte; diff --git a/mm/kasan/shadow.c b/mm/kasan/shadow.c index 8d95ee52d019..4a4929b29a23 100644 --- a/mm/kasan/shadow.c +++ b/mm/kasan/shadow.c @@ -254,6 +254,11 @@ core_initcall(kasan_memhotplug_init); #ifdef CONFIG_KASAN_VMALLOC +void __init __weak kasan_populate_early_vm_area_shadow(void *start, + unsigned long size) +{ +} + static int kasan_populate_vmalloc_pte(pte_t *ptep, unsigned long addr, void *unused) {