From patchwork Mon May 10 14:40: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: 1476490 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 4Ff3dY2dCrz9sX1; Tue, 11 May 2021 00:41:05 +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 1lg75g-0004B7-U1; Mon, 10 May 2021 14:41:00 +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 1lg75e-0004Ab-E2 for kernel-team@lists.ubuntu.com; Mon, 10 May 2021 14:40:58 +0000 Received: from mail-wm1-f72.google.com ([209.85.128.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lg75e-0006Q1-6o for kernel-team@lists.ubuntu.com; Mon, 10 May 2021 14:40:58 +0000 Received: by mail-wm1-f72.google.com with SMTP id n9-20020a1c40090000b02901401bf40f9dso7075104wma.0 for ; Mon, 10 May 2021 07:40:58 -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:mime-version :content-transfer-encoding; bh=n392LxZmMOPeP5aHp0OCuxR/sdVuqlpHYwZJp9s/7ys=; b=IcfCL/O9f6CWxKcY21z8O1k1W6sBzByeNOc+j9H8S2YimCg1OprgiBAXpfC+rUzvXu HSOq4AE4+1oYfD88tfMgcpkubjh4b7TxFBMr9qp7VsK5qk5Evw1GStaaNdNcKR5eNP2t pa1QhrAZh9Gj24oq90xBTTGCaVYv2vwsaDCF50Tku7HZ+df98FIeuYMJKKVC136uJvRF 1eMb4uu5ODQff/WVBhm7lNVTkJ0fmU4saihegE54xf5Ana4Lb+mTOL1HJSidZxOW7Mfx yBLt8Ya5slYCJs3ehuwbbDFhzj0a1IoEu8xXaXswOx+7t7RONBAMYAjenRhmow3CTPXL bq+w== X-Gm-Message-State: AOAM531s5fHOg4Noa0xGbdacJzEWsuhNDwozgOaKZTqI5LDrHJ4GqLjB WT0VMSEmob0olh2mk5gW4OhVwbSYQ5iNJjYsV8tR17RuMDIFgeGg1ShrEakmZj0QgZF1l6SwRIH Tvy3mv1FuoSlyNYFJqKlLrGkFFNrDKCSj8y5f2HI/AQ== X-Received: by 2002:a1c:6a0c:: with SMTP id f12mr38086424wmc.122.1620657657461; Mon, 10 May 2021 07:40:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI94PU+mLyT1aeLTHhmN8DKXbeensrybk41bvAJGgkzK0gkl+IyF6Y+1m4atb3u17Ui7Zm6g== X-Received: by 2002:a1c:6a0c:: with SMTP id f12mr38086403wmc.122.1620657657230; Mon, 10 May 2021 07:40:57 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:5dd:29d:3e2a:7420]) by smtp.gmail.com with ESMTPSA id x65sm30596871wmg.36.2021.05.10.07.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 07:40:56 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [UPSTREAM][RFC PATCH] integrity: add informational messages when revoking certs. Date: Mon, 10 May 2021 15:40:54 +0100 Message-Id: <20210510144054.48288-1-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.27.0 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: , Cc: security@ubuntu.com 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: [ 1.538741] integrity: Platform Keyring initialized [ 1.960071] integrity: Loading X.509 certificate: UEFI:db [ 1.961986] integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4' [ 1.974041] integrity: Revoking X.509 certificate: UEFI:MokListXRT (MOKvar table) [ 1.978852] blacklist: Revoked X.509 cert 'Canonical Ltd. Secure Boot Signing: 61482aa2830d0ab2ad5af10b7250da9033ddcef0' [ 1.985850] integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table) [ 1.989651] integrity: Loaded X.509 cert 'Canonical Ltd. Master Certificate Authority: ad91990bc22ab1f517048c23b6655a268e345a63' Signed-off-by: Dimitri John Ledkov --- Another RFC patch that I'd like to submit upstream, based on v5.13-rc1. certs/blacklist.c | 4 ++++ security/integrity/platform_certs/keyring_handler.c | 1 + 2 files changed, 5 insertions(+) diff --git a/certs/blacklist.c b/certs/blacklist.c index c9a435b15af40..738c496756516 100644 --- a/certs/blacklist.c +++ b/certs/blacklist.c @@ -172,6 +172,10 @@ 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); + key_ref_put(key); } return 0; diff --git a/security/integrity/platform_certs/keyring_handler.c b/security/integrity/platform_certs/keyring_handler.c index 5604bd57c9907..9f85626702b2c 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); }