All of lore.kernel.org
 help / color / mirror / Atom feed
From: ", Jarkko Sakkinen" <jarkko@kernel.org>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: "David Howells" <dhowells@redhat.com>,
	"David Woodhouse" <dwmw2@infradead.org>,
	"Paul Moore" <paul@paul-moore.com>,
	"James Morris" <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	"Mickaël Salaün" <mic@digikod.net>,
	keyrings@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	"Paul Menzel" <pmenzel@molgen.mpg.de>,
	"Mark Pearson" <markpearson@lenovo.com>
Subject: Re: [PATCH v4 3/3] certs: don't try to update blacklist keys
Date: Wed, 4 Jan 2023 12:35:06 +0000	[thread overview]
Message-ID: <Y7Vyet6+pytBDOeR@kernel.org> (raw)
In-Reply-To: <20221212-keys-blacklist-v4-3-00afeb3137fb@weissschuh.net>

On Wed, Dec 21, 2022 at 02:08:24AM +0000, Thomas Weißschuh wrote:
> When the same key is blacklisted repeatedly logging at pr_err() level is
> excessive as no functionality is impaired.
> When these duplicates are provided by buggy firmware there is nothing
> the user can do to fix the situation.
> Instead of spamming the bootlog with errors we use a warning that can
> still be seen by OEMs when testing their firmware.
> 
> Link: https://lore.kernel.org/all/c8c65713-5cda-43ad-8018-20f2e32e4432@t-8ch.de/
> Link: https://lore.kernel.org/all/20221104014704.3469-1-linux@weissschuh.net/
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> Tested-by: Paul Menzel <pmenzel@molgen.mpg.de>
> ---
>  certs/blacklist.c | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/certs/blacklist.c b/certs/blacklist.c
> index 6e260c4b6a19..675dd7a8f07a 100644
> --- a/certs/blacklist.c
> +++ b/certs/blacklist.c
> @@ -183,16 +183,19 @@ static int mark_raw_hash_blacklisted(const char *hash)
>  {
>  	key_ref_t key;
>  
> -	key = key_create_or_update(make_key_ref(blacklist_keyring, true),
> -				   "blacklist",
> -				   hash,
> -				   NULL,
> -				   0,
> -				   BLACKLIST_KEY_PERM,
> -				   KEY_ALLOC_NOT_IN_QUOTA |
> -				   KEY_ALLOC_BUILT_IN);
> +	key = key_create(make_key_ref(blacklist_keyring, true),
> +			 "blacklist",
> +			 hash,
> +			 NULL,
> +			 0,
> +			 BLACKLIST_KEY_PERM,
> +			 KEY_ALLOC_NOT_IN_QUOTA |
> +			 KEY_ALLOC_BUILT_IN);
>  	if (IS_ERR(key)) {
> -		pr_err("Problem blacklisting hash %s: %pe\n", hash, key);
> +		if (PTR_ERR(key) == -EEXIST)
> +			pr_warn("Duplicate blacklisted hash %s\n", hash);
> +		else
> +			pr_err("Problem blacklisting hash %s: %pe\n", hash, key);
>  		return PTR_ERR(key);
>  	}
>  	return 0;
> 
> -- 
> 2.39.0

Reviewed-by: Jarkko Sakkinen <jarko@kernel.org>

BR, Jarkko

      parent reply	other threads:[~2023-01-04 12:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221212-keys-blacklist-v4-0-00afeb3137fb@weissschuh.net>
     [not found] ` <20221212-keys-blacklist-v4-1-00afeb3137fb@weissschuh.net>
2023-01-04 12:31   ` [PATCH v4 1/3] certs: make blacklisted hash available in klog , Jarkko Sakkinen
     [not found] ` <20221212-keys-blacklist-v4-2-00afeb3137fb@weissschuh.net>
2023-01-04 12:34   ` [PATCH v4 2/3] KEYS: Add new function key_create() , Jarkko Sakkinen
     [not found] ` <20221212-keys-blacklist-v4-3-00afeb3137fb@weissschuh.net>
2023-01-04 12:35   ` , Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y7Vyet6+pytBDOeR@kernel.org \
    --to=jarkko@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=jmorris@namei.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=markpearson@lenovo.com \
    --cc=mic@digikod.net \
    --cc=paul@paul-moore.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.