Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4487960ybx; Mon, 4 Nov 2019 14:15:08 -0800 (PST) X-Google-Smtp-Source: APXvYqwdOUWoZ36FUel3fuGUXLZNMbctNcLlnblSHoIvzbI6p/GcffZCEnh+qa+E9iW0nmo52qjE X-Received: by 2002:a50:8969:: with SMTP id f38mr32127539edf.211.1572905708729; Mon, 04 Nov 2019 14:15:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572905708; cv=none; d=google.com; s=arc-20160816; b=qnvyF7xIxGMfDbd1FOpYzLQQAN+0ac68tJkuSS9iaT60QOrrHRxgIKqU+FBW9Il/d4 mrrIjXpmQ6y7A3awpxHBoUoC3h3NpmAzLdm7WG4B9mxtbkWatfE8nQ2v0vEQhzNGrl3G YwCWE8bxUHqcXrSitHh66WlRC3xv39bamEIPlGtSrhH4IDIUU33Tebv6AminkGMg3Z66 RjwgjI6z/+etBq0BNXRFaqmM6nqwOK2xSNXvM68TerhHAO5yJqBaatRL0dQ7zyD4jXDT YVY6wyV+2NS6pgYO5IBAEote/bW4UEpgXpA95NGqRoy5YuBU3YRM+Kj9pnjRbyBWEGUX l9MA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=S8Wr5fNIdzKBWsVy2SevWHITbXl3UCRn5iQfX4Rh9iU=; b=YgD4d3fYGeHLw1fmrqK6gZqZRxuz0byZSpuI7cMAHLdKJvVvRReHbrTPFXkgFgXSNe MWN4kLMDkM6uBCwkVv3YW7w7F2Zwt7j2EwOCyiEm9qfK1KelD3pYwA+pITkIfzXhV5rp Te0zmVobpzxpN/nU84FEkJsMH7hIHh16gYdf2nNKyNcdfnNGGsbeHqmcN45EPDoBGLIt qMUGx37fF/ICMowHED410z7qjveGhGYVXT/SFGVgYlc/xlCkauCGUce5XNf2Q+pkOIV7 JPmjSXQKvrY+5qeLk0igoB7KDV6ObEDpDGu9Yj9QOfMfKansSTD0Cadk6gkWFED6rmRr frjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WE35N7c0; 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 v20si7996496edm.254.2019.11.04.14.14.45; Mon, 04 Nov 2019 14:15:08 -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; dkim=pass header.i=@kernel.org header.s=default header.b=WE35N7c0; 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 S2387935AbfKDWOM (ORCPT + 99 others); Mon, 4 Nov 2019 17:14:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:41160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390206AbfKDWIS (ORCPT ); Mon, 4 Nov 2019 17:08:18 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7406B214D9; Mon, 4 Nov 2019 22:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572905298; bh=ApFT2yRZPjE5kYFWb07gNAkCn4f1C3IPuAu8B/kloaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WE35N7c0cIFxG876U3NWyZI25S5gydTOVy0Z4TU3M+xDh7pSx9z2lO3HegFDrUggu qhQq+uSgDV36oLlQOP+4eZ6FHoxp7a+xr4PEqcpMBcaVo/dNs8NALBRsdXXdiZJEgt TJpDXOemJyQSdH4VKCcCi+RWvN6n17J1z+Z2V3W8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Chen , Christoph Hellwig , Paul Walmsley , Sasha Levin Subject: [PATCH 5.3 055/163] riscv: avoid sending a SIGTRAP to a user thread trapped in WARN() Date: Mon, 4 Nov 2019 22:44:05 +0100 Message-Id: <20191104212144.120530569@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212140.046021995@linuxfoundation.org> References: <20191104212140.046021995@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vincent Chen [ Upstream commit e0c0fc18f10d5080cddde0e81505fd3e952c20c4 ] On RISC-V, when the kernel runs code on behalf of a user thread, and the kernel executes a WARN() or WARN_ON(), the user thread will be sent a bogus SIGTRAP. Fix the RISC-V kernel code to not send a SIGTRAP when a WARN()/WARN_ON() is executed. Signed-off-by: Vincent Chen Reviewed-by: Christoph Hellwig [paul.walmsley@sifive.com: fixed subject] Signed-off-by: Paul Walmsley Signed-off-by: Sasha Levin --- arch/riscv/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 055a937aca70a..82f42a55451eb 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -134,7 +134,7 @@ asmlinkage void do_trap_break(struct pt_regs *regs) break; case BUG_TRAP_TYPE_WARN: regs->sepc += get_break_insn_length(regs->sepc); - break; + return; case BUG_TRAP_TYPE_BUG: #endif /* CONFIG_GENERIC_BUG */ default: -- 2.20.1