From patchwork Mon Sep 27 15:56:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 1533428 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=TwQpOUjy; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HJ6jN3X09z9tk6 for ; Tue, 28 Sep 2021 01:57:43 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mUt0M-0006fJ-DG; Mon, 27 Sep 2021 15:57:22 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mUt0K-0006dV-OC for kernel-team@lists.ubuntu.com; Mon, 27 Sep 2021 15:57:20 +0000 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 8C3B43F4B9 for ; Mon, 27 Sep 2021 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632758240; bh=PF9qbCuxbMN2V4P7937JXnG09/aMg8RcUVbWBFjhrCU=; h=From:To:Subject:Date:Message-Id:MIME-Version:Content-Type; b=TwQpOUjyyyKXeHBp4zDdRFhKPx7MP6qZhX3acZOIVzJO5T4WV/2CnyXrPJsL1Q+eC r487yBEeiGiwK4pC9USdHFYUjv8J7d32YkKXDRbRGvma4joOaD9wec0sYW1raFQhkc Rc2xgedcAqSy94S8Ee0ZjTiOpe+CwtPnddRgFBDRycaMhJKiG5Hie/jcGqHx/hjzCP a/YNMxmcSr/GA/m7Zj0Qtxddw6ae3M3UCPMQlWKate3jVTyNqt7U5ViqmAW2MuUWoC MBWLoJZAcI8vA/VBXIYdsF9PJ8LmjptervF3Z7nEECDfpKfJVUQCMr7cLYFrdtqW1t LcbrGCtECUuEQ== Received: by mail-wm1-f72.google.com with SMTP id y142-20020a1c7d94000000b0030cdc76dedeso385564wmc.5 for ; Mon, 27 Sep 2021 08:57:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PF9qbCuxbMN2V4P7937JXnG09/aMg8RcUVbWBFjhrCU=; b=23+rNpb9z98xhUPqLgBtjksMJSMlAs+RQoy9j8HX3WNwQycfb1bPJSkTGup/rDxHl2 9oU19YNZJz6Df0xlipIGjplRfQ92HW6KtxWAeFwRmUfDYDyiPXF0RJjNwnIFiX/vBlz5 leNHTG0cn4LRspBhKsssBsUFbbj4RHe5VHPoQT7PP++B6b5uD6iNlLr6a2DXS4Tn/lrC ikQtWSKZfb+1hUAVNlz//5p0pR70ahtEIlkLmwU1s1zMbtLTbuCIQPC6I6oCxd/wqkWM c7McW2PKxslrDpluZIyH10wnNCiaelOgipaDdr+IDg19L1ZpIqqnv6IxniXlggZ+NAnn C4XA== X-Gm-Message-State: AOAM530MNhzw+p+CZO5G4R6USbMVtjhamD9izrW9ampE9QuMKlGNySRE XYbg+IEMFKPcqwRs9o2drBj97ZVU6wG+ysWr07JY6oLfBbOwbCWH50my+TsW3oF27xkyNRa1+LB brxHdcreQoGwqqLnp1+W5X10pcU9ye+RBwbYftUhs7Q== X-Received: by 2002:a5d:49ce:: with SMTP id t14mr662654wrs.127.1632758239943; Mon, 27 Sep 2021 08:57:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2rrAz6CM3Fk5kPTzLsr45iGpGAYMkHCSpdE+XxB4lJ4JORq74YeVXGxlrBE2CI0GlV2NlMQ== X-Received: by 2002:a5d:49ce:: with SMTP id t14mr662632wrs.127.1632758239646; Mon, 27 Sep 2021 08:57:19 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:86ad:7d9c:de94:eed0]) by smtp.gmail.com with ESMTPSA id x21sm20906973wmc.14.2021.09.27.08.57.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 08:57:19 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [SRU][F/hwe-5.8][PATCH 00/18] Support builtin revoked certificates and mokvar-table Date: Mon, 27 Sep 2021 16:56:54 +0100 Message-Id: <20210927155712.164337-1-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1928679 BugLink: https://bugs.launchpad.net/bugs/1932029 Link: https://trello.com/c/iPc3IqC9 (private) Same story as before, backport support for builtin revoked certificates, add support loading revoked certificates from mokvar-table. Note that for v5.8 it also means backporting the mokvar-table driver as a whole, since it was only introduced upstream in v5.9. This backport is for hwe-5.8 kernel, which whilst not built/released anymore, is used as basis for azure-5.8 kernel. If/when azure-5.8 is cranked on top of these changes, it must also adjust the config to enable CONFIG_SYSTEM_REVOCATION_KEYS. Without adjusting the config boot testing will fail, as it will notice that support is available but not turned on. Built as hwe-5.8 kernel and tested in VM. Most patches are cherry-picks from upstream, apart from UBUNTU: ones which are packaging or SAUCE patch cherry-picks from impish:linux. Previous backports of this: v5.13: https://lists.ubuntu.com/archives/kernel-team/2021-June/121362.html v5.11: https://lists.ubuntu.com/archives/kernel-team/2021-August/122996.html v5.10: https://lists.ubuntu.com/archives/kernel-team/2021-August/123470.html Ard Biesheuvel (2): efi: mokvar-table: fix some issues in new code efi: mokvar: add missing include of asm/early_ioremap.h Borislav Petkov (1): efi/mokvar: Reserve the table only if it is in boot services data Dimitri John Ledkov (6): Revert "UBUNTU: SAUCE: Dump stack when X.509 certificates cannot be loaded" UBUNTU: SAUCE: integrity: Load mokx certs from the EFI MOK config table UBUNTU: SAUCE: integrity: add informational messages when revoking certs UBUNTU: [Packaging] build canonical-revoked-certs.pem from branch/arch certs UBUNTU: [Packaging] Revoke 2012 UEFI signing certificate as built-in UBUNTU: [Config] Configure CONFIG_SYSTEM_REVOCATION_KEYS with revoked keys Eric Snowberg (4): certs: Add EFI_CERT_X509_GUID support for dbx entries certs: Move load_system_certificate_list to a common function certs: Add ability to preload revocation certs integrity: Load mokx variables into the blacklist keyring Lenny Szubowicz (3): efi: Support for MOK variable config table integrity: Move import of MokListRT certs to a separate routine integrity: Load certs from the EFI MOK config table Linus Torvalds (1): certs: add 'x509_revocation_list' to gitignore Tim Gardner (1): UBUNTU: SAUCE: Dump stack when X.509 certificates cannot be loaded arch/x86/kernel/setup.c | 1 + arch/x86/platform/efi/efi.c | 3 + certs/.gitignore | 1 + certs/Kconfig | 17 + certs/Makefile | 21 +- certs/blacklist.c | 67 ++++ certs/blacklist.h | 2 + certs/common.c | 58 +++ certs/common.h | 9 + certs/revocation_certificates.S | 21 + certs/system_keyring.c | 56 +-- debian.hwe-5.8/config/config.common.ubuntu | 2 + debian.master/config/annotations | 1 + debian.master/config/config.common.ubuntu | 2 + .../revoked-certs/canonical-uefi-2012-all.pem | 86 +++++ debian/rules | 14 +- drivers/firmware/efi/Makefile | 1 + drivers/firmware/efi/arm-init.c | 1 + drivers/firmware/efi/efi.c | 6 + drivers/firmware/efi/mokvar-table.c | 362 ++++++++++++++++++ include/keys/system_keyring.h | 15 + include/linux/efi.h | 34 ++ scripts/Makefile | 1 + .../platform_certs/keyring_handler.c | 12 + security/integrity/platform_certs/load_uefi.c | 107 +++++- 25 files changed, 830 insertions(+), 70 deletions(-) create mode 100644 certs/common.c create mode 100644 certs/common.h create mode 100644 certs/revocation_certificates.S create mode 100644 debian/revoked-certs/canonical-uefi-2012-all.pem create mode 100644 drivers/firmware/efi/mokvar-table.c Acked-by: Tim Gardner Acked-by: Stefan Bader