From patchwork Mon May 17 13:18:48 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: 1479504 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 4FkKTq0Y7Bz9sWp; Mon, 17 May 2021 23:19:10 +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 1lid9G-0005I0-6w; Mon, 17 May 2021 13:19:06 +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 1lid9B-0005Gb-Ak for kernel-team@lists.ubuntu.com; Mon, 17 May 2021 13:19:01 +0000 Received: from mail-wm1-f70.google.com ([209.85.128.70]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lid9B-00012a-2k for kernel-team@lists.ubuntu.com; Mon, 17 May 2021 13:19:01 +0000 Received: by mail-wm1-f70.google.com with SMTP id g17-20020a05600c0011b029014399f816a3so1394869wmc.7 for ; Mon, 17 May 2021 06:19:01 -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=z4436JOYcJ1RLDd9kF/nyvHBhIkU3YCkxCBarZtZkec=; b=L62XvIHprlWv+/mKd9o12IDHZnipJC6zFzvKWlZQuFC3IAnwu7W6Rvbcx39+/Y/7ry Kc+5qkYXz9STEDqFqqV3P/deDo5wj+Uvwclth2Ij0OeDuwTiMraCYqxJx8+3pHmywYlj nI7UM94EiJbzweFyo62hf1xb2Yw2IceKYkv7WV7PZX2DVyibijCk7XFOAP4aehJWNTjl L8WmrrHihbF+32AlG5osMnHfMaxSIhFmh3nmQ4pz9CE/QYYDBI0f5LYNehHNKWX9uadf 79V9X+monoeNPmzv9MJ1W40TXCHMJHmvyqJY8OUvW3nIm7obaXJCMrcNzgWOwotDQyYF 6zAw== X-Gm-Message-State: AOAM530Lie/QtnjhVKYlx7FdDUvJsUg6Ea+O0POu4rjIKgCbZWcWfbiS O3ZssioTo0DN4IMBCog7vsSc0+ZBDMGRp3dwRQP3fsq1mN65ILEZoVlUp0ewavaAhnA4BlCXHwS hW3olowI3WTzRpUXT8PmpsmeTpF6trcytYx2M+gLQTA== X-Received: by 2002:a5d:5989:: with SMTP id n9mr73487903wri.60.1621257540551; Mon, 17 May 2021 06:19:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCKES7ttRiZJtoqSYFq0wVitXwfeK0RcYlZWIgQkj/gjAPkOKBUebl2ILx9wBSRsZruGKeJg== X-Received: by 2002:a5d:5989:: with SMTP id n9mr73487882wri.60.1621257540286; Mon, 17 May 2021 06:19:00 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:65e7:8a9b:295:b9e6]) by smtp.gmail.com with ESMTPSA id p2sm12105300wrj.10.2021.05.17.06.18.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 06:18:59 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [UNSTABLE][PATCH 2/2] UBUNTU: SAUCE: integrity: add informational messages when revoking certs Date: Mon, 17 May 2021 14:18:48 +0100 Message-Id: <20210517131848.61153-3-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210517131848.61153-1-dimitri.ledkov@canonical.com> References: <20210517131848.61153-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 | 4 +++- security/integrity/platform_certs/keyring_handler.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/certs/blacklist.c b/certs/blacklist.c index c9a435b15af4..6a2afa84a5db 100644 --- a/certs/blacklist.c +++ b/certs/blacklist.c @@ -172,7 +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); }