From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88DF3611B for ; Sun, 28 May 2023 19:35:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14A9BC433EF; Sun, 28 May 2023 19:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1685302514; bh=TNiv426kaKaT+Z2aeoo9iX9mCX2QPgPgJeqCf9OF4YY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g717ElWuzi1WN3Q6+/WRyssqJNzQkX+XQisyoGJpY0hKN/eBAu7Xy+lj29F9rr47X Qjr6PUjHnICqOwBJeuH9a/EJjT8lnW1PMrF/8MVI4ld4R7rNNo6lUtCWWjBSI+Gh3w o5+sT5437teqm2gcUHtwNjYCMthiJoAq883Fjb1g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Helge Deller Subject: [PATCH 6.1 033/119] parisc: Handle kgdb breakpoints only in kernel context Date: Sun, 28 May 2023 20:10:33 +0100 Message-Id: <20230528190836.463589258@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230528190835.386670951@linuxfoundation.org> References: <20230528190835.386670951@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Helge Deller commit 6888ff04e37d01295620a73f3f7efbc79f6ef152 upstream. The kernel kgdb break instructions should only be handled when running in kernel context. Cc: # v5.4+ Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- arch/parisc/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -302,8 +302,8 @@ static void handle_break(struct pt_regs #endif #ifdef CONFIG_KGDB - if (unlikely(iir == PARISC_KGDB_COMPILED_BREAK_INSN || - iir == PARISC_KGDB_BREAK_INSN)) { + if (unlikely((iir == PARISC_KGDB_COMPILED_BREAK_INSN || + iir == PARISC_KGDB_BREAK_INSN)) && !user_mode(regs)) { kgdb_handle_exception(9, SIGTRAP, 0, regs); return; }