From patchwork Wed Nov 27 07:21:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180254 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp5735601ilf; Tue, 26 Nov 2019 23:22:08 -0800 (PST) X-Google-Smtp-Source: APXvYqwX6Q7texOtK4pyIxCpBQm9MGyNSkFXRXiA/cSNVoJ6SG+d+MCuV0pjqkgACBrYSZ/pawKj X-Received: by 2002:a17:906:b25a:: with SMTP id ce26mr46988254ejb.13.1574839328412; Tue, 26 Nov 2019 23:22:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574839328; cv=none; d=google.com; s=arc-20160816; b=ZWpsVz0z6rRvVq2wu7Mdl2U3Jgab2Uu9jmUFlOW+gGVGKyUPNST1Eff7lHo8HBDe6n UOzLVu8yDn6VQ/OyKGYuVbfYU2ArnvRDa8a9zyX3iuJIJZfg40ieTyrWyaRAGK6ouuoE /bVn49Zlnk1Xt1KDf4wGJbREhloM/2QQMzxXjHL56li78/jO5SO2KBRyee/rjyWIoPHD PskoOHEbuPeLJIDV10fI26eDt4j1sxpi7eI9ZAchZxa9I48OWUTwgzCVsTCnkPEBzHPs r/GUDw9xBf1GQ4Z4QyI0pFhci9dOOR1OG80OdLIAQi7IO0QhPfahrNaLP2j7r/j24cJX 7usQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=aMdmhI1a3eYH/WVtmSydJcMj1XByvjyqY+PnBFpibbM=; b=BmDHZ9cKEbeuejMapXn8mryunfu5cHaO8Rs3lUn0E7ipykrHL5mEnDQQfc0DVEML68 PxRUyqa28IRlzo7BkmaB0EuDUncLReONvouIxZTu361n1FeJh3LiF7zjhTq9L2aNETet OO7ujldGv1hXgwmKCtKPv0cSTll/aZHi0PizXSg3fhgk1WtkUn6Y6FBRGUFu5nDD2dj+ ug4WjnrJ4azE/dhSGhnlZA3Sx7V1V8ltkthlkerdEGNbAS8wWJEWH2HmSqrJvKg3mXAC CVmdbUJEdoC/Z+Zam+IRS2Ce3D3mpZ2Iv09/GCAAiFqHQWpMxBGqajQ8M8T0A0hUIodU r73w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LLZaJFtb; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si69058ejc.66.2019.11.26.23.22.08; Tue, 26 Nov 2019 23:22:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LLZaJFtb; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726446AbfK0HWH (ORCPT + 15 others); Wed, 27 Nov 2019 02:22:07 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39459 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbfK0HWH (ORCPT ); Wed, 27 Nov 2019 02:22:07 -0500 Received: by mail-wm1-f67.google.com with SMTP id t26so6147693wmi.4 for ; Tue, 26 Nov 2019 23:22:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=aMdmhI1a3eYH/WVtmSydJcMj1XByvjyqY+PnBFpibbM=; b=LLZaJFtbEGV+rlO3FJCGbAUCCKQRegFJJ7EpzzHN9oXXjTwIXOONT3+P13pF9mTnM6 OBKSr2nYX8DGaNH2AI0tbRvaJULHmasw2pd6TWbAmN3mTx+2ym0Z1w4deB0pLxcG6hq6 d3Fp+CR6NQmkGIzwaGEqF/7vddiPicAJunT/7uVF9vT7zRdSyxT9yww0XjIgeHdxeDe+ b85vQK8yCtNlUG5e4quSZF+1qLzDOiN2S93OgVH/ot9G6Ipk/3YytQfxA2WITeRuccEi t3aza+rxNJx2Z++0kOctYvt1xgq+SZXzaSqYtnFHCfmzuOD1/HWOIM1G5GBr/efLmUPc qA2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aMdmhI1a3eYH/WVtmSydJcMj1XByvjyqY+PnBFpibbM=; b=CfaM1R18iGyMtrKgcszfZvlvxxXM/S9KAx7tvV0EYW1dPmnskQazJBQ9oblOD5ZXr8 XMHHtB4SIaqjvt3OOxFqf4POLaAMdYyK5ekZiipldM4iVy6qo35CcYvcjZT5o/98VaWU 9witF4rP/Py9pHpeqY5/YUR2+SoGjb/206fkS+D0niB9LLtkmBr+wTzI0ST1Nh1rvOH+ SBWo4m+SD+4Emwlo4Wgow8dAogLxqYamKTTB/JrZCclLotnY/njelVaRNbRT7MvEN2Oa Z55KVlbQKZNWo2M+/Lpf/r/g3TQn5oi+aBt22qL2UknekdGzOh9sXWuwTyvZ2wwUlYTN /HhA== X-Gm-Message-State: APjAAAXnCW6zpjI2E0e0yw6ctwISORh40IkGZoPCaw+Z8wcoiSJkompG decmZCGPUTX9wrRtd/9l7BWoLqK1Txs= X-Received: by 2002:a05:600c:2410:: with SMTP id 16mr2651853wmp.36.1574839325138; Tue, 26 Nov 2019 23:22:05 -0800 (PST) Received: from localhost.localdomain ([95.149.164.101]) by smtp.gmail.com with ESMTPSA id e16sm17983130wrj.80.2019.11.26.23.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 23:22:04 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.9 3/6] arm64: fix for bad_mode() handler to always result in panic Date: Wed, 27 Nov 2019 07:21:41 +0000 Message-Id: <20191127072144.30537-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127072144.30537-1-lee.jones@linaro.org> References: <20191127072144.30537-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Hari Vyas [ Upstream commit e4ba15debcfd27f60d43da940a58108783bff2a6 ] The bad_mode() handler is called if we encounter an uunknown exception, with the expectation that the subsequent call to panic() will halt the system. Unfortunately, if the exception calling bad_mode() is taken from EL0, then the call to die() can end up killing the current user task and calling schedule() instead of falling through to panic(). Remove the die() call altogether, since we really want to bring down the machine in this "impossible" case. Signed-off-by: Hari Vyas Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Lee Jones --- arch/arm64/kernel/traps.c | 1 - 1 file changed, 1 deletion(-) -- 2.24.0 diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 28bef94cf792..5962badb3346 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -611,7 +611,6 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr) handler[reason], smp_processor_id(), esr, esr_get_class_string(esr)); - die("Oops - bad mode", regs, 0); local_irq_disable(); panic("bad mode"); }