Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2719075pxp; Tue, 22 Mar 2022 04:53:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylYiQq+GCQXXLKQ+DpVobneo7EFi5u2TumRmpX/9hrhiAN6V9tHv/jZWhhpdHK35hBm/pG X-Received: by 2002:a63:f14b:0:b0:374:7b9e:dc8f with SMTP id o11-20020a63f14b000000b003747b9edc8fmr21329809pgk.357.1647950015881; Tue, 22 Mar 2022 04:53:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647950015; cv=none; d=google.com; s=arc-20160816; b=S/e6TYAatAT4NkLG6k/LFKdj3fqLNrfyTqpJQ/aG1nfvSU1mry6ugF136UQPWKXiWi ODL2qZLsT8riIw/+V1NlkLVMebtyVEGlwfNraOz4itv5PY4OUrejkc4ZfeYdeEdKt80h QhMdPq0NCyAf1lVirNrVwCHogUaJTzp8wx/N5YMK8wuLTK6QwluD1ghrkiMlxbg2FZVL mrUmYTmAGL6GVG8het3hTujTaqRt9Y7uL6NtaVGfHtaqLaiCWXlmJXsiGRNQF0lS/TsP 6tZm7OBfcx7S2uyRLpEQ29+DftxpQrJ/Ktdj2NO6dwfTvm68MDG8DodqmRhet1XLp4XE yHyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=RUAevhIF1IzV2dhc6sC2F8pPbPm6lHXi1GyftghWH4Y=; b=KJYem2RIahJqIwHfVTn+2NLNyuvwPnocqS0Iggpnirkpz5kd9NgUTX0mWxNHL6CebP xW3X85DcGxrSGzxqD5F3ldvtj5nBdMLH30/3wP0I4c6H5VHg0QCaP9xFY39zYx7cv8P4 2M9M4llgnb+GMH5OCJqSrvV8WaX5Sa5OGFlo6ZbEJbS1Ahbugfy2AgLXXmIwo6/BlLe2 rRCS3pv7EAfXP61YCj/1073woj9uuoWDm8IWlP5F1LWU1Y2msbChSYkB+r5pv9o2N27Z hLkIceqZZLkaDJTBY0Sra1ERGMp02n+X7HQsyP7/BnbOz5cKPObfVVqL6yZrdSyBfZWf CZug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 b12-20020a65578c000000b003816043f134si15737536pgr.809.2022.03.22.04.53.13; Tue, 22 Mar 2022 04:53:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233666AbiCVKxe (ORCPT + 99 others); Tue, 22 Mar 2022 06:53:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233631AbiCVKxc (ORCPT ); Tue, 22 Mar 2022 06:53:32 -0400 Received: from smtp-8fac.mail.infomaniak.ch (smtp-8fac.mail.infomaniak.ch [IPv6:2001:1600:4:17::8fac]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEBA58166A for ; Tue, 22 Mar 2022 03:52:05 -0700 (PDT) Received: from smtp-2-0000.mail.infomaniak.ch (unknown [10.5.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4KN7bP2J8JzMpxpl; Tue, 22 Mar 2022 11:52:01 +0100 (CET) Received: from ns3096276.ip-94-23-54.eu (unknown [23.97.221.149]) by smtp-2-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4KN7bN0m1lzljnTl; Tue, 22 Mar 2022 11:52:00 +0100 (CET) Message-ID: <6c14d652-edb2-da32-4025-de1a234c828f@digikod.net> Date: Tue, 22 Mar 2022 11:53:07 +0100 MIME-Version: 1.0 User-Agent: Subject: Re: [PATCH v1 1/1] certs: Explain the rational to call panic() Content-Language: en-US To: Paul Moore Cc: Jarkko Sakkinen , David Howells , "David S . Miller" , David Woodhouse , Eric Snowberg , keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= References: <20220321174548.510516-1-mic@digikod.net> <20220321174548.510516-2-mic@digikod.net> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-crypto@vger.kernel.org On 21/03/2022 19:23, Paul Moore wrote: > On Mon, Mar 21, 2022 at 1:45 PM Mickaël Salaün wrote: >> >> From: Mickaël Salaün >> >> The blacklist_init() function calls panic() for memory allocation >> errors. This change documents the reason why we don't return -ENODEV. >> >> Suggested-by: Paul Moore [1] >> Requested-by: Jarkko Sakkinen [1] >> Link: https://lore.kernel.org/r/YjeW2r6Wv55Du0bJ@iki.fi [1] >> Signed-off-by: Mickaël Salaün >> Link: https://lore.kernel.org/r/20220321174548.510516-2-mic@digikod.net >> --- >> certs/blacklist.c | 8 ++++++++ >> 1 file changed, 8 insertions(+) > > I would suggest changing the second sentence as shown below, but > otherwise it looks good to me. > > Reviewed-by: Paul Moore > >> diff --git a/certs/blacklist.c b/certs/blacklist.c >> index 486ce0dd8e9c..ac26bcf9b9a5 100644 >> --- a/certs/blacklist.c >> +++ b/certs/blacklist.c >> @@ -307,6 +307,14 @@ static int restrict_link_for_blacklist(struct key *dest_keyring, >> >> /* >> * Initialise the blacklist >> + * >> + * The blacklist_init() function is registered as an initcall via >> + * device_initcall(). As a result the functionality doesn't load and the > > "As a result if the blacklist_init() function fails for any reason the > kernel continues to execute." Thanks, I'll fix that. > >> + * kernel continues on executing. While cleanly returning -ENODEV could be >> + * acceptable for some non-critical kernel parts, if the blacklist keyring >> + * fails to load it defeats the certificate/key based deny list for signed >> + * modules. If a critical piece of security functionality that users expect to >> + * be present fails to initialize, panic()ing is likely the right thing to do. >> */ >> static int __init blacklist_init(void) >> { > > -- > paul-moore.com