From patchwork Tue Jul 21 10:36:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 3270 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4B9w4y2h5rz3xSt for ; Tue, 21 Jul 2020 10:36:50 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4B9w4w02dmz3VC; Tue, 21 Jul 2020 10:36:47 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4B9w4v2ndtz302n; Tue, 21 Jul 2020 10:36:47 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4B9w4t28HRz2yWq for ; Tue, 21 Jul 2020 10:36:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4B9w4t0v6hz1rl; Tue, 21 Jul 2020 10:36:46 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1595327806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DrT8TXIYdhp7UEMJElXKtnyxmMCWIQ3VuPozg3IKGrY=; b=nXIFnwPDUcglfSnPD2k27RqIkWT2yWI9zIswdNCHj2rY3wN+WI0bbH4ncbOec4ZtWJwi6p fnA8zsJEemVuAFCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1595327806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DrT8TXIYdhp7UEMJElXKtnyxmMCWIQ3VuPozg3IKGrY=; b=dhh4czmQZl49JREWkvHbKk+T7uY7hPlgONeGoAaLWjRw3fh5G5vM1FMrzIveyGBlajgUKa nRe8pQHmtIzyt+pLbDGjCZjiG7buA7vmSNpVS7+h+3f4igG5a6U3KYgDcvW/R/9UNMAweD 09yJ1V51t+Wd3EUS8LDIZtzi7zrybgU2S6210ICrFgSx5CzFilK/Ahhj+11CMMO8pZ3y2p wy2769Q5+Gr2VQp1SYWyrPEvqkcbPN8FbDvYS/R3FUuGhKcH40mrewtdU2CUtOCmd+txIx ZTCs41KZ7kQotI+gJMTbNjQgALx/za0VuzBwCTfsZXmZdaw26zHzaophEqhSeA== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 3/3] smt: Do not disable SMT in virtual machines Date: Tue, 21 Jul 2020 10:36:41 +0000 Message-Id: <20200721103641.30305-3-michael.tremer@ipfire.org> In-Reply-To: <20200721103641.30305-1-michael.tremer@ipfire.org> References: <20200721103641.30305-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Processors in virtual machines are *virtual*. Therefore this only degrades the performance of the guest, but does not increase it's security. This patch always leaves SMT enabled in all virtual environments. Signed-off-by: Michael Tremer --- src/initscripts/system/smt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/initscripts/system/smt b/src/initscripts/system/smt index cc4128b2d..bfa7d57b3 100644 --- a/src/initscripts/system/smt +++ b/src/initscripts/system/smt @@ -20,6 +20,11 @@ case "${1}" in exit 0 fi 2>/dev/null + # Do not disable SMT inside virtual machines + if [ -d "/sys/hypervisor" ]; then + exit 0 + fi + # Disable SMT when the processor is vulnerable to Foreshadow or Fallout/ZombieLoad/RIDL for vuln in l1tf mds; do if [ -r "/sys/devices/system/cpu/vulnerabilities/${vuln}" ] && \