From nobody Fri Apr 10 01:01:17 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 DFFC737AA78; Thu, 5 Mar 2026 09:31:43 +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=1772703106; cv=none; b=nFDAK4ftoCBgcFgu0uwphRsf5zVA0n103xUr04JyxuoTAmrVqpIJKtqhmE2nQLnuMqI7BLpZoxtGDtVQ5Zxx4wn2WQAZ3pBX2NL7aPD/7LAaxAEz22sqGhtlLQBdm+TwyFNj6MKOFwb+Bxo6/5417WZma7F0WvM2Khokm+gAi5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772703106; c=relaxed/simple; bh=tKTmRc6HrP6/OQRgSe9OxodcJLXzMpfhw17bqU4f6CI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=peNvCyPa2cSoJUD28KtjZnY/bMVysparMoFNjWSaYUhxniP1XhT2OO5vA7exBurRP26dL7bE6O49Lo7pdTuCsuftq1J0FjZfGaIPJe1Lefsx+Va4DyC/84AhPH+3o/QA4pXGl9D2J9N2PAQc9dhVDe904XOa3XlVe0DhbpYL0uc= 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=2q0tqhpH; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=u2BNmBaj; 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="2q0tqhpH"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="u2BNmBaj" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772703102; 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=2q0tqhpHSQ7pyhJqjKNNDuHQhCEEhWAhou5DUBBj+SxPyKXHKCZVJyyY+AEs9gEHFixKUv 64JQkBnlsbKEqpSEOvVrmHiMW1F9CZHB7wLoGXBvmYGk3TH6YlFxZZfQs5+iVnwGpPNzwl QwZCnMvB4NCqEfMzkYo1Zd30wVfcsBRbOZx+OW0wt53KKZCHoEk2o+96QoGHCBqQJAzDH4 EMA24kZJBQVKF49oTNEJcQPxGau37YJ2I3Acn2lE8yS51ko33SFJVAqjt1ErauDxLOPzUs ESPSWahMb5V58sfHU2tTzCJ8fAsUdf/we1e2gno3bQTDWaJAjuDVjo72Z2cmIw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772703102; 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=u2BNmBajX+Bc2va3ByC4+zg2NFcD2PhiKSxYLWK768rveJGiJpCuI3NnFrgHMoaBzufHbO IyUQz+I7Ub+HzKCA== Date: Thu, 05 Mar 2026 10:31:42 +0100 Subject: [PATCH v3 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-v3-6-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=1785; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=tKTmRc6HrP6/OQRgSe9OxodcJLXzMpfhw17bqU4f6CI=; b=6okz7H5JeywVCnE7bUZrCe9AgS1uJ6mwkeuil3PLFb3vxveVwTbPuI95Dm5erhFwiWK6RKhUc GaJuJnTTdvsDCLpSsFbjySD4CYwEz7DnHRN/ooZ1gxPAeIz5Ak7qNdd 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