From patchwork Fri Nov 22 10:51:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 179999 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp36841ilf; Fri, 22 Nov 2019 02:53:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyxFVwyKj4ac8HDlLrEn/DL2BgVXi6CtsfJM4Hv+phYz0wrZcIhGX7TVuQl8h2h8zKHzpjy X-Received: by 2002:a17:906:1e03:: with SMTP id g3mr22118007ejj.331.1574419904037; Fri, 22 Nov 2019 02:51:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574419904; cv=none; d=google.com; s=arc-20160816; b=BJ8BqPbG8EAz/OOfu6U/07ldbGJ1YrWVF1ZdU4brGKa8fACFZcntd61vbKmHQpfyRr lie9w5AhTaHjhSFq7eDnJ7P5MVPvB65wS/9liCwMKk8nqkKIZmSY94OfvsyzuUAnyADJ nWjnGrMkGX+PWkcdbWIlCMwYtckn51u0iqkqT9Oh1o65t5zsnwVl2NV2wAkwXWmJBqk8 Xi7xyYVdfBeiA++th5SdfzyEGKVtgWq1o/HYpbxvVd/9OiK/zy3DCnEqDoJjzqH9TAQ/ rLTzIYWlP3ldPgLn/zzNEftSzbQsNzmrIvzjH2wyGNXYGmBlj39NsrPb/D91eFiRfBYK W/sA== 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=MfKJ/5LhXGWemwyCoLTmrzrTqXxWjUaJEcDcUsWi2Bw=; b=e2LPuV0qYbiH9R+FF1KlWPA1vM09QMNklY/WEwTeTuOVGp5EloRAiVmHvCh8SWTBoO Se2Zjl2QFVyUDlrXsl+/wxficIDew5OUeL/7zQpTG1JGTye8FVHjxl6YodlHHWAyB+Hn MXkYQDW4O/c8jzFxU3m0pX98P8370mS/WFofnGA2noFj0pGHDne7T0Kme5lY7kKhGXnJ qyYhecSszkZlK3SOiwUp6RsRU0883x9WAH33RIPNK/KKhon+neIw1o0Jp5fEd1CtPArM 74QkwV4pjjJJxgWF0YIs6IKOtGWBlyW+JU+sK+JaFCBBaFitAcns71732eRYrVr8qgtv 6wiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ecezFEN5; 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 y51si2885664edb.29.2019.11.22.02.51.43; Fri, 22 Nov 2019 02:51:44 -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=ecezFEN5; 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 S1730007AbfKVKvl (ORCPT + 15 others); Fri, 22 Nov 2019 05:51:41 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33508 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730083AbfKVKvk (ORCPT ); Fri, 22 Nov 2019 05:51:40 -0500 Received: by mail-wr1-f68.google.com with SMTP id w9so8103876wrr.0 for ; Fri, 22 Nov 2019 02:51:39 -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=MfKJ/5LhXGWemwyCoLTmrzrTqXxWjUaJEcDcUsWi2Bw=; b=ecezFEN5tASpm9yGZqiy0PFAxq9dAZihSqIw8xLd3ulOl4A43rbKLoismCKETZl2BQ xbKABtiUqRdQI7Qx75AXrqC8KPqhAMBYabuwsPZanVws3SmthfPZHQHuPfvin7c3aj3f KGnVy1Lixo9g6rYMdOL/qwyO0XdYSr/ObVZpSloCPQm/9wRVFMZsYoGKp37GBETsTx8Z R0HbqooUVf1hJWzGjvVUkpKV7QFnk2wFHhOPdWeSzBKwntImeY6gLy8Scjw/52SdoTKl bdVwlUHqZqBA+5k/dga6IoukJzBbFHcEqF315GD3uk/mYFWSz92Qm2xp+DNkZrvxmTJD zxjQ== 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=MfKJ/5LhXGWemwyCoLTmrzrTqXxWjUaJEcDcUsWi2Bw=; b=GkurZ7KubvywH63/RwRoHE6wr59W74vxOyqAFsA51z/YFECguSO7zFtS97S9/C9nPf LITZeBJsDsapFw57aE/sXVJwk+pfRS24EKkn8id13Q+uxlu4Oab5tRs6CfgQKlvdUz46 S4Epr54aMODA0LBKu5sUPIkIvVQ5o40N7yXHyHeiLHGrWFnipJb0oX7cKSOf/KSW/Hy1 hCOo3tvvCistAmGJ057M0cnKsxfkDwtD/GZ34rmcDLSx063J3r8XCnpzRLYPx0C+IAHH y5GWk7XxRaVDVHYhd/973KZlkhlYvYkWStpgbEeDOTvYfU367JaG0AZrfRxVGMbiyT+k Ijvg== X-Gm-Message-State: APjAAAXzgwlrY7lUUeJrfVkNP3rHKh1zfbyuPnYZ2E8/228sAj5NTkcb WxbuthJHT0tAGTt98JeflDHqIQ== X-Received: by 2002:adf:e68d:: with SMTP id r13mr17981459wrm.199.1574419898594; Fri, 22 Nov 2019 02:51:38 -0800 (PST) Received: from localhost.localdomain ([2.27.35.135]) by smtp.gmail.com with ESMTPSA id w4sm2894338wmk.29.2019.11.22.02.51.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 02:51:38 -0800 (PST) From: Lee Jones To: lee.jones@linaro.org, gregkh@google.com, stable@vger.kernel.org Subject: [PATCH 4.4 3/9] arm64: fix for bad_mode() handler to always result in panic Date: Fri, 22 Nov 2019 10:51:07 +0000 Message-Id: <20191122105113.11213-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122105113.11213-1-lee.jones@linaro.org> References: <20191122105113.11213-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 6b4579e07aa2..02710f99c137 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -448,7 +448,6 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr) pr_crit("Bad mode in %s handler detected, code 0x%08x -- %s\n", handler[reason], esr, esr_get_class_string(esr)); - die("Oops - bad mode", regs, 0); local_irq_disable(); panic("bad mode"); }