From patchwork Fri Apr 12 19:23:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuxuan Luo X-Patchwork-Id: 1923233 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 4VGRMJ141vz1yYP for ; Sat, 13 Apr 2024 05:24:12 +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 1rvMVK-0004O1-Tp; Fri, 12 Apr 2024 19:24:06 +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 1rvMVE-0004Gg-Ur for kernel-team@lists.ubuntu.com; Fri, 12 Apr 2024 19:24:00 +0000 Received: from mail-yb1-f197.google.com (mail-yb1-f197.google.com [209.85.219.197]) (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 75BB03F17B for ; Fri, 12 Apr 2024 19:24:00 +0000 (UTC) Received: by mail-yb1-f197.google.com with SMTP id 3f1490d57ef6-dc6b26ce0bbso2312205276.1 for ; Fri, 12 Apr 2024 12:24:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712949838; x=1713554638; 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=4k44mlFl2XyggS3lLTVBBDzKac7rJ6Nd8GHY+w0XQD0=; b=Cjqtd1N5iy9e0guwDVq3Lze6pIF5et3rWbmdc39vtiHj6mBo6wsGL5K1RJ4cs8Ljfy xhPmkkOnJNzcBT+z54zSdMsHG9n1Tbt0mCqiNiCSFhKNqmLWjDsa4DiuwIj8wv2kfIR4 zL3rvCcBqrtQpum+kDSYw4QMyW8aze3RHAlX0hwvq0Bz8NbNZ8NslzgZ3psDjcRE7DQm W8GN7lGUJ5Kqo9Ogye0zAr9Ddgcjwyb/IAJycpgwa0hwjMkLiXvapRQHTrJWN0ACn6sc A1ZuK2VwBSCatTGFSo7OZfS+L2gQWzCgP9EVFy3YxOKfuArKgpqdfINGhxJ0g61Gl1Qo 4J7w== X-Gm-Message-State: AOJu0Yx7zf4T4rdr0i60FQVaSGfS8mVXjSF7DxL4pUNoPFQ7sO8x1+3G 3SaDKl7ySy5T7T8o998xIscUYBdeJUZmOBqlp4vyXVRi3cOZEFqRkfqNgfWHkXZ1oBfMiJZRU7R TV6e0Kz9JsTw1ot2PyOb9GIwrJtkwa6tpHuM2GCoNS13j64ABXRldeaMJN5vVuZiQFIhoofrx9A VPxZbtlu8uebJl X-Received: by 2002:a05:6902:260d:b0:de1:1b73:6f05 with SMTP id dw13-20020a056902260d00b00de11b736f05mr4217701ybb.61.1712949838278; Fri, 12 Apr 2024 12:23:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGPtJYH11tyOx9YPJz2oNRluRnFQBfN4PxaUEWwV8/06gSTDx0ba91g/MKJ+/WMmI0Vrnq6w== X-Received: by 2002:a05:6902:260d:b0:de1:1b73:6f05 with SMTP id dw13-20020a056902260d00b00de11b736f05mr4217687ybb.61.1712949837929; Fri, 12 Apr 2024 12:23:57 -0700 (PDT) Received: from cache-ubuntu.hsd1.nj.comcast.net ([2001:67c:1562:8007::aac:4795]) by smtp.gmail.com with ESMTPSA id z6-20020a0ce986000000b0069b47a53012sm2654071qvn.140.2024.04.12.12.23.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 12:23:57 -0700 (PDT) From: Yuxuan Luo To: kernel-team@lists.ubuntu.com Subject: [PATCH 02/13] x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file Date: Fri, 12 Apr 2024 15:23:39 -0400 Message-Id: <20240412192351.89501-3-yuxuan.luo@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240412192351.89501-1-yuxuan.luo@canonical.com> References: <20240412192351.89501-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 (cherry picked from commit 0cd01ac5dcb1e18eb18df0f0d05b5de76522a437) CVE-2024-2201 Signed-off-by: Yuxuan Luo --- 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 9e139731436c7..3d1a0961fec5d 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2596,15 +2596,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 ""; } @@ -2613,10 +2613,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 ""; } @@ -2626,11 +2626,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"; } } @@ -2649,9 +2649,9 @@ static ssize_t spectre_v2_show_state(char *buf) return sysfs_emit(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()); }