Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753387AbdC1POK (ORCPT ); Tue, 28 Mar 2017 11:14:10 -0400 Received: from david.siemens.de ([192.35.17.14]:52704 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752474AbdC1POJ (ORCPT ); Tue, 28 Mar 2017 11:14:09 -0400 Subject: Re: [PATCH v2 5/7] efi/capsule: Prepare for loading images with security header To: Ard Biesheuvel , Matt Fleming References: <47e87c8eccc0ee5c4033ece037c0bffc32782876.1490376860.git.jan.kiszka@siemens.com> Cc: "linux-efi@vger.kernel.org" , Linux Kernel Mailing List , Andy Shevchenko , "Bryan O'Donoghue" , Hock Leong Kweh , Borislav Petkov , Sascha Weisenberger From: Jan Kiszka Message-ID: Date: Tue, 28 Mar 2017 17:13:15 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2045 Lines: 48 On 2017-03-28 15:49, Ard Biesheuvel wrote: > On 24 March 2017 at 17:34, Jan Kiszka wrote: >> The Quark security header is nicely located in front of the capsule >> image, but we still need to pass the image to the update service as if >> there was none. Prepare efi_capsule_update and its user for this by >> defining and evaluating a EFI header displacement in the image located >> in memory. For standard-conforming capsules, this displacement is 0. >> >> Signed-off-by: Jan Kiszka > > Hello Jan, > > Thanks for taking the time to respin this. > > I played around with these patches a bit (I can't really test them > since I don't have the hardware), and I am not really happy with the > non-trivial changes to the generic code, only to allow a header > displacement. > > So instead, I attempted to come up with an alternative which does not > use a displacement field, but makes the core capsule routines work > with a copy of the capsule header rather than mandating that it exists > at the start of the buffer. This way, we can override the code that > performs the copy, and make it originate from somewhere else. > > Could you please have a look at > > https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=quark-capsule > > and tell me if that would work for you? I will send them out for > proper review in any case, but to avoid confusion (if I missed > something obvious), I don't want to send them out just yet. There is more needed to make things work again, maybe around passing the right image size. I'm looking into this. Another observation: Making EFI_CAPSULE_QUIRK_QUARK_CSH select EFI_CAPSULE_LOADER technically resolves the problem that the platform code would otherwise need something from a capsule loader module. However, a logical configuration would rather make the quirk depend on the loader, wouldn't it? But I'm fine with both. Thanks, Jan -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux