From patchwork Sun Jul 9 14:55:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 6975 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 "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4QzVZ33GF0z3wjw for ; Sun, 9 Jul 2023 14:55:55 +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 (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4QzVZ21gHPzYG; Sun, 9 Jul 2023 14:55:54 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4QzVZ202T4z2yNY; Sun, 9 Jul 2023 14:55:54 +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 "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4QzVZ10Dksz2xYT for ; Sun, 9 Jul 2023 14:55:53 +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 (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4QzVYx1rlrzRR for ; Sun, 9 Jul 2023 14:55:48 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1688914552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zgM4oxFi5uUqzlojYUBwKaMdn3gXDSBmCxTxw5H9Gi0=; b=R8at8m8uVDVovdjk/4slP+X/YEQnEnMrRfbbzfNQD6v7+YxNwnBbCtXTA10vKM/C3j0P+t gCZn7Gi9Q2LK7RDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1688914552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zgM4oxFi5uUqzlojYUBwKaMdn3gXDSBmCxTxw5H9Gi0=; b=hHCgUostxLcyz+6eV79UkmW48dFrki6eXVh6S0CZnj/8mmGSnIFnTih39zfO60S7EtvHyU H41/0F8lBD77dBmf41T8/4db69L1jxZ2YvmpGfgq7hSc2QXJqKJ1NEkXchq3N5LQmaPbdf sEHa591QS4jqeUYlnYADsIdw+swaYuQw+d1kjR8aX7PBDHPF5EOc9V20UWfq+ZvwVXCGg2 5HugbRm4i32/wF8PnaFM73idJ9ANgiFVVfZgXXLmUrQpkcBMZdlFwEylfzLOYafwTcnvPE p4TOrBLs+AO/oX1bNvxtr56R24ket1V/Olmtj0czcUncRV/5jG2I3JH3iVmOaA== Message-ID: Date: Sun, 9 Jul 2023 14:55:00 +0000 MIME-Version: 1.0 To: "IPFire: Development" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH 1/3] linux: Enable Indirect Branch Tracking by default 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: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" This became upstream default (see https://www.phoronix.com/news/Linux-IBT-By-Default-Tip for IT news media coverage), and given its security-relevance, we should adopt this setting as well. Signed-off-by: Peter Müller Reviewed-by: Michael Tremer --- config/kernel/kernel.config.x86_64-ipfire | 2 +- config/rootfiles/common/x86_64/linux | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/kernel/kernel.config.x86_64-ipfire b/config/kernel/kernel.config.x86_64-ipfire index 6c880ca8a..d70a19656 100644 --- a/config/kernel/kernel.config.x86_64-ipfire +++ b/config/kernel/kernel.config.x86_64-ipfire @@ -431,7 +431,7 @@ CONFIG_X86_PAT=y CONFIG_ARCH_USES_PG_UNCACHED=y CONFIG_X86_UMIP=y CONFIG_CC_HAS_IBT=y -# CONFIG_X86_KERNEL_IBT is not set +CONFIG_X86_KERNEL_IBT=y CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y CONFIG_X86_INTEL_TSX_MODE_OFF=y # CONFIG_X86_INTEL_TSX_MODE_ON is not set diff --git a/config/rootfiles/common/x86_64/linux b/config/rootfiles/common/x86_64/linux index fb4ea3a6f..6d00654af 100644 --- a/config/rootfiles/common/x86_64/linux +++ b/config/rootfiles/common/x86_64/linux @@ -11318,6 +11318,7 @@ etc/modprobe.d/ipv6.conf #lib/modules/KVER-ipfire/build/include/config/X86_INTERNODE_CACHE_SHIFT #lib/modules/KVER-ipfire/build/include/config/X86_IOPL_IOPERM #lib/modules/KVER-ipfire/build/include/config/X86_IO_APIC +#lib/modules/KVER-ipfire/build/include/config/X86_KERNEL_IBT #lib/modules/KVER-ipfire/build/include/config/X86_L1_CACHE_SHIFT #lib/modules/KVER-ipfire/build/include/config/X86_LOCAL_APIC #lib/modules/KVER-ipfire/build/include/config/X86_MCE From patchwork Sun Jul 9 14:56:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 6976 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 "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4QzVZW507tz3wjw for ; Sun, 9 Jul 2023 14:56:19 +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 (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4QzVZW18NGzg0; Sun, 9 Jul 2023 14:56:19 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4QzVZW0jH5z2y12; Sun, 9 Jul 2023 14:56:19 +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 "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4QzVZS4lVpz2xYT for ; Sun, 9 Jul 2023 14:56:16 +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 (secp384r1)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4QzVZR15MjzRR for ; Sun, 9 Jul 2023 14:56:14 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1688914575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dBut834qkpPVzFzHAaoEGCvUjs6SgXzomudKVK17Pm4=; b=SXYtcGyqUg1fJZD4TsurlUCxRye1nKw5GafG484inKQeHKMsBlPPca2DDNUwbdjwYhs21W NG+JxKsQyclbeIBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1688914575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dBut834qkpPVzFzHAaoEGCvUjs6SgXzomudKVK17Pm4=; b=OQgBezLsPdw4GSROSU4u24i5RBPIDMpXUh3oaXH+UDcL0nYlry4MikIXT0r2a8d6W4aV/j j5OtoiR2Y70bJORABOiP3L26g3isqT23jD0oM+jxp8u6yWIzYqKpvkbGTaILIUk4vuDeHu 51Swcngyjz5Nn6o2MNRzBg/zaK51dDb/1nVPr+LJXxWufPDntCMM5HRvc6Co+cFfK9ftVP C6duhMTjmKj67eaEtVVLzsNoi7b7HL1rXHbHGxZDurZaI/Fca/dzeaKMeZDHbpXIAjcUF8 r+vDZLT6jh8XKd0SG1Ihh0qH+bCqAGg45p1VxMKJSc7BTAC9E5WTrPGxY3I06A== Message-ID: Date: Sun, 9 Jul 2023 14:56:00 +0000 MIME-Version: 1.0 Subject: [PATCH 2/3] linux: Trigger a BUG() when corruption of kernel data structures is detected To: development@lists.ipfire.org References: From: =?utf-8?q?Peter_M=C3=BCller?= In-Reply-To: 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: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Given that this will merely log such an incident, this can be safely enabled. Cc: Michael Tremer Signed-off-by: Peter Müller --- config/kernel/kernel.config.aarch64-ipfire | 4 ++-- config/kernel/kernel.config.riscv64-ipfire | 4 ++-- config/kernel/kernel.config.x86_64-ipfire | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/kernel/kernel.config.aarch64-ipfire b/config/kernel/kernel.config.aarch64-ipfire index c78902e76..a85704e96 100644 --- a/config/kernel/kernel.config.aarch64-ipfire +++ b/config/kernel/kernel.config.aarch64-ipfire @@ -8584,11 +8584,11 @@ CONFIG_STACKTRACE=y # # Debug kernel data structures # -# CONFIG_DEBUG_LIST is not set +CONFIG_DEBUG_LIST=y # CONFIG_DEBUG_PLIST is not set # CONFIG_DEBUG_SG is not set # CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_BUG_ON_DATA_CORRUPTION is not set +CONFIG_BUG_ON_DATA_CORRUPTION=y # CONFIG_DEBUG_MAPLE_TREE is not set # end of Debug kernel data structures diff --git a/config/kernel/kernel.config.riscv64-ipfire b/config/kernel/kernel.config.riscv64-ipfire index a0c6f2e31..4693aff9c 100644 --- a/config/kernel/kernel.config.riscv64-ipfire +++ b/config/kernel/kernel.config.riscv64-ipfire @@ -7072,11 +7072,11 @@ CONFIG_STACKTRACE=y # # Debug kernel data structures # -# CONFIG_DEBUG_LIST is not set +CONFIG_DEBUG_LIST=y # CONFIG_DEBUG_PLIST is not set # CONFIG_DEBUG_SG is not set # CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_BUG_ON_DATA_CORRUPTION is not set +CONFIG_BUG_ON_DATA_CORRUPTION=y # CONFIG_DEBUG_MAPLE_TREE is not set # end of Debug kernel data structures diff --git a/config/kernel/kernel.config.x86_64-ipfire b/config/kernel/kernel.config.x86_64-ipfire index d70a19656..0ed32f101 100644 --- a/config/kernel/kernel.config.x86_64-ipfire +++ b/config/kernel/kernel.config.x86_64-ipfire @@ -7760,11 +7760,11 @@ CONFIG_STACKTRACE=y # # Debug kernel data structures # -# CONFIG_DEBUG_LIST is not set +CONFIG_DEBUG_LIST=y # CONFIG_DEBUG_PLIST is not set # CONFIG_DEBUG_SG is not set # CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_BUG_ON_DATA_CORRUPTION is not set +CONFIG_BUG_ON_DATA_CORRUPTION=y # CONFIG_DEBUG_MAPLE_TREE is not set # end of Debug kernel data structures From patchwork Sun Jul 9 14:56:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 6977 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 "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4QzVb636clz3wjw for ; Sun, 9 Jul 2023 14:56: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 (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4QzVb51hbnzq2; Sun, 9 Jul 2023 14:56:49 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4QzVb51FNxz2yWM; Sun, 9 Jul 2023 14:56:49 +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 "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4QzVb34SnMz2xYT for ; Sun, 9 Jul 2023 14:56:47 +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 (secp384r1)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4QzVb24XKLzg0 for ; Sun, 9 Jul 2023 14:56:46 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1688914607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C9sGCnky5OKBsvjNQVovPwCbtg71O+L1CVPeT2xVILU=; b=H4xaABvwz1At1QPlbj+JjmDk2y1SxbTnC3QyStDVsnu6lCXH7BoA3cJhslKVISCH2Jh8Lk 00iseB8+hVgQYFCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1688914607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C9sGCnky5OKBsvjNQVovPwCbtg71O+L1CVPeT2xVILU=; b=E4GiLI2Cl9h80PRsvcg6RON+VMBTmX8MQNS0+ZGh455mO9CAxlv4nGU1QeiM0a1D/cRjC5 HJfXt2LZYeDSGFf1aSS4C86ozxUecj3OU2DwpfYaPzPW02J2zysJd8QBNSxTcoenNkhwnh 1Bq6vngArvjH4FxBqko66jRwzp+2xjSK1phIgKr4e4kZf7lNLxMEuOxiwKbmC9IPvYEn4T SWvxG4w6wcF3/KgPkEPUOhWT/OgIvPFDU8yjmEUbokqalBZH9pCcqFocOYrz13ofbwr1N5 diDEsQSbwhU6vePNYWfl6M7f+iVLJ1P7jSzeETdmAqW3tFPx5TdFOgNzzoCgQw== Message-ID: Date: Sun, 9 Jul 2023 14:56:00 +0000 MIME-Version: 1.0 Subject: [PATCH 3/3] linux: Align default IOMMU handling on aarch64 To: development@lists.ipfire.org References: From: =?utf-8?q?Peter_M=C3=BCller?= In-Reply-To: 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: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Resorting to strict default IOMMU handling has been our default for several Core Updates on x86_64 by now, so bring this security improvement to our aarch64 userbase as well. Signed-off-by: Peter Müller --- config/kernel/kernel.config.aarch64-ipfire | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/kernel/kernel.config.aarch64-ipfire b/config/kernel/kernel.config.aarch64-ipfire index a85704e96..dec736a56 100644 --- a/config/kernel/kernel.config.aarch64-ipfire +++ b/config/kernel/kernel.config.aarch64-ipfire @@ -7257,9 +7257,9 @@ CONFIG_IOMMU_IO_PGTABLE_LPAE=y # CONFIG_IOMMU_IO_PGTABLE_DART is not set # end of Generic IOMMU Pagetable Support -# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set +CONFIG_IOMMU_DEFAULT_DMA_STRICT=y # CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set -CONFIG_IOMMU_DEFAULT_PASSTHROUGH=y +# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set CONFIG_OF_IOMMU=y CONFIG_IOMMU_DMA=y CONFIG_ROCKCHIP_IOMMU=y