Skip to content

module: Move 'struct module_signature' to UAPI

Thomas Weißschuh bpf keyrings linux-integrity linux-kbuild linux-kselftest linux-modules linux-s390 linux-security-module lkml 3 versions – Applied

Status from this message: Applied to modules-next, thanks!

Get series with b4
b4 am [email protected] change-id 20260302-module-signature-uapi-61fa80b1e2bb

Versions newest first

  1. v3 Latest8 patches 4 repliesApplied
  2. v28 patches 0 repliesSuperseded
  3. v18 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Also adapt the include path for the custom sign-file rule in the bpf selftests.
(My manual run of BPF CI still fails, due to an BUG() on s390,
I don't see how this is due to this patch)
- Link to v2: https://lore.kernel.org/r/[email protected]

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/8extract-cert: drop unused definition of PKEY_ID_PKCS7certs/extract-cert.c+0 -20 replies
2/8module: Drop unused signature typesinclude/linux/module_signature.h+1 -30 replies
3/8module: Give 'enum pkey_id_type' a more specific namearch/s390/kernel/machine_kexec_file.c include/linux/module_signature.h kernel/module_signature.c+5 -52 replies
4/8module: Give MODULE_SIG_STRING a more descriptive namearch/s390/kernel/machine_kexec_file.c include/linux/module_signature.h kernel/module/signing.c +1 more+8 -80 replies
5/8module: Move 'struct module_signature' to UAPIinclude/linux/module_signature.h include/uapi/linux/module_signature.h+42 -270 replies
6/8tools uapi headers: add linux/module_signature.htools/include/uapi/linux/module_signature.h+41 -00 replies
7/8sign-file: use 'struct module_signature' from the UAPI headersscripts/Makefile scripts/sign-file.c tools/testing/selftests/bpf/Makefile+6 -150 replies
8/8selftests/bpf: verify_pkcs7_sig: Use 'struct module_signature' from the UAPI headerstools/testing/selftests/bpf/prog_tests/verify_pkcs7_sig.c+3 -250 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPetr PavluNicolas Schier
SeriesR-b
1/8R-b
2/8R-b
3/8R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/8] module: Move 'struct module_signature' to UAPI

This structure definition is used outside the kernel proper. For example in kmod and the kernel build environment.

To allow reuse, move it to a new UAPI header.

While it is not a true UAPI, it is a common practice to have non-UAPI interface definitions in the kernel's UAPI headers.

This came up as part of my CONFIG_MODULE_HASHES series [0]. But it is useful on its own and so we get it out of the way.

[0] https://lore.kernel.org/lkml/aZ3OfJJSJgfOb0rJ@levanger/

---
Changes in v3:
- Also adapt the include path for the custom sign-file rule in the bpf selftests.
(My manual run of BPF CI still fails, due to an BUG() on s390,
I don't see how this is due to this patch)
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Drop spurious definition of MODULE_SIGNATURE_TYPE_MERKLE.
- s/modules/module/ in two patch subjects.
- Pick up review tags.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Thomas Weißschuh (8):
extract-cert: drop unused definition of PKEY_ID_PKCS7
module: Drop unused signature types
module: Give 'enum pkey_id_type' a more specific name
module: Give MODULE_SIG_STRING a more descriptive name
module: Move 'struct module_signature' to UAPI
tools uapi headers: add linux/module_signature.h
sign-file: use 'struct module_signature' from the UAPI headers selftests/bpf: verify_pkcs7_sig: Use 'struct module_signature' from the UAPI headers

 arch/s390/kernel/machine_kexec_file.c              |  6 ++--
 certs/extract-cert.c                               |  2 --
 include/linux/module_signature.h                   | 30 +---------------
 include/uapi/linux/module_signature.h              | 41 ++++++++++++++++++++++
 kernel/module/signing.c                            |  4 +--
 kernel/module_signature.c                          |  2 +-
 scripts/Makefile                                   |  1 +
 scripts/sign-file.c                                | 19 +++-------
 security/integrity/ima/ima_modsig.c                |  6 ++--
 tools/include/uapi/linux/module_signature.h        | 41 ++++++++++++++++++++++
 tools/testing/selftests/bpf/Makefile               |  1 +
 .../selftests/bpf/prog_tests/verify_pkcs7_sig.c    | 28 ++-------------
 12 files changed, 101 insertions(+), 80 deletions(-)

---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260302-module-signature-uapi-61fa80b1e2bb

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>