Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3170469pxb; Thu, 10 Feb 2022 14:09:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwy3dBr5TSjMP0s3+oxZpGr5bwY2ebRekb8UNe4ZE55SELArvnQImMCxUc1z+ryNlDfXZAU X-Received: by 2002:a17:90a:d991:: with SMTP id d17mr5040268pjv.150.1644530940676; Thu, 10 Feb 2022 14:09:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644530940; cv=none; d=google.com; s=arc-20160816; b=xoT2w7M66jH6yeYgnt2QlgnsVx0JJht/viAaI/nMo+1tk2C9fW6WG4Dy2pM/x4IMLo ovCIxrlMbVFzTSPK46aIyT0xv+RSSBeVcyNcihQ3fLwFonG7ZaHeI/jNHBZwYg2OidGW fgbIehPvuGdJ1VtClpsporQPeqIjXs5Kbw7MJbc1nPm/VO84cPVArEAgMTAmDGzvOzXE NCjyfTQsP1lpcLDTYWeiZbYFxvN671gReOWYBpoBR4XMGThcFeU10b9Rd54SplBHx+Ec +RYF8ZwwLKhs0zJbJC4IUYnPVKor2oPxyjIRB4Uc4jVDu7jFZm7EsTAO+QqN/Q/h+6Bp 5JUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=7Q6FfEXX7yH/Ocz8lPxMpIEB1dTMAB+QKP1U+mHX5Pg=; b=UowLunXTt2zN2DALNqwxqykmKDkdtqErGuKnnJ7yU09pSO/UnYzwhIpTuBa/DSZus3 h0+lQrYRIDYie1dLUsJnZQ3I0LZyy6ZsK2ndh0cwVE3Mlfrf104esG9srKnVqKg8gc2K AQSo7xQqTlc0izvoIxJdYJqBIJNDaXhIKE7lQW/URCrwttstsTk/a4Kolj8pXhgTzdjK 9zzMPd2JxH7QuvLzuSeo0nyN4Fg+clVemqIAD8hKYThw+ULaaLviyvuZl4wFlk7xfV/q fXOQJxrkXcj2MYjZwYsbG3jtltUwEBrMfsno1Kq/vhSFJinnPXi5CRzKvITftlAc8kAV 5hCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p9si3256610plf.197.2022.02.10.14.08.45; Thu, 10 Feb 2022 14:08:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245553AbiBJSJL (ORCPT + 99 others); Thu, 10 Feb 2022 13:09:11 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242648AbiBJSJJ (ORCPT ); Thu, 10 Feb 2022 13:09:09 -0500 X-Greylist: delayed 81120 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 10 Feb 2022 10:09:07 PST Received: from cavan.codon.org.uk (cavan.codon.org.uk [176.126.240.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0039F110C; Thu, 10 Feb 2022 10:09:06 -0800 (PST) Received: by cavan.codon.org.uk (Postfix, from userid 1000) id 4117240A61; Thu, 10 Feb 2022 18:09:05 +0000 (GMT) Date: Thu, 10 Feb 2022 18:09:05 +0000 From: Matthew Garrett To: Aditya Garg Cc: Ard Biesheuvel , 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" , 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 Message-ID: <20220210180905.GB18445@srcf.ucam.org> References: <9D0C961D-9999-4C41-A44B-22FEAF0DAB7F@live.com> <20220209164957.GB12763@srcf.ucam.org> <5A3C2EBF-13FF-4C37-B2A0-1533A818109F@live.com> <20220209183545.GA14552@srcf.ucam.org> <20220209193705.GA15463@srcf.ucam.org> <2F1CC5DE-5A03-46D2-95E7-DD07A4EF2766@live.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2F1CC5DE-5A03-46D2-95E7-DD07A4EF2766@live.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 On Thu, Feb 10, 2022 at 05:49:50AM +0000, Aditya Garg wrote: > Looks like there is some error in this patch I'm sorry, I'd build tested it here but clearly screwed that up. Try this one? diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index f3e54f6616f0..18b2ab40bee5 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include @@ -179,6 +181,9 @@ static void efi_call_rts(struct work_struct *work) { void *arg1, *arg2, *arg3, *arg4, *arg5; efi_status_t status = EFI_NOT_FOUND; + unsigned long utf8_name_size; + char *utf8_name; + char guid_str[sizeof(efi_guid_t)+1]; arg1 = efi_rts_work.arg1; arg2 = efi_rts_work.arg2; @@ -203,6 +208,17 @@ static void efi_call_rts(struct work_struct *work) (efi_time_t *)arg2); break; case EFI_GET_VARIABLE: + utf8_name_size = ucs2_utf8size((efi_char16_t *)arg1); + utf8_name = kmalloc(utf8_name_size+1, GFP_KERNEL); + if (!utf8_name) { + printk(KERN_INFO "failed to allocate UTF8 buffer\n"); + break; + } + + ucs2_as_utf8(utf8_name, (efi_char16_t *)arg1, utf8_name_size + 1); + efi_guid_to_str((efi_guid_t *)arg2, guid_str); + + printk(KERN_INFO "Reading EFI variable %s-%s\n", utf8_name, guid_str); status = efi_call_virt(get_variable, (efi_char16_t *)arg1, (efi_guid_t *)arg2, (u32 *)arg3, (unsigned long *)arg4, (void *)arg5);