Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7686036ybc; Thu, 28 Nov 2019 23:07:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzyvLotoxX0gJIyxNBoF95LfRrd1N+RHSin1vbwD9nq/aw1TNI8oWcs/zMhA245Z059Pd89 X-Received: by 2002:a05:6402:282:: with SMTP id l2mr44118228edv.187.1575011252611; Thu, 28 Nov 2019 23:07:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575011252; cv=none; d=google.com; s=arc-20160816; b=Ulx2TSHWntBTpbs6taTQZdOpwe9o9kaU1vEUxCvhxUl4dM/sWX26UOPCnLI4zDthh2 VFO0LkvazYqCz1c9+ZFoNHrXmzzEd/MFwqhOSbNkqLAqa44yTVEVhhZ3W8+17tMsnlIY zotnzdsHkamIkuR3Mp7zh16Of3jP9FRGqP1n9vglbwHRUK0q1xpSdrgDj7JKEbN6lQUN 9KoDjgNE4UUKMsiyNP8pwex8wt+llNpSTdM6hWMpvH+6F6X38SMzcQRWhAVWRvxhu1vi hf+Q6VivCFQpaJtl8I7fph1JEfsSFzkXLnU/liMwZAGnI6nGEQ2tJ0GAzQESDZTQlPg+ 6lhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=GK/xl/Pnd+42S05OcgqlY0EARUQV7GvbLsKSZcdvMJk=; b=fZUp9p4MHLpZTFQ5BZaxjKiwySlbLcfF26Z8E1AH6AvWCgINwI3eeXIlTWA7xs4DwH IrtzRC83Ei2NqkyYyP70PeBmETA+yyjA5B8/L45pVD+niYNPeXX+K38BlkpA6xewwHcQ yWfPkVGzLqsLP0TkTBFkECDdkmqpRKQ55gckziKnrsJ6OMzNFpSqdxj+i/CNeTqTTHFp H8cGok4twnHw2nD/HMk6xutNSKEo1rR8xzxc+O6rkfvlh1ekq0H5A7SmkpevnymEsK6K Q66CKnNJ2cmt/8PuuIdweZtI/oijr8UcudPDTmeiL0ZwFa90zYazZtSiHyrsZOkZcY2E GtEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l24si14078044edw.352.2019.11.28.23.07.08; Thu, 28 Nov 2019 23:07:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726879AbfK2HFM (ORCPT + 99 others); Fri, 29 Nov 2019 02:05:12 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7177 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726845AbfK2HFL (ORCPT ); Fri, 29 Nov 2019 02:05:11 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 53DBF9292813DBDE57C3; Fri, 29 Nov 2019 15:05:09 +0800 (CST) Received: from huawei.com (10.67.189.2) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Fri, 29 Nov 2019 15:04:55 +0800 From: Lexi Shao To: , , , CC: , , , , , Subject: [PATCH] powerpc/kasan: KASAN is not supported on RELOCATABLE && FSL_BOOKE Date: Fri, 29 Nov 2019 15:04:55 +0800 Message-ID: <20191129070455.62084-1-shaolexi@huawei.com> X-Mailer: git-send-email 2.12.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.189.2] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CONFIG_RELOCATABLE and CONFIG_KASAN cannot be enabled at the same time on ppce500 fsl_booke. All functions called before kasan_early_init() should be disabled with kasan check. When CONFIG_RELOCATABLE is enabled on ppce500 fsl_booke, relocate_init() is called before kasan_early_init() which triggers kasan check and results in boot failure. Call trace and functions which triggers kasan check(*): - _start - set_ivor - relocate_init(*) - early_get_first_memblock_info(*) - of_scan_flat_dt(*) ... - kasan_early_init Potential solutions could be 1. implement relocate_init and all its children function in a seperate file or 2. introduce a global vairable in KASAN, only enable KASAN check when init is done. Disable KASAN when RELOCATABLE is selected on fsl_booke for now until it is supported. Signed-off-by: Lexi Shao --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 3e56c9c2f16e..14f3da63c088 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -171,7 +171,7 @@ config PPC select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_HUGE_VMAP if PPC_BOOK3S_64 && PPC_RADIX_MMU select HAVE_ARCH_JUMP_LABEL - select HAVE_ARCH_KASAN if PPC32 + select HAVE_ARCH_KASAN if PPC32 && !(RELOCATABLE && FSL_BOOKE) select HAVE_ARCH_KGDB select HAVE_ARCH_MMAP_RND_BITS select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT -- 2.12.3