linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: <naresh.kamboju@linaro.org>, <akpm@linux-foundatio.org>
Cc: <andreyknvl@gmail.com>, <dvyukov@google.com>, <glider@google.com>,
	<kasan-dev@googlegroups.com>, <linux-kernel@vger.kernel.org>,
	<linux-mm@kvack.org>, <linux-next@vger.kernel.org>,
	<ryabinin.a.a@gmail.com>, <sfr@canb.auug.org.au>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	"Linux Kernel Functional Testing" <lkft@linaro.org>,
	Catalin Marinas <catalin.marinas@arm.com>
Subject: [PATCH] mm: kasan: Fix redefinition of 'kasan_populate_early_vm_area_shadow'
Date: Mon, 11 Oct 2021 12:32:11 +0000	[thread overview]
Message-ID: <20211011123211.3936196-1-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <CA+G9fYv1Vbc-Y_czipb-z1bG=9axE4R1BztKGqWz-yy=+Wcsqw@mail.gmail.com>

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 <lkft@linaro.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: kasan-dev@googlegroups.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
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



  reply	other threads:[~2021-10-11 12:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 11:38 mm/kasan/init.c:282:20: error: " Naresh Kamboju
2021-10-11 12:32 ` Kefeng Wang [this message]
2021-10-11 12:22   ` [PATCH] mm: kasan: Fix " Kefeng Wang
2021-10-11 12:42 ` mm/kasan/init.c:282:20: error: " Naresh Kamboju
2021-10-11 20:53   ` Andrew Morton
2021-10-12  1:03     ` Kefeng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211011123211.3936196-1-wangkefeng.wang@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundatio.org \
    --cc=andreyknvl@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=lkft@linaro.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=ryabinin.a.a@gmail.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox