From patchwork Wed Jan 4 11:58:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 38882 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5104424wrt; Wed, 4 Jan 2023 04:02:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXvD/DGFVHAAcCPjIL1Ds+kBpu6nXy5dEtj6JV3LG1DHXW67kr6zwWIaDhj1rDOZ+WkoDQMc X-Received: by 2002:a17:906:11d9:b0:7ae:7c4e:195b with SMTP id o25-20020a17090611d900b007ae7c4e195bmr40446488eja.22.1672833726057; Wed, 04 Jan 2023 04:02:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672833726; cv=none; d=google.com; s=arc-20160816; b=WferZsWLU/uWAUBWPHBDfhr/e04MPFQNlvt/e+UDDjEMnv/XmfERJk/WcvZnIC2CdM nvuSDMZ8CYREMzphVeIERhl/svRJ/ykP/KCFIxifV3HQ9aZlk1K3YAeOkN86RXoR0L2w DX7KcyZIfqnktdJ2PnbKUvRY7cfhTauBvF2OwvW27CD9xaKSCxsWrqR0t2aVEUg9UVoU /KLmElfNpYTCiOc/mn9EIkcadj3TpElxbYhCDJ0nmXP9TRuroQ7qvp+Kb8pD6yaXRTaz a8K06Sk+SJWmKI4nrUDHnU/jU9UbxFxuU8cPTdbYj13IhmQa10PxQ+/LFhlDEGAKxztE Jd8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=+n2ZcuHyYQSIvPOuKhwvmkaHaWyKOGj/JfAklwx+MxU=; b=Zpk5VDGjrtRgvap0LItgqNh5DGg0vFy0iKkqiMffuGfeZkaQ19tYc0GfOE5YlImMcC DT3AEekErwV7F8PZGoY8NB+qMqhb4akBiGyVkoXdoVoDe2zF4qGtRiydCuV5RnN9dzH1 rGxY+xR02Aq+giMYIe3EXnYSwpl3VwtZiAKcDUKQpJJCktGtVDyY7uld7g19/5e63Iy2 bg7P11GEBSdQ/wmDliwC55iyCZXWTb9U4sJTOMpvMOTWSybd39nDlqxhsRCxEveu7IKV /yxLmM1Kh27cUoPvf7fbplJTtaQnNdSVfgXTqu4lJXpuvXjoddUIjW1xV8fRmLIFCAVX Z4CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Xbz8Grh+; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o19-20020a170906975300b007c18334dfc6si29935458ejy.292.2023.01.04.04.01.41; Wed, 04 Jan 2023 04:02:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Xbz8Grh+; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239196AbjADL7I (ORCPT + 99 others); Wed, 4 Jan 2023 06:59:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239116AbjADL7B (ORCPT ); Wed, 4 Jan 2023 06:59:01 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 493391EC5E; Wed, 4 Jan 2023 03:59:00 -0800 (PST) Date: Wed, 04 Jan 2023 11:58:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1672833538; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+n2ZcuHyYQSIvPOuKhwvmkaHaWyKOGj/JfAklwx+MxU=; b=Xbz8Grh+urUwKujbRtQx5LM4M/FBOoc4fw9A5cav8F0RZU5/NOLvMbS+XZhAG8XxqsCTmv yEj6lx1A1U9YmrOlDRr152+RG9UpEAm+BeZEuA2Csrp+NnthIHHA5hPQBUz8fi62jn2yMi zqjBM6Si57Rs98yuFNdoXA4Tg7uWeB2r3biYG8jU3CF9BxKX3ggl3UpAGRIOo8oJGxYOcb RERO6kLlQhVqdUGxunhGGIrx356+N5W23QbNWA6dvBHXZ7XsvR30H2ZbSXKMEatpkSXftD nUbVyTNGAqA9n6aVILjyXX5JKZkPZkCvwe3YA8rW0A+KPTcCdNLc7/PhKNA5Lw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1672833538; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+n2ZcuHyYQSIvPOuKhwvmkaHaWyKOGj/JfAklwx+MxU=; b=JAHylUUA7jd66QVeVdn/gYui89nlgS18uubG3jOSVL4goX9RqpNispLQiMeFHrbvDI8RfP fVtVzuBEiOxZ/jBQ== From: "tip-bot2 for Rodrigo Branco" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/bugs: Flush IBP in ib_prctl_set() Cc: Rodrigo Branco , "Borislav Petkov (AMD)" , Ingo Molnar , , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <167283353750.4906.14334038214138785293.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754093297501079811?= X-GMAIL-MSGID: =?utf-8?q?1754093297501079811?= The following commit has been merged into the x86/urgent branch of tip: Commit-ID: a664ec9158eeddd75121d39c9a0758016097fa96 Gitweb: https://git.kernel.org/tip/a664ec9158eeddd75121d39c9a0758016097fa96 Author: Rodrigo Branco AuthorDate: Tue, 03 Jan 2023 14:17:51 -06:00 Committer: Ingo Molnar CommitterDate: Wed, 04 Jan 2023 11:25:32 +01:00 x86/bugs: Flush IBP in ib_prctl_set() 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: --- arch/x86/kernel/cpu/bugs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index d970ddb..bca0bd8 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -1981,6 +1981,8 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl) 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;