Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1239091pxb; Thu, 23 Sep 2021 23:13:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIt1+hKeQESXjf4vzxiUsgtkMDQQVfCYo/j+QEkTLLhUPFkn/Qg8XpkjB5CeqWUopR92SB X-Received: by 2002:a17:906:ed1:: with SMTP id u17mr9432680eji.304.1632463983690; Thu, 23 Sep 2021 23:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632463983; cv=none; d=google.com; s=arc-20160816; b=jQOmGQ9yqHHXEZlwPIaHOveqbIHwAbHiy9jD/x+BdjNuf7ILHv1G7kpoDXh+WYS9oa 2cBTsInz2Z+Z5a2jdUSrP482dxh2X8uo44yAu6A77wy5SLVfZ6zpxxP2T1Vj75ydPY90 0Mc90GMuirek2qBbTqyLnm74XF8W/Ga/Z0ahTZJEJYcu2Uosm3gIkUtkC8ZZbQ830Ph1 nZoDJsDFYMnsE3A3yVVpiMFA7DyvIZulBy4ixmt4/CwLWxekpfmTyYpiQodXcULjQmUZ KG9fzrVT1+s6plSia3/lj0skcx8SXsLWmoCuV1k/eB7qT3M8dozznkKW/cGC0t23l1ml NUHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=a5Y3ynj4ITCEidy3QfwEY8mzcGfxvG7V1aoRu/W4uhs=; b=HGhFpe4yEUiXJjkzV2KiMaFUD2QmJId5iOjPgOU77HLDblRPgzdgsMm3pY4GzpW37I KAMBIDC7p3oy7DSn5Pa0hiB2cNGZEYY88y7l7CmAsMvfP2UJDqGSuJnyLnJRXCp58CVi UW5V6mjS/gnBWa/krOhd4D9ogrE8SisrSpf/DEut1pcqvlNcGcQEvhiWuP/GFSKMzmDg +pXk9gNUHsTO2SZVKDWYzOBeKmCYwgP5IiIhTIOxbCeIz1tFeVXCe0zlHHBKR4cvv8TE UCmf7T9wBy6yz0t+WKf8QilE/P9ijyO6U6HzoGbLPB2t8zQlHRhWY6FQzfbe/Ih8psa6 a4Qw== 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 f13si9050330edf.345.2021.09.23.23.12.40; Thu, 23 Sep 2021 23:13:03 -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 S244196AbhIXGM4 (ORCPT + 99 others); Fri, 24 Sep 2021 02:12:56 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:16290 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244145AbhIXGM4 (ORCPT ); Fri, 24 Sep 2021 02:12:56 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HG1qG3DrHz8tPs; Fri, 24 Sep 2021 14:10:34 +0800 (CST) Received: from dggpemm500009.china.huawei.com (7.185.36.225) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 24 Sep 2021 14:11:20 +0800 Received: from huawei.com (10.175.113.32) by dggpemm500009.china.huawei.com (7.185.36.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 24 Sep 2021 14:11:20 +0800 From: Liu Shixin To: Marco Elver , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras CC: , , "Liu Shixin" Subject: [PATCH] powerpc: don't select KFENCE on platform PPC_FSL_BOOK3E Date: Fri, 24 Sep 2021 14:39:27 +0800 Message-ID: <20210924063927.1341241-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500009.china.huawei.com (7.185.36.225) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On platform PPC_FSL_BOOK3E, all lowmem is managed by tlbcam. That means we didn't really map the kfence pool with page granularity. Therefore, if KFENCE is enabled, the system will hit the following panic: BUG: Kernel NULL pointer dereference on read at 0x00000000 Faulting instruction address: 0xc01de598 Oops: Kernel access of bad area, sig: 11 [#1] BE PAGE_SIZE=4K SMP NR_CPUS=4 MPC8544 DS Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.12.0-rc3+ #298 NIP: c01de598 LR: c08ae9c4 CTR: 00000000 REGS: c0b4bea0 TRAP: 0300 Not tainted (5.12.0-rc3+) MSR: 00021000 CR: 24000228 XER: 20000000 DEAR: 00000000 ESR: 00000000 GPR00: c08ae9c4 c0b4bf60 c0ad64e0 ef720000 00021000 00000000 00000000 00000200 GPR08: c0ad5000 00000000 00000000 00000004 00000000 008fbb30 00000000 00000000 GPR16: 00000000 00000000 00000000 00000000 c0000000 00000000 00000000 00000000 GPR24: c08ca004 c08ca004 c0b6a0e0 c0b60000 c0b58f00 c0850000 c08ca000 ef720000 NIP [c01de598] kfence_protect+0x44/0x6c LR [c08ae9c4] kfence_init+0xfc/0x2a4 Call Trace: [c0b4bf60] [efffe160] 0xefffe160 (unreliable) [c0b4bf70] [c08ae9c4] kfence_init+0xfc/0x2a4 [c0b4bfb0] [c0894d3c] start_kernel+0x3bc/0x574 [c0b4bff0] [c0000470] set_ivor+0x14c/0x188 Instruction dump: 7c0802a6 8109d594 546a653a 90010014 54630026 39200000 7d48502e 2c0a0000 41820010 554a0026 5469b53a 7d295214 <81490000> 38831000 554a003c 91490000 random: get_random_bytes called from print_oops_end_marker+0x40/0x78 with crng_init=0 ---[ end trace 0000000000000000 ]--- Signed-off-by: Liu Shixin --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index d46db0bfb998..cffd57bcb5e4 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -185,7 +185,7 @@ config PPC select HAVE_ARCH_KASAN if PPC32 && PPC_PAGE_SHIFT <= 14 select HAVE_ARCH_KASAN_VMALLOC if PPC32 && PPC_PAGE_SHIFT <= 14 select HAVE_ARCH_KGDB - select HAVE_ARCH_KFENCE if PPC32 + select HAVE_ARCH_KFENCE if PPC32 && !PPC_FSL_BOOK3E select HAVE_ARCH_MMAP_RND_BITS select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT select HAVE_ARCH_NVRAM_OPS -- 2.18.0.huawei.25