From patchwork Fri Oct 1 15:44:28 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: 1535393 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=aKLE2KZg; 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 4HLZFS4ZXhz9sPf for ; Sat, 2 Oct 2021 01:45:32 +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 1mWKiy-0008Kh-Hq; Fri, 01 Oct 2021 15:45:24 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mWKig-00086j-FQ for kernel-team@lists.ubuntu.com; Fri, 01 Oct 2021 15:45:06 +0000 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (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-0.canonical.com (Postfix) with ESMTPS id 9158D405FA for ; Fri, 1 Oct 2021 15:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1633103105; bh=/Sf2gE95wFug7fip4TOxhHwe3luJcTCi8x6Aog8mhCk=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aKLE2KZgFNGj5KY5KkxTQVnpaH6LPZc9BpckfeoT9ijs8a8Jw5gJ5lyGrx/NHPwrx 5IwfvvbIeEQh6EEDP50mpt8Bbsr/ASuJHTdxYvpKUBtw4wmRSoWr+VsD5dLf2m/FDM pxl5qhDUo8B/7HiNug4Y+GrNOtZKuCZMqBEbmtw97D4twjOGr4nuM77TLv0rQYLorT ZYmp81QaPORcgJw0h7QI/ZPnmOFBQ7NIlyp8fj+BaD4wmWBYcIBsOsc/+uaLqMcV2A Y69wPwTNrRpuDQJWzjIRsIqIMEQ8NAOfcXBM0iim53yTqRYvtFXrWsLBl2s+eCbOfA SU0J01yqTY61Q== Received: by mail-wr1-f71.google.com with SMTP id v15-20020adfa1cf000000b00160940b17a2so1495240wrv.19 for ; Fri, 01 Oct 2021 08:45:05 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=/Sf2gE95wFug7fip4TOxhHwe3luJcTCi8x6Aog8mhCk=; b=W2I/V08R20ZgJpqBVoiGgJTNd+0OHigZLIFFCmdcIDBJAal+HBdAEZIxp++WHRdM4j chB+uDGU/QfjM0A0cnYa1XFLWEhVZmTIYGEPPHBHTPcqiLN2oWAK4YrpwLztNnw1otbP k1biTs6SRjeu6k1gPs3JN4mpfcgLeKGdOQvjVp6RgRDSwHfopFW94636rOb3TZ3lAEnA 4fQiLJjutJReLwbwQvqxj46x4TybocdRsc8VDVkOKRCX0r4kDhFabFo89tHcns3NTAe8 YwjGZVsbur8IV34UDJU+AyBeuuwYyPeonBw2CcXJfvMI3m6EtXmlNInLkBSPyieaCDc8 crbw== X-Gm-Message-State: AOAM530yZTo1zi95FEdO2WDb6+6BfftXkm+6AwshIPXiq2nq2Zm/epiu YT/7//z9Bsi0iYZ++FrewbXwwlJPRcrJfDD6wiSJsf7agKVl9YVzmn7DkhC88nGLebfeZGCVHbc sDpqSdb5caKRTRN6nF2hk72KqP9bw97l4e/3M140JeA== X-Received: by 2002:adf:a3d9:: with SMTP id m25mr2152508wrb.27.1633103104860; Fri, 01 Oct 2021 08:45:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoXLUuqqlKGbpwigIfubTZUEtb49bsv6LA7HCpjdWulUlm2nabfPnWe1Iq10PehsVPYHMHRQ== X-Received: by 2002:adf:a3d9:: with SMTP id m25mr2152474wrb.27.1633103104515; Fri, 01 Oct 2021 08:45:04 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:dd38:5596:506f:f213]) by smtp.gmail.com with ESMTPSA id z133sm9544109wmc.45.2021.10.01.08.45.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:45:04 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [SRU][FOCAL][PATCH 12/16] UBUNTU: SAUCE: integrity: add informational messages when revoking certs Date: Fri, 1 Oct 2021 16:44:28 +0100 Message-Id: <20211001154432.20287-13-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211001154432.20287-1-dimitri.ledkov@canonical.com> References: <20211001154432.20287-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 Acked-by: Krzysztof Kozlowski Signed-off-by: Seth Forshee (cherry picked from commit ba9fb788f89cb81c5ed836db2355a7a3b0f8c248) (xnox: cherry-pick is from impish:linux SAUCE) 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 c973de883c..7638dfaca7 100644 --- a/certs/blacklist.c +++ b/certs/blacklist.c @@ -171,6 +171,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 5604bd57c9..9f85626702 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); }