Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1957943pxb; Wed, 9 Feb 2022 08:04:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxx+6QsLd73TcKDrak1IS1PIlaGx5G/HnRWazFoMPXChQk/w4I2nEamOmZSrZafPjWzYRbo X-Received: by 2002:a17:906:ecf1:: with SMTP id qt17mr2583928ejb.481.1644422644272; Wed, 09 Feb 2022 08:04:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644422644; cv=none; d=google.com; s=arc-20160816; b=S0GAToLsWWQRG3921dlm27S186Nqi7pzCoT35nY0AqVDI5Pd31Uqc1K3FTTQdk9wQC 6/9gNhC6y8vDnZ367uvfQcSqTVv5CNy2nTDxaQl/o9G72eN/HPJpIk1Fym3a0pgTR2UO QEWdUklaBc/fwVqZaPNlPewl7bEVWzuN9HG8V0DozBOWOmmixPyAhznMK7qeojVhWIfo EYvK8Cp5NXoM6gDYhep+rlaOqRz/68L/4kM4SqP2eWTWTLbA7CVs9LJjSrU0mUx7uTof 8uAIyMabI4xsqQ0GZqy0uLfudkRE6cNuI3/ixBOrMAZC3vq1znNlHSIeCpoJtr/Yrkw+ Ppyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=HbanuGDpafHlTNAVfWeTdUQEHmd2sBRy2TC+0BA4FfU=; b=KbtrNzX2qhcARUBxs+klHd7sZ7mr80rbS4LSmAOWoKQoDt3OjZabbyxP9nrUs2VToB kCTaeCNR1EEvPC9b4786Wp2XbkG4hKZk9IyKRRIKmcfTcq3VuT5f2zuRVx6SKM4uruzV nTeI4nB9wKmOSGECxyQ/dKYuTgrhLrBPY7Lg1Eiif3ErJd9DGVHJmSFEreU63vlkK1UA 0dVhBQQk6APw1c2eItVn04dEdik9oCMzYHmW1rf/xBprhASMVSH3tUHCKchlj6yop96o d6L0MdyY15VJejHQmg5tppbUIY4xm65Pk024gQBXi3/0qQ8Ty4kORJFTbidVzsiqzErd eIsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r20si13140608edd.7.2022.02.09.08.03.33; Wed, 09 Feb 2022 08:04:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236080AbiBIPjK convert rfc822-to-8bit (ORCPT + 99 others); Wed, 9 Feb 2022 10:39:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236077AbiBIPjF (ORCPT ); Wed, 9 Feb 2022 10:39:05 -0500 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF794C0612BE for ; Wed, 9 Feb 2022 07:39:07 -0800 (PST) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-266-CLFZHHFuMYWxCblHNniABg-1; Wed, 09 Feb 2022 15:39:04 +0000 X-MC-Unique: CLFZHHFuMYWxCblHNniABg-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Wed, 9 Feb 2022 15:39:02 +0000 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.028; Wed, 9 Feb 2022 15:39:02 +0000 From: David Laight To: 'Aditya Garg' , Ard Biesheuvel , Matthew Garrett , Jeremy Kerr , "joeyli.kernel@gmail.com" , "zohar@linux.ibm.com" , "jmorris@namei.org" , "eric.snowberg@oracle.com" , "dhowells@redhat.com" , "jlee@suse.com" , "James.Bottomley@hansenpartnership.com" , "jarkko@kernel.org" , "mic@digikod.net" , "dmitry.kasatkin@gmail.com" CC: Linux Kernel Mailing List , "linux-efi@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "stable@vger.kernel.org" , "keyrings@vger.kernel.org" , "linux-integrity@vger.kernel.org" , Orlando Chamberlain , Aun-Ali Zaidi Subject: RE: [PATCH] efi: Do not import certificates from UEFI Secure Boot for T2 Macs Thread-Topic: [PATCH] efi: Do not import certificates from UEFI Secure Boot for T2 Macs Thread-Index: AQHYHcE4Urimp9LpDkeI7ezkgv1YDayLWeDg Date: Wed, 9 Feb 2022 15:39:02 +0000 Message-ID: <755cffe1dfaf43ea87cfeea124160fe0@AcuMS.aculab.com> References: <9D0C961D-9999-4C41-A44B-22FEAF0DAB7F@live.com> In-Reply-To: <9D0C961D-9999-4C41-A44B-22FEAF0DAB7F@live.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aditya Garg > Sent: 09 February 2022 14:28 > > On T2 Macs, the secure boot is handled by the T2 Chip. If enabled, only > macOS and Windows are allowed to boot on these machines. Thus we need to > disable secure boot for Linux. If we boot into Linux after disabling > secure boot, if CONFIG_LOAD_UEFI_KEYS is enabled, EFI Runtime services > fail to start, with the following logs in dmesg > .. > +static const struct dmi_system_id uefi_apple_ignore[] = { > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."), > + DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro15,1"), > + }, I think I'd use: #define xxx(vendor, product) \ .matches = { DMI_MATCH(DMI_BOARD_VENDOR, vendor), \ DMI_MATCH(DMI_PRODUCT_NAME, product), \ } somewhere with a suitable name (bikeshed blue) to reduce the code size of this table. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)