From patchwork Wed Sep 20 20:57:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamas K Lengyel X-Patchwork-Id: 9962597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E607D6056D for ; Wed, 20 Sep 2017 21:00:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D890925F3E for ; Wed, 20 Sep 2017 21:00:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C79B929243; Wed, 20 Sep 2017 21:00:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C54C62924B for ; Wed, 20 Sep 2017 21:00:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dum4B-0007oP-Lq; Wed, 20 Sep 2017 20:57:55 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dum4A-0007oJ-6C for xen-devel@lists.xenproject.org; Wed, 20 Sep 2017 20:57:54 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id 97/F9-02044-156D2C95; Wed, 20 Sep 2017 20:57:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJIsWRWlGSWpSXmKPExsVyMfSao27AtUO RBi1/dS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1owd97kLZnNVrDrWwdjA+JK9i5GLQ0hgBqNE 776dLCCOhMA7Fon/szcwdjFyADlZEt3N5V2MnEBmmsSb/jOMEHaFxOK7G9lBbCEBDYnbNxuhB k1hkph9+hcbSIJNQFui7fUuVhBbREBJ4t6qyUwgM5kFfCV27eEDCQsL+En8+vYLrIRFQFVi3v dFYDavgIXEpUlXmCF2yUvsarvIOoGRbwEjwypGjeLUorLUIl1DY72kosz0jJLcxMwcXUMDY73 c1OLixPTUnMSkYr3k/NxNjMAgYQCCHYzbtnseYpTkYFIS5T145VCkEF9SfkplRmJxRnxRaU5q 8SFGDQ4Ogc1rV19glGLJy89LVZLgbbkKVCdYlJqeWpGWmQMMY5hSCQ4eJRFeI5A0b3FBYm5xZ jpE6hSjK8eFO5f+MHH8mHQFSDb03ACSB/bcApIdN+/+YRICmy0lzmsD0iwA0pxRmgc3GhaDlx hlpYR5GYEOF+IpSC3KzSxBlX/FKM7BqCTMmw0yhSczrwTugldAxzEBHZe94QDIcSWJCCmpBsZ ZmRc2yvCt/tv844aB+LlHNXZzTXY1T/Y/rj+t/bZLrZNGW7oa27TATOvp0acPK3z7Lc74ZuWN Z/89OCysDvLOvHaex9HC7cqUDwGzCjyPb5siusax2O5qa5Pd3pcPF+bYsm1KuvG0ab/N4sXH/ ipNF1HL0hV0nCo9fe3szKos/6rji3LZevOVWIozEg21mIuKEwEGUSeWvAIAAA== X-Env-Sender: tamas.k.lengyel@gmail.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1505941071!60286210!1 X-Originating-IP: [209.85.214.65] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42844 invoked from network); 20 Sep 2017 20:57:52 -0000 Received: from mail-it0-f65.google.com (HELO mail-it0-f65.google.com) (209.85.214.65) by server-9.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 20 Sep 2017 20:57:52 -0000 Received: by mail-it0-f65.google.com with SMTP id e134so2056002ite.3 for ; Wed, 20 Sep 2017 13:57:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=D3FWFD6dXHNIINX0LnWjzICAGLdPfC23LgOQs9rsWWk=; b=qXyg8Ktm1uKhlzlfKd/UUFQi7Gd77lNbQB70tdJ+XgrpBvDcq54qtLwy9cQhJps9/v fBro/Y7nnZ7mL5EbrtDI6fQancLhEAm4kIPbLGrAWCp/w/DOs+W7103KXDaF1CfHwxbg lo7gRHmAuzGdsUG/PQF1K+Hnku9mGLjejerCZVEYm+VKoQQfl+AmA6wzP/xGC60JVsGm jkdmxd4yxTuIuRzTzhpznn3jhhzC/MP+4b1dFNKc0uZqsjnpCCTkG97PQxxr9rcuibQK xKd6rTbi+M2jmp6lf5QolWuSKL1IXUDUbIEhThlqAGvZFICDFf4g7264BYAsPGMbh3wd iKPA== X-Gm-Message-State: AHPjjUiHJiM6eG8iJIn29Vlt17aRmeepQnJKcJNwVOiqOybgC8xv2DBE 6uc8IwCebygdd/ejMT4c0ERoP9zG X-Google-Smtp-Source: AOwi7QDnWLCUD/lFMbBk2/kCczzSQj/OPFVUoFiVnOZcWmf5FZz3aPhYYly/rejrXniMQmiGVINroQ== X-Received: by 10.36.3.145 with SMTP id e139mr5088979ite.18.1505941070972; Wed, 20 Sep 2017 13:57:50 -0700 (PDT) Received: from drtais0.lan (c-24-9-60-130.hsd1.co.comcast.net. [24.9.60.130]) by smtp.gmail.com with ESMTPSA id e78sm56957itd.36.2017.09.20.13.57.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Sep 2017 13:57:49 -0700 (PDT) From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Wed, 20 Sep 2017 14:57:17 -0600 Message-Id: <20170920205718.17747-1-tamas@tklengyel.com> X-Mailer: git-send-email 2.11.0 Cc: Jan Beulich , Tamas K Lengyel Subject: [Xen-devel] [PATCH 1/2] common/efi: bail if dom0 fails the shim verification step X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Tamas K Lengyel If the shim protocol is located it is expected that the dom0 kernel image will also pass the shim verification. Signed-off-by: Tamas K Lengyel Cc: Jan Beulich --- xen/common/efi/boot.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 01d33004e0..a3a439b838 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -1226,9 +1226,13 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) efi_bs->FreePool(name.w); if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL, - (void **)&shim_lock)) && - (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS ) - PrintErrMesg(L"Dom0 kernel image could not be verified", status); + (void **)&shim_lock))) + { + if ( shim_lock->Verify(kernel.ptr, kernel.size) != EFI_SUCCESS ) + blexit(L"Dom0 kernel image could not be verified by the shim."); + + PrintStr(L"Dom0 kernel image was verified by the shim.\r\n"); + } name.s = get_value(&cfg, section.s, "ramdisk"); if ( name.s )