From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 628C1C04AAF for ; Sat, 18 May 2019 11:19:48 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D569F2087E for ; Sat, 18 May 2019 11:19:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D569F2087E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 455jNx593vzDqY4 for ; Sat, 18 May 2019 21:19:45 +1000 (AEST) Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 455jHX5mKszDq7j for ; Sat, 18 May 2019 21:15:04 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Received: by ozlabs.org (Postfix, from userid 1034) id 455jHX4s5tz9sB8; Sat, 18 May 2019 21:15:04 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 6457f42eb3f6e9552366631bd5aeb096ae5f599a X-Patchwork-Hint: ignore In-Reply-To: <20190515094523.8095-1-aneesh.kumar@linux.ibm.com> To: "Aneesh Kumar K.V" , npiggin@gmail.com, paulus@samba.org From: Michael Ellerman Subject: Re: [PATCH] powerpc/mm: Drop VM_BUG_ON in get_region_id Message-Id: <455jHX4s5tz9sB8@ozlabs.org> Date: Sat, 18 May 2019 21:15:04 +1000 (AEST) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Aneesh Kumar K.V" , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, 2019-05-15 at 09:45:23 UTC, "Aneesh Kumar K.V" wrote: > We can call get_region_id without validating the ea value. That means > with a wrong ea value we hit the BUG as below. > > kernel BUG at arch/powerpc/include/asm/book3s/64/hash.h:129! > Oops: Exception in kernel mode, sig: 5 [#1] > LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries > CPU: 0 PID: 3937 Comm: access_tests Not tainted 5.1.0 > .... > NIP [c00000000007ba20] do_slb_fault+0x70/0x320 > LR [c00000000000896c] data_access_slb_common+0x15c/0x1a0 > > Fix this by removing the VM_BUG_ON. All callers make sure the returned region id > is valid and error out otherwise. > > Fixes: 0034d395f89d ("powerpc/mm/hash64: Map all the kernel regions in the same 0xc range") > Signed-off-by: Aneesh Kumar K.V Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/6457f42eb3f6e9552366631bd5aeb096 cheers