From patchwork Thu Feb 9 20:10:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuxuan Luo X-Patchwork-Id: 1740132 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=QL0B1Im1; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PCSgF46DWz23kw for ; Fri, 10 Feb 2023 07:11:21 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pQDGE-0002B8-8i; Thu, 09 Feb 2023 20:11:14 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pQDGD-0002B1-DJ for kernel-team@lists.ubuntu.com; Thu, 09 Feb 2023 20:11:13 +0000 Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 31ACD3F12B for ; Thu, 9 Feb 2023 20:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1675973473; bh=EiZdGtc5muRvJFTMtrqXsF2IjR/1ygpDmDePZzMKpFI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QL0B1Im1HAT27N404svUBsT7M8M2oB56jLzs6E0vdjLRnKTNWYLsRWb23nHlvyeDu ba3XD4otHIhCJpftD/Tml11no5xk0+5UdPc5odP7lzu5t2lxtf4E2Sc97+l/42XAo4 GBEVEJfmkQawSGIsnz1UXrJGjNmx+n9PED74FsyE4LppRAPpvaDvUo+JdNDj2rKFdA 1bL/npQ+yZJ7JRr4I9X3jElCPmWxqzfoOyEBu0bBl6R6iIDeSd2OjN/W0grAOUEPl+ cffThASG719NIBQt03oO9udXo8TSNIt9entMWVAe0gA5fi5AOPCqAMzu6DKzRN5en3 p1mCfAv6xXZKw== Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-163a3511e93so1538547fac.11 for ; Thu, 09 Feb 2023 12:11:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EiZdGtc5muRvJFTMtrqXsF2IjR/1ygpDmDePZzMKpFI=; b=GgX3qAS6QvyQPpEOMMjRyZwmKOfb31mko8lu3P/dvh8N0p3pE1scz1YrtALOjykmXh rHwGA9V7AinFj7x68o/1rd12N6vxeU2YVMFOSALXCM8207qJBbikvRKFnr/bF1xhGJSN 1NPFEXLZLZIi4tjH5zhmOfVNsnnQJO2pKokSEZGB0hS2PcgD+imVmdpJ6upjtH+wPltz svlXVIwQu4TnXlYZ5Rc5zfYtgFwJJ3pcqDrveV0mAv2EcQlgUzmZmQANryeVq9GdaEDG 3dia+sFBUr6KEEij+9fxoYIhSFmLynHLynRSNBJCz5+2x7mLaZdK8RBdnOGG9aHDqm7D ktCA== X-Gm-Message-State: AO0yUKXK488kP1XDccAnngOY4JStAVzm9Kmny2tKcCOuL8f7jil0AC8s dSc0/Ki5RnSUlxi7zhBraTKntSuavY6hIJcCfNtfSMJO7UNNl1rasSpojBihOTkcPViA595gl1+ 4gGGqMMSkN3UL0aFFTdLMSI+IrNMhfoqvjfyT/k4wDWZPX8FZ7A== X-Received: by 2002:a4a:cb8e:0:b0:517:b183:24aa with SMTP id y14-20020a4acb8e000000b00517b18324aamr6403456ooq.9.1675973471175; Thu, 09 Feb 2023 12:11:11 -0800 (PST) X-Google-Smtp-Source: AK7set8YFmGPjR1NaNAfDA2jzs2Q66ykmliHJZoiIAuMlq1WSfA1X8xxkE4p4iX2rIr8XQKjEeadqg== X-Received: by 2002:a4a:cb8e:0:b0:517:b183:24aa with SMTP id y14-20020a4acb8e000000b00517b18324aamr6403450ooq.9.1675973470937; Thu, 09 Feb 2023 12:11:10 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1562:8007::aac:4795]) by smtp.gmail.com with ESMTPSA id t5-20020a4adbc5000000b00511e01623bbsm1182460oou.7.2023.02.09.12.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 12:11:10 -0800 (PST) From: Yuxuan Luo To: kernel-team@lists.ubuntu.com Subject: [SRU][B/J/K/OEM-5.14/OEM-5.17/OEM-6.0][PATCH v2 1/1] x86/bugs: Flush IBP in ib_prctl_set() Date: Thu, 9 Feb 2023 15:10:32 -0500 Message-Id: <20230209201032.63188-2-yuxuan.luo@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230209201032.63188-1-yuxuan.luo@canonical.com> References: <20230209201032.63188-1-yuxuan.luo@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Rodrigo Branco 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: (cherry picked from commit a664ec9158eeddd75121d39c9a0758016097fa96) CVE-2023-0045 Signed-off-by: Yuxuan Luo Acked-by: Thadeu Lima de Souza Cascardo --- 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 fc4bee4b17fb7..45f21906e7ab6 100644 --- 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_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;