From nobody Fri Apr 10 01:01:18 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 143D93793DF; Thu, 5 Mar 2026 09:31:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772703104; cv=none; b=i+fFyiqaB0SFOs7jqAlbwGjolRuVTSQTstjSaIf+SCWSdMnr7BU/i1lzVVyKdUuVJpW3bQXR8pTBa2zfMv4Q25Ywek92JP3vOs9irIEUnVkUUlRdoX3EZXUImHpVdL590GDb/USQRaFf2I0W3Y6ssEeTPSr7h00PHu/+02gZsgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772703104; c=relaxed/simple; bh=0hFooFnHCbtyEcdlys+/j5z4JpvnkphkvXvFV2sQM+I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HQkVsYQU1jEIcqgSlzOI4osApzzGkI/G4yACrgdvSBwjBqCoCxsjL45OESec3KhwKKjv9opRB8ebEBxKnkxGT7d4UEHX9m033nu/NrC37tFLVbKZfw55H6vOw7BftWTmjqFDjOdx/T59+dJlojxSte9cVuK2+U8iNoup0aUD6fc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Rkwg3vMe; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=jUuDjNzL; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Rkwg3vMe"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jUuDjNzL" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772703100; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x6XHgze9+I6IR83T3SKiAcKjzRKh0KdaqB85aJ6dP2A=; b=Rkwg3vMe0MdC4gCfoVcSaZ5mWzBA6e5fHnxcekhw4iwMzUVWl32e1PC3XzgSUpaiHOvoWw 0TFmeUT+/RGqCkgI7WzgAAyGldAbqHL9XYTAijBPVJ8Fe4adQZhQsS+qke4plk6azPNwJj Il2WGcv01OImKm3SXeLVWNoMDkfZwiSmZdog+Du0HvOGVBWz1nXZtYJXl1PqwXg/Del1UD 2sGpYcIPawo327OK4rzdagdByOvfss4Me/3Yjr2kcltD3DLz3/b+Vr6FNfQ25gQC16W/87 XFdWFXQCURmcPRYpGc4QaxoqN6/2M9Wzeua1L1Dhqyowu24mC0RtusQd0m5nGw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772703100; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x6XHgze9+I6IR83T3SKiAcKjzRKh0KdaqB85aJ6dP2A=; b=jUuDjNzLt7wNfbxIsR62LomJW5Z2p3D2kmdhPpjaGB8leG+dwpENJ+OFaRAiSQ5S/kitRM eo1f5EsCa/2UFHCA== Date: Thu, 05 Mar 2026 10:31:39 +0100 Subject: [PATCH v3 3/8] module: Give 'enum pkey_id_type' a more specific name Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260305-module-signature-uapi-v3-3-92f45ea6028c@linutronix.de> References: <20260305-module-signature-uapi-v3-0-92f45ea6028c@linutronix.de> In-Reply-To: <20260305-module-signature-uapi-v3-0-92f45ea6028c@linutronix.de> To: David Howells , David Woodhouse , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Mimi Zohar , Roberto Sassu , Dmitry Kasatkin , Eric Snowberg , Paul Moore , James Morris , "Serge E. Hallyn" , Nathan Chancellor , Nicolas Schier , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan Cc: keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-s390@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1772703098; l=2573; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=0hFooFnHCbtyEcdlys+/j5z4JpvnkphkvXvFV2sQM+I=; b=I179R6lUtQ1nbxaFgmpBytrX1gCYbvpwbGNMLJwpi0SzxXE7PVvvoQ/NMY4YlPzjP2MXAwzul r65clbK6k+nDlFG3dc0xtQWLIuNCYXbeK4ieCKY6hA8uJG2PHaxt3Kp X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= This enum originates in generic cryptographic code and has a very generic name. Nowadays it is only used for module signatures. As this enum is going to be exposed in a UAPI header, give it a more specific name for clarity and consistency. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Petr Pavlu --- arch/s390/kernel/machine_kexec_file.c | 2 +- include/linux/module_signature.h | 6 +++--- kernel/module_signature.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machi= ne_kexec_file.c index 1bf59c3f0e2b..667ee9279e23 100644 --- a/arch/s390/kernel/machine_kexec_file.c +++ b/arch/s390/kernel/machine_kexec_file.c @@ -53,7 +53,7 @@ int s390_verify_sig(const char *kernel, unsigned long ker= nel_len) return -EKEYREJECTED; kernel_len -=3D sig_len; =20 - if (ms->id_type !=3D PKEY_ID_PKCS7) + if (ms->id_type !=3D MODULE_SIGNATURE_TYPE_PKCS7) return -EKEYREJECTED; =20 if (ms->algo !=3D 0 || diff --git a/include/linux/module_signature.h b/include/linux/module_signat= ure.h index 820cc1473383..c3a05d4cfe67 100644 --- a/include/linux/module_signature.h +++ b/include/linux/module_signature.h @@ -14,8 +14,8 @@ /* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */ #define MODULE_SIG_STRING "~Module signature appended~\n" =20 -enum pkey_id_type { - PKEY_ID_PKCS7 =3D 2, /* Signature in PKCS#7 message */ +enum module_signature_type { + MODULE_SIGNATURE_TYPE_PKCS7 =3D 2, /* Signature in PKCS#7 message */ }; =20 /* @@ -31,7 +31,7 @@ enum pkey_id_type { struct module_signature { u8 algo; /* Public-key crypto algorithm [0] */ u8 hash; /* Digest algorithm [0] */ - u8 id_type; /* Key identifier type [PKEY_ID_PKCS7] */ + u8 id_type; /* Key identifier type [enum module_signature_type] */ u8 signer_len; /* Length of signer's name [0] */ u8 key_id_len; /* Length of key identifier [0] */ u8 __pad[3]; diff --git a/kernel/module_signature.c b/kernel/module_signature.c index 00132d12487c..a0eee2fe4368 100644 --- a/kernel/module_signature.c +++ b/kernel/module_signature.c @@ -24,7 +24,7 @@ int mod_check_sig(const struct module_signature *ms, size= _t file_len, if (be32_to_cpu(ms->sig_len) >=3D file_len - sizeof(*ms)) return -EBADMSG; =20 - if (ms->id_type !=3D PKEY_ID_PKCS7) { + if (ms->id_type !=3D MODULE_SIGNATURE_TYPE_PKCS7) { pr_err("%s: not signed with expected PKCS#7 message\n", name); return -ENOPKG; --=20 2.53.0