From nobody Fri Apr 10 01:01:19 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 CF408327BEC; Thu, 5 Mar 2026 07:11:58 +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=1772694720; cv=none; b=r0l5HWCtMDPYMeYKRUrmt/ZTUrbwzYQaQLsqqYm7HrUlbb1RydHT5k5v/w/j/Vv5QCTbNo1yYtPELbmLLptOzZUYH8b+QL33HoAKgrgNKBf4VS42bdXXpPS5I4SfjaoIvenX0kzefxN6PsdtCD49oMk8gY620AtDHb3T/34GVyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772694720; c=relaxed/simple; bh=tKTmRc6HrP6/OQRgSe9OxodcJLXzMpfhw17bqU4f6CI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Abx7aYVxeTLHTZWd3p/QFwTAbDZlD9tHIb/+WAQ4U5x8tzgnpDfqWZBNXlJ4peVDDiGheAFnqmdbcH4Yh87XhZKQchsIbLZXzFKeZSdfjX0a2Cp2QxscfKBhLSADv4s4hI7F67Ev7wjTObBRziph0yDWRmBdVvYnY3gmdUmuliw= 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=V5ivcWTU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UxmerasS; 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="V5ivcWTU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UxmerasS" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772694717; 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=ZMGtWqBpnjIDTR6LwAmpIJP3Qy4dhjS1J0sd7mm9aeM=; b=V5ivcWTUxZdr2tgqC3CMI87kBCtdxsY8OKA0tDClfzs2Ft2/mvShq3r7Fma9F92SJyVyOm diP+7SO/GNs9PiytONJPowX2vVlNVgYzbzXRoWTeZnjGKT/aoIlesKjDebv9yJIY8r+ux+ 7ox0Xq0ivYWMu7nNaI52bEsWOHDTw3DmaCdsFE0WquvJVZJ7w7f12YYjX0ptBWHBvcPZdW VpNTH91ZHd1Ym2ouhXpL9Zh+M94JYGo/yo25nbLZVp8p36uXLmPQ7qX3Kzes/n/7bSFOS3 ZXGT2Nl1B+7ZB7JpAI+nee+BBZa9KtH1CuMD0FWJ8LGZFHduaLlGlkOGHT2TTw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772694717; 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=ZMGtWqBpnjIDTR6LwAmpIJP3Qy4dhjS1J0sd7mm9aeM=; b=UxmerasSiLW+g2DQe/h+4Mm83vdTkk1OJO82afLBAcpNFKtwGsYJPvAS+qKNUWIQ9UUyOO e8Iadm4tLjJDC0Dg== Date: Thu, 05 Mar 2026 08:11:56 +0100 Subject: [PATCH v2 6/8] tools uapi headers: add linux/module_signature.h 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-v2-6-dc4d81129dee@linutronix.de> References: <20260305-module-signature-uapi-v2-0-dc4d81129dee@linutronix.de> In-Reply-To: <20260305-module-signature-uapi-v2-0-dc4d81129dee@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=1772694712; l=1785; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=tKTmRc6HrP6/OQRgSe9OxodcJLXzMpfhw17bqU4f6CI=; b=+3vx3bSpCHoEVgsOHlcluBxd4hRQB0nBZk3B61kDfpgy+y3FGxTrsKS2h/B47UxL3vDTYRL8k RH6ppRFUMHVDVIURHuF+F2Ho8USBx8BQCEKJhmaQlYdKzysXCvrLMq7 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= This header is going to be used from scripts/sign-file. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Petr Pavlu --- tools/include/uapi/linux/module_signature.h | 41 +++++++++++++++++++++++++= ++++ 1 file changed, 41 insertions(+) diff --git a/tools/include/uapi/linux/module_signature.h b/tools/include/ua= pi/linux/module_signature.h new file mode 100644 index 000000000000..634c9f1c8fc2 --- /dev/null +++ b/tools/include/uapi/linux/module_signature.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ +/* + * Module signature handling. + * + * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + */ + +#ifndef _UAPI_LINUX_MODULE_SIGNATURE_H +#define _UAPI_LINUX_MODULE_SIGNATURE_H + +#include + +/* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */ +#define MODULE_SIGNATURE_MARKER "~Module signature appended~\n" + +enum module_signature_type { + MODULE_SIGNATURE_TYPE_PKCS7 =3D 2, /* Signature in PKCS#7 message */ +}; + +/* + * Module signature information block. + * + * The constituents of the signature section are, in order: + * + * - Signer's name + * - Key identifier + * - Signature data + * - Information block + */ +struct module_signature { + __u8 algo; /* Public-key crypto algorithm [0] */ + __u8 hash; /* Digest algorithm [0] */ + __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]; + __be32 sig_len; /* Length of signature data */ +}; + +#endif /* _UAPI_LINUX_MODULE_SIGNATURE_H */ --=20 2.53.0