Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2138548pxb; Mon, 12 Apr 2021 15:45:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUHPVej+hFmuFOmymkrNEqH4ysKkilwMY3AmXDizdXaAqNEaXEOY7EsXlHgb7sF1jKEolY X-Received: by 2002:a17:90b:298:: with SMTP id az24mr1553573pjb.123.1618267503827; Mon, 12 Apr 2021 15:45:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618267503; cv=none; d=google.com; s=arc-20160816; b=qVn9NARB8bUd3AsbGIxIPl+utJZ9uG9kRw391I453NzWqzUHL5+4Sgh0f3FJaWkvTP 0Cl17z46FfERbZqs/ejFa23xbGOSOOYoZTu6DXUB4zbhIyXFcQWRTbDwVS/jFBd5PEqr +VdNbnRmlxVJ0P/rDHpE7OPJIr0AJcVFU3v+EWB40VgM0DxvORNYDFXiIh9m4vYeEtH/ hc/5vwHWdyV9KwrFgkDgaS4avtqAUByLJsNGSzq2kGYzbtGR+vLBbKzni9kZIB6s+pPN mSoGelW8os3iicZCIFOAoAIIPFTkfy7bt9ojdPanAzZpU+4WWZ2IjMCxX+C0ec2/hpoy kjsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UeB/mYHF50+YbgDcf6LpdmTTgQJKuztKu7P6SasXZ5E=; b=02W5P3LTZ0vQVPFOWRhT+JMnGVeSrAK7RFK5ULbiQ76QoO25od9rcuA6ccGrUo09+l pAZI/uMoT+lJzCXQJBqCXOu2CJWzGJNLzzQ46a3a5C8PuvMxeOG3FcokNm0rR7aj2m8e JyHMWTZIUQYzIfyscpe17jeSl094W7nhO8fjTp9q9rFL4gksaoi+huxTbPBOIdePQbEi 3Tx54fq3eyvOoq3ziW0nlG5l2Ve5rsKLiTOK+6ybYSglcuWzFoRv9G1HML+q/Rjq/vHw tvMMa4P2mtbnyCjgHBPS2dxSGIWxOXdny/LwC/JrUIj399nZ3CAvy3ARqlh0dqnr2IbR krQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d8Xbyase; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e1si10772033pls.152.2021.04.12.15.44.50; Mon, 12 Apr 2021 15:45:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d8Xbyase; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242217AbhDLJk3 (ORCPT + 99 others); Mon, 12 Apr 2021 05:40:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:34454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240891AbhDLJLI (ORCPT ); Mon, 12 Apr 2021 05:11:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 292736139F; Mon, 12 Apr 2021 09:07:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618218432; bh=n5WJa8ngEv7bEquikRAerBZToMl/YvbocI+gERKY1hI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d8XbyaseH5t6zvMRdwCy/HCHQ4ZSvi3XEN4ckIAHnPBMPLDNgBmMih+5sd32JIumB fye/AZGUdOSB4dxjgf7SMKISMEswOp4CjTZhR6jmjOuyTnyIVD0bY6PlSeklGt3Oz4 Y8q1JZg2/t5DoPck2J/eeRrlODEIZNsrqvRoQ2OA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Tai , Borislav Petkov , Alexandre Chartre Subject: [PATCH 5.11 195/210] x86/traps: Correct exc_general_protection() and math_error() return paths Date: Mon, 12 Apr 2021 10:41:40 +0200 Message-Id: <20210412084022.506578942@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412084016.009884719@linuxfoundation.org> References: <20210412084016.009884719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Tai commit 632a1c209b8773cb0119fe3aada9f1db14fa357c upstream. Commit 334872a09198 ("x86/traps: Attempt to fixup exceptions in vDSO before signaling") added return statements which bypass calling cond_local_irq_disable(). According to ca4c6a9858c2 ("x86/traps: Make interrupt enable/disable symmetric in C code"), cond_local_irq_disable() is needed because the asm return code no longer disables interrupts. Follow the existing code as an example to use "goto exit" instead of "return" statement. [ bp: Massage commit message. ] Fixes: 334872a09198 ("x86/traps: Attempt to fixup exceptions in vDSO before signaling") Signed-off-by: Thomas Tai Signed-off-by: Borislav Petkov Reviewed-by: Alexandre Chartre Link: https://lkml.kernel.org/r/1617902914-83245-1-git-send-email-thomas.tai@oracle.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -556,7 +556,7 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_pr tsk->thread.trap_nr = X86_TRAP_GP; if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0)) - return; + goto exit; show_signal(tsk, SIGSEGV, "", desc, regs, error_code); force_sig(SIGSEGV); @@ -1057,7 +1057,7 @@ static void math_error(struct pt_regs *r goto exit; if (fixup_vdso_exception(regs, trapnr, 0, 0)) - return; + goto exit; force_sig_fault(SIGFPE, si_code, (void __user *)uprobe_get_trap_addr(regs));