From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796311374; b=r1ZN7Thk2SmFUTx9b7rNa+E2CZAd7NGpQrHcn3Y3p5OyBjJqdBVVBVQ1Q2IuHU4nOctq J/SjgVHdQJZHSDXRSjmezoG5wu85ZZF9Kto6SXbEZyFO9YkWeIc8uC3iJQ/uJjRVeX3mi icuzQ3iubB/Z49MXxNMU+cQqe379wYU8taUaa0yc9nHQQ6AxvQWR/i+DPReEpKoEmBdfS yEp1O1j8rJyZUq2VLnsMt7qQiiyzyFaq4pvZHo7eKgZA3NKCACnMFr7Z0C2IJX6Y5zqY3 OSfchu5LKkvWx1r+l8FrMVakENUQbsUq2vmZuhZ/D89P+6iHZ4SNYhNtY59AbONABIQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796311374; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Mime-Version:Content-Type: Date:Message-Id:Cc:From:To:Subject:References:In-Reply-To: X-Scanned-By; bh=OsZdPKkkt2bvA7bJ9ZD57ewTFkDGkZmfoe6rajR4ewU=; b=hkFVbp8RLAXCq9oK8EB57RWR+kkiWj/UutZ5nk0NunfOojGsifzgJM9ONIWbCiswfz4w TLXi/4WF5ReyaIar+AN4Z9bkJKQawF/6ggphEWXTKwkKKprV9RDUZf6lDGL3jvBgwGSH7 ejz6wN+i0linZBTC2V+RvZBZ67mF/bXDVn5TrPJa1okw/279fQdhgUGIWxYfKQIzQGW2g 8WVMKLkAy/Zehq43Qeb40pFgzk3HkMCcbPDNDIQesFe2iWOSTS/yyrO3UeH2SzugvKGjK o+ZaKtnp8AwsUOuW67YyoMsqi3MJkF2JDzqkvlqTS/F/qNWxdhT6HFnqh1yYJYpzZeQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=LpMOW4hN; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D682B606A688 for ; Thu, 3 Dec 2026 15:22:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D682B606A688 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=LpMOW4hN DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796311373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OsZdPKkkt2bvA7bJ9ZD57ewTFkDGkZmfoe6rajR4ewU=; b=LpMOW4hNO1OZ75BOz6XtWorPVBksnj83hJIh/HbV2ft+xcM4PhRvOP7RhIKb7d/lneiZ1Q yd1SwIcFgprQbKomkIAPPmFUE+3WdV80I2r/Oz34ljqGDMHbNVrEockQXhy1Ejzh07avlC r+3KuepLVUM9lasHImyxk2hDuZh2V4k= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-678-w6ImN19SOcCQWjyFf0STzg-1; Thu, 3 Dec 2026 15:22:47 +0000 X-MC-Unique: w6ImN19SOcCQWjyFf0STzg-1 X-Mimecast-MFC-AGG-ID: w6ImN19SOcCQWjyFf0STzg_1796311365 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 145B118D97EA; Thu, 3 Dec 2026 15:22:45 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2E9103001DB4; Thu, 3 Dec 2026 15:22:41 +0000 (UTC) X-Mailing-List: linux-integrity@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Type: multipart/signed; boundary=29e98d009fafb0f0f94258b17d95b395573324856a3e7ed68be143b5ef7f; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Thu, 03 Dec 2026 12:22:40 -0300 Message-Id: Cc: "Jarkko Sakkinen" , "David Howells" , "Roberto Sassu" , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , , From: "Bruno Meneguele" To: "Mimi Zohar" , Subject: Re: [PATCH 1/3] certs: blacklist: define skid: entries and add is_key_blacklisted() References: <20261106173149.707244-1-zohar@linux.ibm.com> <20261106173149.707244-2-zohar@linux.ibm.com> <130326f3dc0cdccadb8577d411b0cd5645c70115.camel@linux.ibm.com> In-Reply-To: <130326f3dc0cdccadb8577d411b0cd5645c70115.camel@linux.ibm.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 --29e98d009fafb0f0f94258b17d95b395573324856a3e7ed68be143b5ef7f Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed On Wed Dec 2, 2026 at 7:18 PM -03, Mimi Zohar wrote: > On Fri, 2026-11-27 at 14:49 -0300, Bruno Meneguele wrote: >> On Fri Nov 6, 2026 at 2:31 PM -03, Mimi Zohar wrote: >> > A "tbs:" blacklist entry is only compared against certificates being >> > added to a keyring or presented in a signature chain, so it does not >> > stop a key that is already loaded from being used as a trust anchor. >> > >> > Define a new "skid:" blacklist entry, holding a Subject Key >> > Identifier, and add is_key_blacklisted(), which looks up the SKID of a= n >> > asymmetric key in the system blacklist. Entries are added like "tbs:" >> > and "bin:" entries and are subject to CONFIG_SYSTEM_BLACKLIST_AUTH_UPD= ATE. >> > >> > blacklist_vet_description() now uses a prefix table, since the prefixe= s >> > no longer all have the same length. "tbs:" and "bin:" entries behave >> > as before. >> > >> > For example, to add an entry for a certificate (the signed string must >> > not include a trailing newline): >> > >> > skid=3D$(openssl x509 -in cert.pem -noout -ext subjectKeyIdentifier = | >> > sed -n '2s/[ :]//gp' | tr A-F a-f) >> > printf 'skid:%s' "$skid" > skid.txt >> > openssl smime -sign -binary -noattr -in skid.txt -signer signer.crt = \ >> > -inkey signer.key -outform DER -out skid.p7s >> > keyctl padd blacklist "skid:$skid" %:.blacklist < skid.p7s >> > >> > The SKID is also the hex string in the description of the key on a >> > keyring, and its last four bytes are the key ID in the security.ima >> > xattr, so an entry is easy to correlate with the key it revokes: >> > >> > # keyctl show %:.ima | grep 073d >> > 927946571 --als--v 0 0 \_ asymmetric: test signing key: b7809c33= 72a07fe87248dcec7ff047a40fb3073d >> > # keyctl show %:.blacklist | grep skid >> > 1014808518 ----s--v 0 0 \_ blacklist: skid:b7809c3372a07fe87248dc= ec7ff047a40fb3073d >> > >> > Signed-off-by: Mimi Zohar >> > --- >> > Changelog v1: >> > - Addressed Sashiko issues: drop Kconfig change, linking issues when >> > blacklist support configured, but without CONFIG_ASYMMETRIC_KEY_TYPE >> > configured. >> > >> > certs/blacklist.c | 83 ++++++++++++++++++++++++----------= - >> > include/keys/system_keyring.h | 12 +++++ >> > 2 files changed, 70 insertions(+), 25 deletions(-) >> > >> > diff --git a/certs/blacklist.c b/certs/blacklist.c >> > index fa561c12eabf..9158bd9f9fc9 100644 >> > --- a/certs/blacklist.c >> > +++ b/certs/blacklist.c >> > @@ -32,6 +32,7 @@ >> > >> > static const char tbs_prefix[] =3D "tbs"; >> > static const char bin_prefix[] =3D "bin"; >> > +static const char skid_prefix[] =3D "skid"; >> > >> > static struct key *blacklist_keyring; >> > >> >> Hi Mimi, >> >> the script certs/check-blacklist-hashes.awk needs to be updated to allow= "skid:" >> hash type too, otherwise build fails with "unknown prefix": >> >> $ echo '"skid:3afbecd5ee1d3d787c61270797e5c85065d030cc"' > certs/blackli= st.txt >> $ scripts/config --set-str SYSTEM_BLACKLIST_HASH_LIST certs/blacklist.tx= t >> $ make certs/ >> DESCEND objtool >> GEN certs/blacklist_hash_list >> Unknown prefix (item 1): skid:3afbecd5ee1d3d787c61270797e5c85065d030cc >> make[3]: *** [certs/Makefile:21: certs/blacklist_hash_list] Error 1 >> make[2]: *** [scripts/Makefile.build:572: certs] Error 2 >> make[1]: *** [/home/brdeoliv/git/linux/Makefile:2244: .] Error 2 >> make: *** [Makefile:248: __sub-make] Error 2 >> >> It seems to be just a single line of code and the file documentation: >> >> - if (!match(part1[1], "^(tbs|bin):(.*)$", part2)) { >> + if (!match(part1[1], "^(tbs|bin|skid):(.*)$", part2)) { >> >> At the same time, I noticed you also dropped the Kconfig documentation c= hange >> for CONFIG_SYSTEM_BLACKLIST_HASH_LIST when you fixed Sashiko's report. > > Based on Sashiko's comment, either drop the documentation change making t= he code > self consistent or, as you suggested, update the script to fully support = "skid:" > rules like "tbs:" and "bin:". > > Either way is acceptable, at least to me. > Ok, I see your point: SKID it not really a hash to be added through BLACKLIST_HASH_LIST like full X.509 is also not supported here. So I'm fine ack'ing it as-is. However, to maintain the ability to add entries to blacklist at build time = like we have for binaries, TBS and X.509 (with CONFIG_SYSTEM_REVOCATION_KEYS) it would be good to have a config option for adding SKID in the same format we= have for hash, not requiring the actual certificate in, e.g., the revocation key= s PEM file. -- Bruno Meneguele PGP Key: http://bmeneg.com/pubkey.txt --29e98d009fafb0f0f94258b17d95b395573324856a3e7ed68be143b5ef7f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFGBAABCgAwFiEEdWo6nTbnZdbDmXutYdRkFR+RokMFAmsRiUASHGJtZW5lZ0By ZWRoYXQuY29tAAoJEGHUZBUfkaJD9ssIAMCb4nepLj5+2S+EPmS8YHqWkJuFzPeu Er7p2wzT9pCNmcPFcaO416JVHhsrCKwvPT5gStzah/tQptSZid1DXvi4JiRzrs9g LfP6hsr1N5PI/MszR1i3SVl9oEIJRVEEgPAW3Jm8tpbJrX+dwfmFVr+XejwGLPHD /DBM2iSUckdp7sPsfEimo3OS6BHH/zvCPr3T8M7tWYBUKic/7q85b/cX371TADUN ababxmC9/g1jqNGJp5IN5uwmWLTvRbC7K18k+H7Y8X05O6klbjzTgkvVJd6P8tWw NOj1kIu5EHpUxJLWBU3gDknAe1UCoj284t5x9Le2mxxZm3K8daCHZSc= =98tS -----END PGP SIGNATURE----- --29e98d009fafb0f0f94258b17d95b395573324856a3e7ed68be143b5ef7f--