From patchwork Mon Mar 14 11:54:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 551730 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D13A5C433FE for ; Mon, 14 Mar 2022 12:06:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbiCNMHV (ORCPT ); Mon, 14 Mar 2022 08:07:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240654AbiCNMHJ (ORCPT ); Mon, 14 Mar 2022 08:07:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1565A21273; Mon, 14 Mar 2022 05:03:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BF914B80DEC; Mon, 14 Mar 2022 12:03:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DA14C340EC; Mon, 14 Mar 2022 12:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647259397; bh=hA2jntMUiHHrRBMInAefEI/HQkp7b7Hah6h12nd58Nc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h0VyDgonE43aLw5IYotoWftRwLQ66F5wLF9UbwSlW2PaKoP0OMFsWsPbdJ1xzlb1a tZZ1hkfP6S9thwk+SkJjyAdvqN9m+c3+6ATP72qkwQDiRZupubsB2P/nwOM/wCbSiL uUzYwmy5pmz3rl2J0CbvffawVHnVK6YpATwD/Jvk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Huafei , Borislav Petkov , Masami Hiramatsu Subject: [PATCH 5.10 68/71] x86/traps: Mark do_int3() NOKPROBE_SYMBOL Date: Mon, 14 Mar 2022 12:54:01 +0100 Message-Id: <20220314112739.842180777@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112737.929694832@linuxfoundation.org> References: <20220314112737.929694832@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Li Huafei commit a365a65f9ca1ceb9cf1ac29db4a4f51df7c507ad upstream. Since kprobe_int3_handler() is called in do_int3(), probing do_int3() can cause a breakpoint recursion and crash the kernel. Therefore, do_int3() should be marked as NOKPROBE_SYMBOL. Fixes: 21e28290b317 ("x86/traps: Split int3 handler up") Signed-off-by: Li Huafei Signed-off-by: Borislav Petkov Acked-by: Masami Hiramatsu Cc: Link: https://lore.kernel.org/r/20220310120915.63349-1-lihuafei1@huawei.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/traps.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -651,6 +651,7 @@ static bool do_int3(struct pt_regs *regs return res == NOTIFY_STOP; } +NOKPROBE_SYMBOL(do_int3); static void do_int3_user(struct pt_regs *regs) {