From patchwork Tue May 18 09:56:42 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: 1480160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 4Fkry02301z9sWW; Tue, 18 May 2021 19:56:55 +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 1liwT6-0004cn-Ni; Tue, 18 May 2021 09:56:52 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1liwT4-0004cM-MW for kernel-team@lists.ubuntu.com; Tue, 18 May 2021 09:56:50 +0000 Received: from mail-wr1-f69.google.com ([209.85.221.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1liwT4-0007rl-FV for kernel-team@lists.ubuntu.com; Tue, 18 May 2021 09:56:50 +0000 Received: by mail-wr1-f69.google.com with SMTP id v5-20020adf9e450000b029010e708f05b3so5351341wre.6 for ; Tue, 18 May 2021 02:56:50 -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:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ecu2RWPeJejW6Crx68xSqWnkIMk83rOZhGQ/YwMeS7c=; b=aIwWfrLtC4KrePGEAOHtZfYQIfZWKzlRNrJyVTsfT/G+iXB0akXmQKxAfXYvN8e24T 58G1+qi0j2AwpnBjcKxVaZV4rMuhkC88ppubkhqYOHN1gnN4WEd6IfuZFblZwatZCjYX 0/CgeABfZE3agJvTUf6PCTDisCKfYuvZytoUgF8wBrVF7uCRly0Q7tdELAVTQEcvudMs jf86S+9OM0KbM8i0E97Ja15jSIFoqAEVt5P5GxlrN4LZP59lWZ2DQ/xJfetORqcP6Q65 78q5FCxjdz5eNi3Qd6/YL5O2W9cmd2Agzi+M45vKIel5DAeUpt+x8m91vnMjY3Jyxpuf aj1g== X-Gm-Message-State: AOAM531pCeHQGzk99+AzQ/Ncn9ql1aErXUW0czZzqD+RkM6engqgDGle QkqwUAbyUv4rVdlzwy52evzItyiYBcAnImXKov+YsvpWDuY6CLZAvY+yuvBSocwvcas5sHrmrFq MK4d1oEKmQZTDXWhlYD9WmPMjZHagSByNWL86NHhM9Q== X-Received: by 2002:a1c:bb0a:: with SMTP id l10mr4533274wmf.96.1621331809913; Tue, 18 May 2021 02:56:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTpyEUPD10uk053M54uxHZqexzSZdFkUW6aeL5/nbs9wzOl5ZX5I39sXh7jSWVDgXWrPR07g== X-Received: by 2002:a1c:bb0a:: with SMTP id l10mr4533255wmf.96.1621331809719; Tue, 18 May 2021 02:56:49 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:5e37:8c51:f26a:2ada]) by smtp.gmail.com with ESMTPSA id b7sm20061514wri.83.2021.05.18.02.56.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 02:56:49 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [UNSTABLE][PATCH v3 2/2] UBUNTU: SAUCE: integrity: add informational messages when revoking certs Date: Tue, 18 May 2021 10:56:42 +0100 Message-Id: <20210518095642.132998-3-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210518095642.132998-1-dimitri.ledkov@canonical.com> References: <20210517131848.61153-1-dimitri.ledkov@canonical.com> <20210518095642.132998-1-dimitri.ledkov@canonical.com> 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" integrity_load_cert() prints messages of the source and cert details when adding certs as trusted. Mirror those messages in uefi_revocation_list_x509() when adding certs as revoked. Sample dmesg with this change: integrity: Platform Keyring initialized integrity: Loading X.509 certificate: UEFI:db integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4' integrity: Revoking X.509 certificate: UEFI:MokListXRT (MOKvar table) blacklist: Revoked X.509 cert 'Canonical Ltd. Secure Boot Signing: 61482aa2830d0ab2ad5af10b7250da9033ddcef0' integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table) integrity: Loaded X.509 cert 'Canonical Ltd. Master Certificate Authority: ad91990bc22ab1f517048c23b6655a268e345a63' BugLink: https://bugs.launchpad.net/bugs/1928679 Signed-off-by: Dimitri John Ledkov --- certs/blacklist.c | 3 +++ security/integrity/platform_certs/keyring_handler.c | 1 + 2 files changed, 4 insertions(+) diff --git a/certs/blacklist.c b/certs/blacklist.c index c9a435b15af4..9e8998868e3e 100644 --- a/certs/blacklist.c +++ b/certs/blacklist.c @@ -172,6 +172,9 @@ int add_key_to_revocation_list(const char *data, size_t size) if (IS_ERR(key)) { pr_err("Problem with revocation key (%ld)\n", PTR_ERR(key)); return PTR_ERR(key); + } else { + pr_notice("Revoked X.509 cert '%s'\n", + key_ref_to_ptr(key)->description); } return 0; diff --git a/security/integrity/platform_certs/keyring_handler.c b/security/integrity/platform_certs/keyring_handler.c index 5604bd57c990..9f85626702b2 100644 --- a/security/integrity/platform_certs/keyring_handler.c +++ b/security/integrity/platform_certs/keyring_handler.c @@ -61,6 +61,7 @@ static __init void uefi_blacklist_binary(const char *source, static __init void uefi_revocation_list_x509(const char *source, const void *data, size_t len) { + pr_info("Revoking X.509 certificate: %s\n", source); add_key_to_revocation_list(data, len); }