From patchwork Fri May 17 07:57:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuxuan Luo X-Patchwork-Id: 1936298 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=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (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 4VgfTl0TTfz23tx for ; Fri, 17 May 2024 17:58:18 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1s7sTh-0005Tp-M6; Fri, 17 May 2024 07:58:09 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1s7sTe-0005Sn-JT for kernel-team@lists.ubuntu.com; Fri, 17 May 2024 07:58:06 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.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 101883F366 for ; Fri, 17 May 2024 07:58:05 +0000 (UTC) Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a59caea8836so592690566b.1 for ; Fri, 17 May 2024 00:58:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715932684; x=1716537484; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v6dcQbzooMQ8/G79UvWJF0416OkE0SYT1dzYIeKxtDc=; b=Y/cQFnmhov3nsyaYp8t+Xjd9d+GNWMIeUNWl8YZ5AmOyMBo3Y7DysNao0+lLezxDfT OE0PhdwscEkNMVCGQT/kn1ho6+5izVye7o/1YeKb0oPskpEWuZikfBXrKKtIqmxriGYe 21U656PKaK7puYFaKIOTmcwyDRqVUVriQvHPwICPIxuNQZKMs6sWLdjlEc6HMtppxxJu pgdUcWgozqSvPEGBCegJaOyF6qPkQN2j1VynxPJAKajpMSoW2gjPL+Bf0JGku2VS7xIt rqUzP1OhJJKrEOwW/FZvUdyB7Vy4ZWt2P3Yr46yIfc05j8mlKrq+Md6rh7zYv7kkEdi5 SlgQ== X-Gm-Message-State: AOJu0YzajsNbvWFmTTzZaAQdy26upIeWFkmN6xJm7U18E4JkGrWHoWQI 304gPWhjsKChxu+Inps/eZkO5s4mRpLb6tLPWvAj4S9EM5Veqga47Ey4G3hHgEuS9QSYgZATRZh ggfwQTwzr264/ad6YdnKFnCWa3SfvPtkl9ZttJiqiafkhBjVGvLGxZzBJqcARfQDq3hY8vUYp2q Mtqna8USicJos4 X-Received: by 2002:a17:907:86a8:b0:a59:a282:5db7 with SMTP id a640c23a62f3a-a5a2d67e024mr1681583466b.65.1715932684605; Fri, 17 May 2024 00:58:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/Xz8WN3IGmqXQ0PJu0net933ErftHLR5eZ7pKcH3yCd1jqdcFPKovVmNxKIyWCWST4Bs1OQ== X-Received: by 2002:a17:907:86a8:b0:a59:a282:5db7 with SMTP id a640c23a62f3a-a5a2d67e024mr1681582366b.65.1715932684317; Fri, 17 May 2024 00:58:04 -0700 (PDT) Received: from localhost.localdomain ([2001:67c:1562:8007::aac:4795]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b179f1sm1080016966b.212.2024.05.17.00.58.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 00:58:04 -0700 (PDT) From: Yuxuan Luo To: kernel-team@lists.ubuntu.com Subject: [PATCH 03/15] x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file Date: Fri, 17 May 2024 03:57:16 -0400 Message-Id: <20240517075728.9722-4-yuxuan.luo@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240517075728.9722-1-yuxuan.luo@canonical.com> References: <20240517075728.9722-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: Josh Poimboeuf Change the format of the 'spectre_v2' vulnerabilities sysfs file slightly by converting the commas to semicolons, so that mitigations for future variants can be grouped together and separated by commas. Signed-off-by: Josh Poimboeuf Signed-off-by: Daniel Sneddon Signed-off-by: Thomas Gleixner (backported from commit 0cd01ac5dcb1e18eb18df0f0d05b5de76522a437) [yuxuan.luo: ignored conflicts and changed ',' to ';'] CVE-2024-2201 Signed-off-by: Yuxuan Luo Acked-by: Juerg Haefliger --- arch/x86/kernel/cpu/bugs.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index a0d2ace1877a5..be2c0cf95f3f3 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2233,15 +2233,15 @@ static char *stibp_state(void) switch (spectre_v2_user_stibp) { case SPECTRE_V2_USER_NONE: - return ", STIBP: disabled"; + return "; STIBP: disabled"; case SPECTRE_V2_USER_STRICT: - return ", STIBP: forced"; + return "; STIBP: forced"; case SPECTRE_V2_USER_STRICT_PREFERRED: - return ", STIBP: always-on"; + return "; STIBP: always-on"; case SPECTRE_V2_USER_PRCTL: case SPECTRE_V2_USER_SECCOMP: if (static_key_enabled(&switch_to_cond_stibp)) - return ", STIBP: conditional"; + return "; STIBP: conditional"; } return ""; } @@ -2250,10 +2250,10 @@ static char *ibpb_state(void) { if (boot_cpu_has(X86_FEATURE_IBPB)) { if (static_key_enabled(&switch_mm_always_ibpb)) - return ", IBPB: always-on"; + return "; IBPB: always-on"; if (static_key_enabled(&switch_mm_cond_ibpb)) - return ", IBPB: conditional"; - return ", IBPB: disabled"; + return "; IBPB: conditional"; + return "; IBPB: disabled"; } return ""; } @@ -2263,11 +2263,11 @@ static char *pbrsb_eibrs_state(void) if (boot_cpu_has_bug(X86_BUG_EIBRS_PBRSB)) { if (boot_cpu_has(X86_FEATURE_RSB_VMEXIT_LITE) || boot_cpu_has(X86_FEATURE_RSB_VMEXIT)) - return ", PBRSB-eIBRS: SW sequence"; + return "; PBRSB-eIBRS: SW sequence"; else - return ", PBRSB-eIBRS: Vulnerable"; + return "; PBRSB-eIBRS: Vulnerable"; } else { - return ", PBRSB-eIBRS: Not affected"; + return "; PBRSB-eIBRS: Not affected"; } } @@ -2286,9 +2286,9 @@ static ssize_t spectre_v2_show_state(char *buf) return sprintf(buf, "%s%s%s%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled], ibpb_state(), - boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? ", IBRS_FW" : "", + boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? "; IBRS_FW" : "", stibp_state(), - boot_cpu_has(X86_FEATURE_RSB_CTXSW) ? ", RSB filling" : "", + boot_cpu_has(X86_FEATURE_RSB_CTXSW) ? "; RSB filling" : "", pbrsb_eibrs_state(), spectre_v2_module_string()); }