Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp46467rwb; Thu, 17 Nov 2022 20:13:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7tBwMbpR+F+9r2XluzsjKFsVLz9Fl2wBiPDDqJf8rxeY66LLZ8wOodqJbBSi3uGkBNFbTP X-Received: by 2002:a17:906:850d:b0:7ae:21bc:89f0 with SMTP id i13-20020a170906850d00b007ae21bc89f0mr4455754ejx.132.1668744794510; Thu, 17 Nov 2022 20:13:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668744794; cv=none; d=google.com; s=arc-20160816; b=XwEJs1m21wsBEqo7va3S+NgWUeNYcx3rQ1+Kp9K97sVEJOulyYa14ojGKACoXH0o+5 M8TLmAP3DfEkZAxhntmry3eCS7EHK/doPp+7ZbjnzXTRjAZ+zEYzKImh4sPTFuLKZktY cDMgWCUOC3p/Cu2fXYt7sEbrr7i6ZpS0zUrIJR75CGybg8/yq3HSiVZT88yj6fg4W/y6 iJJFMRxPMwGk9eco+I04RgKhq8HMvQMg1rRMANff3aqNrIIr0bJWr/0pHlKehweUGBbX wOOFE36T5UJLMmBWIx2uPFuIlwtPg0s4Xj3/zDUbVf9sFeL8Mo586kQhuGJazWVnjNXb PduA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :from; bh=6HI/uGGRJj9B1sWInzLCe7m/kL5/v/quC4iAG/wSBQs=; b=czu+KrSF8VsZo9pWiKM8p721/AD7NjeVMWyOR7/Gkk2wUh5bJQXgcpTqAl5dJLIRi2 dTSi/R/Sloga+R5PLLByjYxE1hg803WnVOdLGoh6G3ZTOwhTTcIxgXXfWMjdC7fhlgqX 7EafvLX9PMME8Y4+LnzH4c0s0J58Qo+aZ17ZY468h1aujoIHZoi/ZkL2znjsXRx2ZPEL fIPOj+ufmiL97WR88OJVsp0ppoLEKMYdRSX4zLh7n4C2tJw1hWN+GF+FVYjt0mFD41ML tJAKkxgIB1U0e9wp+YoFjRdrSbhpQspL7kvT2ttnXOM0YSUpCqQy5Vp3pbCEVT4qJxWq BONg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=LGhsJnfL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g40-20020a056402322800b004591f959c3bsi2112655eda.427.2022.11.17.20.12.46; Thu, 17 Nov 2022 20:13:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=LGhsJnfL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241021AbiKREFo (ORCPT + 91 others); Thu, 17 Nov 2022 23:05:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241081AbiKREEt (ORCPT ); Thu, 17 Nov 2022 23:04:49 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBAFD326F5 for ; Thu, 17 Nov 2022 20:04:37 -0800 (PST) From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1668744275; bh=P/SxYrzIDdEyGtP2C7/8aV4gnstE9Djts92CSEamDqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LGhsJnfLe8kJSopHA7/MaHb4q5Q8CqAWSKTSOkQQE9L/WlUY2AaPzncPaEJsdc/0G LFynYr1APxAyOrYQxvJKeqg2Y9dciSqUq15c0yGo/QEk28P2VXX/EJxngwSMBATS+0 +jmug/2mV1tZC4mAKwoRLS8YuZjCDrRRQm9VSezo= To: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , David Howells , David Woodhouse , Jarkko Sakkinen , Eric Snowberg Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Pearson , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [PATCH v3 1/3] certs: log hash value on blacklist error Date: Fri, 18 Nov 2022 05:03:41 +0100 Message-Id: <20221118040343.2958-2-linux@weissschuh.net> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118040343.2958-1-linux@weissschuh.net> References: <20221118040343.2958-1-linux@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=ed25519-sha256; t=1668744217; l=1006; i=linux@weissschuh.net; s=20211113; h=from:subject; bh=P/SxYrzIDdEyGtP2C7/8aV4gnstE9Djts92CSEamDqg=; b=wAaNSCu5g8hAafN2wCdcLQkehdyg+hECJ2kV43YgMZiDa+w0E7D8Jpy4P/iIuBZvrEBflMpL7Y9L ZSI0/RSAB4PmKBJpq/2dgHHR9Ia9MwKDzHfd9EUajCiWN6brQCAG X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=9LP6KM4vD/8CwHW7nouRBhWLyQLcK1MkP6aTZbzUlj4= Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Without this information these logs are not actionable. For example on duplicate blacklisted hashes reported by the system firmware users should be able to report the erroneous hashes to their system vendors. While we are at it use the dedicated format string for ERR_PTR. Fixes: 6364d106e041 ("certs: Allow root user to append signed hashes to the blacklist keyring") Signed-off-by: Thomas Weißschuh --- certs/blacklist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/certs/blacklist.c b/certs/blacklist.c index 41f10601cc72..6e260c4b6a19 100644 --- a/certs/blacklist.c +++ b/certs/blacklist.c @@ -192,7 +192,7 @@ static int mark_raw_hash_blacklisted(const char *hash) KEY_ALLOC_NOT_IN_QUOTA | KEY_ALLOC_BUILT_IN); if (IS_ERR(key)) { - pr_err("Problem blacklisting hash (%ld)\n", PTR_ERR(key)); + pr_err("Problem blacklisting hash %s: %pe\n", hash, key); return PTR_ERR(key); } return 0; -- 2.38.1