From patchwork Thu Feb 9 17:54:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuxuan Luo X-Patchwork-Id: 1740076 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=c7TSeCZU; 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 4PCPfV4ZTZz23fc for ; Fri, 10 Feb 2023 04:55:29 +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 1pQB8h-0002z7-6Z; Thu, 09 Feb 2023 17:55:19 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pQB8e-0002yl-Th for kernel-team@lists.ubuntu.com; Thu, 09 Feb 2023 17:55:16 +0000 Received: from mail-oa1-f69.google.com (mail-oa1-f69.google.com [209.85.160.69]) (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-1.canonical.com (Postfix) with ESMTPS id 5CCF33F0DE for ; Thu, 9 Feb 2023 17:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1675965315; bh=EiZdGtc5muRvJFTMtrqXsF2IjR/1ygpDmDePZzMKpFI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c7TSeCZUmN3MXXL7b03GPk1L1WMKKzyV39SCud3rRIZWxsDajzoWkwPjSMe+Gxvw3 Twdh7I3QajfFypv+ZEzDbkkQd6ndRS+m+J64MTZwhzO6yva/r4N+jY/PI11o9AmJ1g bBcne19P6YAXcGvqrdy4Zxg2wxOCNi4gmsOOrfG+vXyFbRuNvbVYPeC/bROO2RFGIW 4I10hrJ08TjaEw6GrCFA7mzfxDh75Jyt1Q4YdOCUtWMb+1iTuLb+vLUhXjShm7HnWV KFQBnl9PA3VZ/Is3u0Ckne6xzKGvQoifB7lp6RcqFXmSewixAd6RdAzlVuFPcnK4tt EBCTngVZMrMKg== Received: by mail-oa1-f69.google.com with SMTP id 586e51a60fabf-16a0fafd9b7so1384942fac.0 for ; Thu, 09 Feb 2023 09:55:15 -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=g42D9WHoPbxPKeyQtlUw6Q1lhl9zzgmmZoglWwza5JoJNx5IFxWCE6VUiOoOOoajMo k0eW9cf2+wmQhXBkLJIB25YaPEtezkdGmYbwYjojpPfPvQ4eY5VQsKNfnH8gtO44sHfA j+A3pWXL8hvIzo2ozBW2kh+WDjC86YmNjeDxtyI6yIFZXf9NyGfa+ffQcQUi77McfzAs FPUw4IBm0ABt6nrXeoZ0Ozehumxp4Y+fmQ+nWEfVWUzGEGugVKe4H1JfueMsmckX1ciQ g5dYl6BP4Xwv1oum35k/cGWuk9MBOOc1vI4XR3fcMLG66ekaaoUiXKAY9fcS2pbleN3o eOhg== X-Gm-Message-State: AO0yUKWRJzzSkdyfk8BAXWrLSEvt3gIBgRf2p5aik1eVdJgIZt4a+1yV 0MLO/0NFNIf0JoLyTsGTgoR04eXuZyc6bN9thuSfAdeaF4Je+Q71fwCQpxqMS6/e8iWmvJQ+bDj tybmLVxiPg+bggK8GWPblfKouLx1uClUAL3FbM+tZXF9RFdc2YQ== X-Received: by 2002:a05:6870:b383:b0:16a:abdf:d7b5 with SMTP id w3-20020a056870b38300b0016aabdfd7b5mr3076046oap.56.1675965313535; Thu, 09 Feb 2023 09:55:13 -0800 (PST) X-Google-Smtp-Source: AK7set9bKm84mp8ldVvYh88N37YHuuA8wtU9YNEMs5Ajy/dlxBADOStpESBuShbYGlCGPguC4oJNfw== X-Received: by 2002:a05:6870:b383:b0:16a:abdf:d7b5 with SMTP id w3-20020a056870b38300b0016aabdfd7b5mr3076039oap.56.1675965313330; Thu, 09 Feb 2023 09:55:13 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1562:8007::aac:4795]) by smtp.gmail.com with ESMTPSA id y1-20020a056870458100b00152c52608dbsm945178oao.34.2023.02.09.09.55.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 09:55:12 -0800 (PST) From: Yuxuan Luo To: kernel-team@lists.ubuntu.com Subject: [SRU][B/J/K][PATCH 1/1] x86/bugs: Flush IBP in ib_prctl_set() Date: Thu, 9 Feb 2023 12:54:34 -0500 Message-Id: <20230209175434.50432-2-yuxuan.luo@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230209175434.50432-1-yuxuan.luo@canonical.com> References: <20230209175434.50432-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 --- 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;