From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE8343AFD06 for ; Sun, 19 Jul 2026 18:03:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784484244; cv=none; b=oKjXeRh2N8GoqRHN4L9pVeBo2gB6XWmRxDjTG33MA0moPMy9V0iusQzP4p0fd4ZWyGv5bfDBPtD2KroGIkIcawSEuF4G1hrviaEwmDJ5jv6Q836k4FQ4n6dkny/VXzYdv21HZJSxTWaUmQb9fbxWqBNb7n/KBLXZBJpuJrDe4EE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784484244; c=relaxed/simple; bh=v9HeOFbg7yqaPJFAebJkoHX6/z4ZNAksuMZiGZTzcV8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=swyEj4Y9DAV5AthwIQZeYxWC7t3R3237YnHrTP21NWquZcPyZJnUoXCEBu1al5P/S9Z3YQJtKavRNRWZPHyPqL/HJzAnFrYwY7BYLw/Xo7FW3ocd3oR89o5wbsxM10xS/VUTkJgM4BTi7EW1UwelAGobwaetw2qoNtLYsanomKk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gg7MNV9C; arc=none smtp.client-ip=209.85.215.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gg7MNV9C" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-c99eaa1f020so5947532a12.2 for ; Sun, 19 Jul 2026 11:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784484235; x=1785089035; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=SdVZ4aGJrm1DuTj3OJVvOnHsBpK+4e3jVQB95QmtQUM=; b=gg7MNV9CA9igFeOzIJfAXVNKOwkbLs9PG4eMCYQjLezdWaZeh7jVGLj5Bj+Ifn4bGZ 9k7C45ijMqgkKegBw2uAAYb2GPAqQ8ebq/LU9PHT/VfBPXsw4/R5BiIXxbb/h6EKYtGl jHGI7NRDvxstNnUchf2jW03fLgLCF4a97s4DP+uQ1hn2Kd3dmFBTLw9lNvT4mIC61tgW ZiI5dd/5sYZ1v3FyIwphdF9J1lp25UR/KdNFZItpiBWIJon9xb7I23APgu02mGWys9uZ VQWOEPF7tUF4JX95pBH7CI77gBwfNsugWDFHrFpz1euzx9cWfs26ekO/zsIKOxDppCUd uK4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784484235; x=1785089035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=SdVZ4aGJrm1DuTj3OJVvOnHsBpK+4e3jVQB95QmtQUM=; b=s2bTgh6wn9AF6J0sR6Kixswi/BDMNqPR45oWK9YRsqEzKpW7t7QeBmxZGIU2fopBoN 5p+zjyG7vzRp61nreqEF04CGZ68os4xz4RyX81/G8jqUClMc1M/1Z/R6mTvGrhVs7zrT ZL2ZLlFDUZvlsf1k+JvBmcp324tt5kScyQFteZiTbENcMZOsPrX+upOHKocckhxGLo+f +Y+Zb+dos5Vn0mVwwZqaIT82rwJyn0/aPAyxqTUEk1wvKIjuGinyq9rnpIPIuG7tsskC R8LvPYSmAhirS5HzfX3lasZDwi0cRA7yJLmpvm8DZGppWChF5yjP83Urm0Gi8CleERND 9h3Q== X-Forwarded-Encrypted: i=1; AHgh+RqDrf3RSqxK1wATvNCuxZyMnHj9EubNeUZF63fs+y3bLywzgkM5exZWuH06ozET3Oq+ZybXWSi6Fmg=@vger.kernel.org X-Gm-Message-State: AOJu0Yz04R+sUKFe9p+ueZsDK1RsP84oBMNvXk8c1WvLAwTR50+e79EA 751iCPYfM63QB7Wc/5LwieauEGv1ambTunfRfX4HrvsggdoW2wVyoMo= X-Gm-Gg: AfdE7clDQNKlxqAKVn5fY5Bn+Q+JIQL8kZN6QTF08p2BciYfHTybfIV5XJtBLRD4pnO sR+Rag+roKTEvnEv2il4J7adq0Ve1Qz+3KF/pd7oXD5fhPBsCOEal0ph3hdTRXQCgiJ8usgP5hI qwdXHiUR7b6qIkboEJoJQznXx3d23KyhKF5K+3gEqpvxEPYnqOV+v75XcXaOfLOn04xmITH5HtX aYBoCMFgGsBEI8cIaE8JE7U3w8SmlEaXB4F5wBz4ILO+tkEGlEjuVQUjQbzfbdykkeUcp/gcU0X 6hkK3Enkd2xvF8iwGhDuEC5+dJGMwvP+cApXwt7KNkxevhRABglTj91YOX8r7oTHGYqDLYqc5yJ WJ1nrGhLQFb6QkvIUpMeD96H+GyR/X6Mv3KwJ8BarTMvzRdfqXQgOd9wFn2pePaZzS2Vi/b08AL ExqfT9EAa2kj+PEvJnd4hOpcw4L4wisqD6q0n0Omld X-Received: by 2002:a05:6a20:bca2:b0:3c3:bbe6:95c7 with SMTP id adf61e73a8af0-3c3bbe69a9amr6850926637.17.1784484235584; Sun, 19 Jul 2026 11:03:55 -0700 (PDT) Received: from at-Standard-PC-Q35-ICH9-2009.. ([106.194.66.250]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3142a02b7f2sm27967645eec.13.2026.07.19.11.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jul 2026 11:03:54 -0700 (PDT) From: Atharva Tiwari To: Cc: Atharva Tiwari , Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andreas Noever , Mika Westerberg , Yehezkel Bernat , Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Jarkko Sakkinen , Mimi Zohar , Roberto Sassu , Dmitry Kasatkin , Eric Snowberg , Paul Moore , James Morris , "Serge E. Hallyn" , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [PATCH 1/2] treewide: Add a flag to detect the Apple T2 chip Date: Sun, 19 Jul 2026 14:03:03 -0400 Message-ID: <20260719180308.1398-2-atharvatiwarilinuxdev@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260719180308.1398-1-atharvatiwarilinuxdev@gmail.com> References: <20260719180308.1398-1-atharvatiwarilinuxdev@gmail.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add a flag to detect Apple T2 chips on Intel Macs. Cache the result to avoid repeated checks. That will be used in upcoming patches. Signed-off-by: Atharva Tiwari --- arch/x86/pci/fixup.c | 10 +++++ include/linux/platform_data/x86/apple.h | 5 +++ security/integrity/platform_certs/load_uefi.c | 38 ++++--------------- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index b301c6c8df75..fbd204ca4c6d 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -995,6 +996,15 @@ static void asus_disable_nvme_d3cold(struct pci_dev *pdev) } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x9a09, asus_disable_nvme_d3cold); +bool has_t2_chip; +EXPORT_SYMBOL(has_t2_chip); + +static void apple_has_t2_chip(struct pci_dev *pdev) +{ + has_t2_chip = true; +} +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_APPLE, 0x1801, apple_has_t2_chip); + #ifdef CONFIG_SUSPEND /* * Root Ports on some AMD SoCs advertise PME_Support for D3hot and D3cold, but diff --git a/include/linux/platform_data/x86/apple.h b/include/linux/platform_data/x86/apple.h index 079e816c3c21..a2ab63bd1eac 100644 --- a/include/linux/platform_data/x86/apple.h +++ b/include/linux/platform_data/x86/apple.h @@ -6,8 +6,13 @@ * x86_apple_machine - whether the machine is an x86 Apple Macintosh */ extern bool x86_apple_machine; +/** + * has_t2_chip - whether the machine has the Apple T2 chip + */ +extern bool has_t2_chip; #else #define x86_apple_machine false +#define has_t2_chip false #endif #endif diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c index c0d6948446c3..da57ac322e72 100644 --- a/security/integrity/platform_certs/load_uefi.c +++ b/security/integrity/platform_certs/load_uefi.c @@ -3,42 +3,16 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include "../integrity.h" #include "keyring_handler.h" -/* - * On T2 Macs reading the db and dbx efi variables to load UEFI Secure Boot - * certificates causes occurrence of a page fault in Apple's firmware and - * a crash disabling EFI runtime services. The following quirk skips reading - * these variables. - */ -static const struct dmi_system_id uefi_skip_cert[] = { - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookPro15,1") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookPro15,2") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookPro15,3") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookPro15,4") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookPro16,1") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookPro16,2") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookPro16,3") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookPro16,4") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookAir8,1") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookAir8,2") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacBookAir9,1") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "Macmini8,1") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "MacPro7,1") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "iMac20,1") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "iMac20,2") }, - { UEFI_QUIRK_SKIP_CERT("Apple Inc.", "iMacPro1,1") }, - { } -}; - /* * Look to see if a UEFI variable called MokIgnoreDB exists and return true if * it does. @@ -165,10 +139,14 @@ static int __init load_uefi_certs(void) unsigned long dbsize = 0, dbxsize = 0, mokxsize = 0; efi_status_t status; int rc = 0; - const struct dmi_system_id *dmi_id; - dmi_id = dmi_first_match(uefi_skip_cert); - if (dmi_id) { + /* + * On T2 Macs reading the db and dbx efi variables to load UEFI Secure Boot + * certificates causes occurrence of a page fault in Apple's firmware and + * a crash disabling EFI runtime services. The following quirk skips reading + * these variables. + */ + if (has_t2_chip) { pr_err("Reading UEFI Secure Boot Certs is not supported on T2 Macs.\n"); return false; } -- 2.43.0