Received: by 10.223.185.111 with SMTP id b44csp150145wrg; Fri, 9 Mar 2018 02:45:12 -0800 (PST) X-Google-Smtp-Source: AG47ELsTdw82f33wH2d6OGQn32CAbzoDeF4fc11zOIbVIaXXty9kXgGZ2r2vwiV3wSU7wg2axP1z X-Received: by 10.99.110.137 with SMTP id j131mr23925638pgc.85.1520592311932; Fri, 09 Mar 2018 02:45:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520592311; cv=none; d=google.com; s=arc-20160816; b=e78Amu65b2tkKfw3Vmt0xBMqbcNXkDYJOX3YzWlRP9W6mW1090D8AONdGcNfyh1AFK teCvJolBBgagkLDRuR/I/JXFMtliuqzRiqxtZQEzh8Bvi3zp0sSJpFgMOtSU583g+lW3 /SqaAEblVTiQE2O6daR+FZudZiHDN1tNlMssoUccLPbzAH294557wtfMF06eF+I18XmR aVYEnTm4mDVisS19bXfIbApbgRFY+ibXQj4swS/iplJ1a+n+YNn1INaMKJ536gjHRt/r kiZyJC9wbaky4674SssYuXBec3pX6P5DuBBVeiSHQXV48Iw0uyFQi5RcM0RzAls62Gcs SjMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=zB83C4qv2KygQTF+IxgXQuerm/QR4aXYDuJ7PK6qIck=; b=z1LCtvFteYK6+BLfKEyhWv1AmVSMS5kmXobGgsbrPQqW1XyrfpOTXayykMk1xvYrin THGvBPouI2HF6iW0yUbfutm4mvwKSq9y8tW1VX5UimmbjoRW/S3koMlhTzCC83GqxPRC OjASkehBO7YI8aiAnIvy6baUNmtNIvqO3iRwLfBI+j2hHOvZIHEHGKkdHNWLZXirA2XL ETtoKiY02hVrM8fM5hXaLYn7yQ6PPkH+fz1kLekCPtspQaaJxQI6rcXKxyQI6gIYDma6 T+Wffd4RN49Y6pnLC2eVTVo1ym1N4A/pzE3LuzCznyp0HxnR2zRYgunaiANrHxL80G4o 5tTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Wbg/fGA+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2-v6si625652plk.670.2018.03.09.02.44.57; Fri, 09 Mar 2018 02:45:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Wbg/fGA+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751085AbeCIKoE (ORCPT + 99 others); Fri, 9 Mar 2018 05:44:04 -0500 Received: from mail-it0-f46.google.com ([209.85.214.46]:38247 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751008AbeCIKoC (ORCPT ); Fri, 9 Mar 2018 05:44:02 -0500 Received: by mail-it0-f46.google.com with SMTP id j7-v6so2345020ita.3 for ; Fri, 09 Mar 2018 02:44:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zB83C4qv2KygQTF+IxgXQuerm/QR4aXYDuJ7PK6qIck=; b=Wbg/fGA+zmj8d2N+jYaBMmF0zK6r50EdOKLGPAdk2Koe8YROsaABcjnCfipTH1iFvh v8kbXd+kBY9IhyqKKVJd+Uh7dwz8k3BZw2IIiXC+gsYA+EMS71LU65I2KbHuJMP/iCmc OI1O5tzsrtKps/7rzDeUCWmNjh8yFWKRAJbEIqmSapZnI8TskrZQnh0aLtjckw8sMe6m mwnx+413V4WjXKP3cxQ0+hoG8q73BT5rJsY2XxHzPSCozOqrWc3D9YcnAqmul8p0EgJt 8y6U4uJjb1IGTzPfYB/hphJHK/tOTGnbdZFokYFtYsprey00Zy8labR4nYksGZ6nYgWK swuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zB83C4qv2KygQTF+IxgXQuerm/QR4aXYDuJ7PK6qIck=; b=AHRUTifyA0StjYPy4+c8575oAal/qjZyABHpD7//eS1CXR2nR+9lCO6gHjzTx43FcZ hzadkWYW8CBzHS94h2F+3eNeZX0SkAsayIwLFSqyy/Ouo0PNPSHUNVyRpiHow95lbmZl fprFqoDiZREmK603rg5fxp3t1+MxT686FcrrpYA9fu+99eTuO4KMEENS+/KQbve6llvw yK4nsF+jjngQWAtNVnjufEyykhJZdFSXaPn+YKqFcFsG2oLcSzefQWEkT5cBhaqo8d8j BdpnPhuyQAf74B20jdK8JDHZe8Zzu4eZ9KNkA+9mnld/NDX8WlN1HtTKQMjfOTfJd3y+ bnSg== X-Gm-Message-State: AElRT7EMzcI1gr2JVB0flDxMSfaZ4K8dmQHlurFgDvCExUIexvXtxTko BJOkz9cC6nSRk0oO5JhxfhvL/5+ty+T1q1m2UFEhLg== X-Received: by 2002:a24:5ad4:: with SMTP id v203-v6mr2975359ita.150.1520592241528; Fri, 09 Mar 2018 02:44:01 -0800 (PST) MIME-Version: 1.0 References: <01000161fc0b4755-df0621f4-ab5d-479a-b425-adf98427a308-000000@email.amazonses.com> <0100016206a68850-bd5c96b3-f275-46ea-98b1-1317e02a5d6e-000000@email.amazonses.com> <29c1640a-cf19-ca19-7de9-96f202edfb5a@redhat.com> In-Reply-To: <29c1640a-cf19-ca19-7de9-96f202edfb5a@redhat.com> From: Thiebaud Weksteen Date: Fri, 09 Mar 2018 10:43:50 +0000 Message-ID: Subject: Re: Regression from efi: call get_event_log before ExitBootServices To: Jeremy Cline Cc: hdegoede@redhat.com, Javier Martinez Canillas , Jarkko Sakkinen , linux-efi@vger.kernel.org, linux-integrity@vger.kernel.org, tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 9, 2018 at 10:29 AM Hans de Goede wrote: > Hi, > On 08-03-18 18:26, Jeremy Cline wrote: > > On 03/08/2018 11:50 AM, Hans de Goede wrote: > >> >> added these now> > >> > >> Hi, > >> > >> On 07-03-18 12:34, Javier Martinez Canillas wrote: > > > > > > > >>> Are you also able to read the TPM event logs? > >>> > >>> $ hexdump /sys/kernel/security/tpm0/binary_bios_measurements > >> > >> Yes for me that outputs a lot of hex :) > > > > For me, /sys/kernel/security/tmp0 doesn't exist on 4.15.6 or 4.16 with > > the patch reverted. > Hmm, have you re-enabled the TPM in the BIOS? > >>> The UEFI firmware does some measurements and so does shim. So you should > >>> have some event logs. What version of shim are you using? And also would > >>> be good to know if it's the same shim version that Jeremy is using. > >> > >> That is a very good question, I'm using: shim-ia32-13-0.7.x86_64, which is > >> the last version for F27 AFAICT. > > > > All my tablet has installed is shim-0.8-10.x86_64, no shim-ia32. > Yes my bad, although if the kernel changes break booting on systems > without the shim that is still good to know and something which > we probably ought to fix. > >> But Jeremy's tablet might very well be not using the shim at all, as > >> I manually installed Fedora 25 on the tablet he now has, before Fedora > >> supported > >> machines with 32 bit EFI. I then later did a "dnf distro-sync" to > >> Fedora-27. > >> > >> Jeremy might also very well still be booting using a grub binary I build > >> manually back then, without any shim being involved. > >> > >> Jeremy what does efibootmgr -v output on your device ? > > > > # efibootmgr -v > > BootCurrent: 0003 > > Timeout: 4 seconds > > BootOrder: 0003,0000,0001,2001,2002,2003 > > Boot0000* Android X64 OS > > HD(1,GPT,215e6cf3-e97d-4735-9c4e-7338c8f5a645,0x800,0x32000)/File(\EFI\BOOT\bootx64.efi)RC > > Boot0001* Internal EFI Shell > > FvVol(a881d567-6cb0-4eee-8435-2e72d33e45b5)/FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)RCM&". > > Boot0003* Fedora > > HD(1,GPT,215e6cf3-e97d-4735-9c4e-7338c8f5a645,0x800,0x32000)/File(\EFI\fedora\grubx64.efi) > > Boot2001* EFI USB Device RC > > Boot2002* EFI DVD/CDROM RC > > Boot2003* EFI Network RC > > Boot8087* Udm > > FvVol(a881d567-6cb0-4eee-8435-2e72d33e45b5)/FvFile(9a9ab4c1-ee1b-488b-b300-24544a7bd418) > > > > I think you're right about it using the old grub binary. I'm > > embarrassingly unfamiliar with both UEFI and grub, but I'm guessing you > > set the location of grub.cfg at compile time? When I boot > > \EFI\fedora\grubx64.efi, it's pulling the grub.cfg from > > \EFI\redhat\grub.cfg. > Ah yes, so I did not build my own grub I took one from RHEL as that had > 32 bit UEFI support before Fedora got it and as I was lazy I copied the > 32 bit binary over the 64 bit one, so don't let the filename fool you. > What you could do is install grub2-efi-ia32 from the Fedora 27 repos > and then use efibootmgr to add an entry pointing to \EFI\fedora\grubia32.efi > note that one will look at \EFI\fedora\grub.cfg . > Then see if the problem persists. A second step would be to also install > shim-ia32 and point to that... Thanks a lot for trying out the patch! Please don't modify your install at this stage, I think we are hitting a firmware bug and that would be awesome if we can fix how we are handling it. So, if we reach that stage in the function it could either be that: * The allocation did not succeed, somehow, but the firmware still returned EFI_SUCCEED. * The size requested is incorrect (I'm thinking something like a 1G of log). This would be due to either a miscalculation of log_size (possible) or; the returned values of GetEventLog are not correct. I'm sending a patch to add checks for these. Could you please apply and retest? Again, thanks for helping debugging this. > Regards, > Hans