Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1609418pxb; Mon, 11 Oct 2021 09:25:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4R/cBoSrYI9/WeZojyFZQkG7rDdR7bgkqJbNe5lYV9z8QNAi1QI9j+imEurDCi/emwsk8 X-Received: by 2002:a17:902:b717:b029:11a:fae3:ba7c with SMTP id d23-20020a170902b717b029011afae3ba7cmr25372544pls.28.1633969502820; Mon, 11 Oct 2021 09:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969502; cv=none; d=google.com; s=arc-20160816; b=LE3gPhiL4uuMEfWPT5JAh4YP+VFAh25qVJxfQBxi20wgVXoXscZHUQEriYPyiIgfpk n4hdx1Tq+B84aXPSRkNFI5eS9mbJVS6JcvxhMxtSyZBWlLMwKuS9TR5nOHVoC8Pns2x7 i9mzURolIBPm+YqW2/mM1WS1hQsrG82hZgweEPiprkH9JDCD6EUpId9dtvFVU8QKSxDR B0+V8OGsu8+0nANJL4Ob8uKsopnFXIyJnyatoJOc+PAbpKEgDLv5xbe3lmJ9ZIzLxC/5 CJB4KBq8fuYR88gG0qi3I35rLJqp3t2l5k4BOWQYEE2rPMSIyYQLGOVw4ekaJRc42hsl PjTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=P29fbCCYSVrQV+E5E5TGvjIFfKyEo/S1NyHnLC5JPTA=; b=0WCQZHldPGBH3bsIjCYeV3Gm0IhnWu491aO7pHf5zqKqLsX/fwzbmPCFhb2s9UwTr0 AJU3Acs0TqJ0KBcfHS5MAwQj0P4m/4iJZVewAzxNVIJVZ0pOiV8nAGYJTSMPma52z6sJ gPq64h1CfaJAPz3+Z+j3wrOo1CA7CrkZUbYgX7KIvruL8qP4J8zp4jAY1aXB9cza1cm4 iUPBtd6j9YOaPQ0acsIHl9iXcJy/UMn+tDug3h1RY+WB7en5TikImK6bQ5sS2dX8i98V HHJYXOw5Fy7DVc4X+jagq+0Nj6zUG5Jx44uGQ91iPE1ihc3oEWO2M+m11pyUv/XGXxYc yElA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w20si11641787plq.240.2021.10.11.09.24.50; Mon, 11 Oct 2021 09:25:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236514AbhJKMTT (ORCPT + 99 others); Mon, 11 Oct 2021 08:19:19 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:28915 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235094AbhJKMTT (ORCPT ); Mon, 11 Oct 2021 08:19:19 -0400 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) { -- 2.27.0