Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1609828pxb; Mon, 11 Oct 2021 09:25:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBNY9ncITCyyataTAURxF8Txy16nC4/Kj2T03qC1UMYuf6TC95EYIyuWcZxl7tKHVKx79L X-Received: by 2002:a17:90a:a41:: with SMTP id o59mr29942413pjo.243.1633969531748; Mon, 11 Oct 2021 09:25:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969531; cv=none; d=google.com; s=arc-20160816; b=qh5T6t19ig72I3i/AYvmDcq3+JCNc+li4pIR2lCVoQPpTDGhBQ/s9JojfQ+S310BBj +IuI8PXh8/2Kp07JUFURtLyggw5YDen2itFE6H+vpZzi4lBRuTBmi+ey7zoMk9ekRPyb CEUZYIw7p4lQeWHNaXBoOn4sXm28rAIFiAyxK/JxTq8iCwCV+JsQUh3K1GaQPbBmAoOC 6J9oQxYjIYQB6NIvNLZhx66DfBNPF/1yrzOdwrJDA1GHp1f5D/+mqS1qgqZ2+KLoGPrH Yxm2uJW4ggD/FLc+PKUSF6Vi9mSAQdY/sd6euckIRrKZ4qCq1LAlEE/JYWfwImfTokkf O/vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=iA0SHZX1gGZHbmmi5mE/pPb3XyW4EwqX4din08iIm0w=; b=NpLEca9DMzmihydRq34eAPGy3ZGhCsa6qAZmu/syO1AKblPqRAGr0/zHoNFH4FuGo8 ghYiDNY2/7bqKlqk55j2M8mWylAAycJGMh8vx8NNlRUnvnKzYm5HDajuio/6UI6uPgvv Off/ve0vY4ACDcQDBeVFOHh5hrYbuOKzsl4jN7quvBX49Ou6ljmQrjcGRO2cs1I2Kzgr 1iDrVoIcAjfN3J1S15xWU0/v3DeOWcyNNTEYMEw/7be8ASwbYVpCpSEvAeIuy0JWXJtv Smz18vSXnjzUjzXeSA+Kypy7IZZyxiqDq0Qx2gwsNw6VJjBTZkQ9KnCm1ZEpZDYbigvH t4Yw== 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 d12si11887384pgg.456.2021.10.11.09.25.19; Mon, 11 Oct 2021 09:25:31 -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 S236537AbhJKMYJ (ORCPT + 99 others); Mon, 11 Oct 2021 08:24:09 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:14325 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235265AbhJKMYJ (ORCPT ); Mon, 11 Oct 2021 08:24:09 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HSd8Z4KrBz8yVD; Mon, 11 Oct 2021 20:17:18 +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:22:07 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 20:22:06 +0800 Message-ID: <5077aa7e-0167-33b6-35f0-0ea7df8f2375@huawei.com> Date: Mon, 11 Oct 2021 20:22:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: [PATCH] mm: kasan: Fix redefinition of 'kasan_populate_early_vm_area_shadow' Content-Language: en-US To: , Andrew Morton CC: , , , , , , , , , Linux Kernel Functional Testing , Catalin Marinas References: <20211011123211.3936196-1-wangkefeng.wang@huawei.com> From: Kefeng Wang In-Reply-To: <20211011123211.3936196-1-wangkefeng.wang@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggeme714-chm.china.huawei.com (10.1.199.110) 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 On 2021/10/11 20:32, Kefeng Wang wrote: > 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. Correct Andrew's mail. > > 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) > { >