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 EA4B06FA0 for ; Mon, 16 Jan 2023 17:14:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71EACC433D2; Mon, 16 Jan 2023 17:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673889252; bh=InTjSKoGEbpGuE/sWXK07FY5kAGlwQwvXk+TZH+CvoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kJ3Zuc1zkF3she8tNUCq5X+Kigcn66J0h8/6jbMO/G530tRZSRbcj1/GhW+KTm7aj VxH+rzbtlSwdn6Z+crHBYpp4eWaMioDCTfjRt+HeJcZ8eKLMGTFgRKaD3zIJBVtpgl zvM1kuUy8ru7SR/y8hbNZkE3TaUc57SPGs0QQ7po= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Rodrigo Branco , "Borislav Petkov (AMD)" , Ingo Molnar Subject: [PATCH 4.14 317/338] x86/bugs: Flush IBP in ib_prctl_set() Date: Mon, 16 Jan 2023 16:53:10 +0100 Message-Id: <20230116154834.942469655@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154820.689115727@linuxfoundation.org> References: <20230116154820.689115727@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: Rodrigo Branco commit a664ec9158eeddd75121d39c9a0758016097fa96 upstream. We missed the window between the TIF flag update and the next reschedule. Signed-off-by: Rodrigo Branco Reviewed-by: Borislav Petkov (AMD) Signed-off-by: Ingo Molnar Cc: Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/bugs.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -1776,6 +1776,8 @@ static int ib_prctl_set(struct task_stru if (ctrl == PR_SPEC_FORCE_DISABLE) task_set_spec_ib_force_disable(task); task_update_spec_tif(task); + if (task == current) + indirect_branch_prediction_barrier(); break; default: return -ERANGE;