Add nat20sw kernel module to linux examples.#102
Draft
werwurm wants to merge 2 commits into
Draft
Conversation
The nat20sw module is an implementation of a nat20device character device class. It uses the functionality implemented in nat20lib and nat20crypto to implement a fully fledged DICE service with embedded CA (ECA). The root secret is hard coded and thus not useful for production applications. But it serves as inspirational reference implementation and as a suitable environment to develop user space tools against.
LCOV of commit
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new Linux example kernel module (nat20sw) that implements a software-backed nat20device character-device service using nat20lib + nat20crypto, and wires it into the Buildroot external tree and CI so it gets built in the QEMU example configuration.
Changes:
- Add
nat20swkernel module (module source + Kbuild/Makefile) implementing Gnostic service dispatch and a DICE chain reader. - Extend the
nat20libkernel module exports to supportnat20sw’s CBOR/stream usage. - Integrate
nat20swinto Buildroot configs/scripts and GitHub Actions kernel-module build workflow.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/linux/nat20sw/nat20sw.c | New software NAT20 service module: init/exit, message dispatch, cached DICE chain rendering. |
| examples/linux/nat20sw/Makefile | Out-of-tree kernel build wrapper for nat20sw. |
| examples/linux/nat20sw/Kbuild | Kernel build rules, include paths, and symbol dependencies for nat20sw. |
| examples/linux/nat20lib/mod.c | Export additional nat20lib symbols required by nat20sw. |
| examples/linux/br_external/utils/envsetup.sh | Add Buildroot rebuild support and override env var for nat20sw. |
| examples/linux/br_external/package/nat20sw/nat20sw.mk | New Buildroot package definition for the nat20sw kernel module. |
| examples/linux/br_external/package/nat20sw/Config.in | New Buildroot Kconfig entry for enabling nat20sw. |
| examples/linux/br_external/configs/qemu_br_defconfig | Enable BR2_PACKAGE_NAT20SW in the QEMU Buildroot defconfig. |
| examples/linux/br_external/Config.in | Source the new nat20sw package Config.in. |
| .github/workflows/linux-kmod-build.yml | Build and verify nat20sw.ko in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+315
to
+320
| kfree(response->data); | ||
| response->size = 0; | ||
| response->data = kzalloc(actual_response_size, GFP_KERNEL); | ||
| if (response->data == NULL) { | ||
| return -ENOMEM; | ||
| } |
Comment on lines
+36
to
+37
| KDIR ?= /lib/modules/`uname -r`/build | ||
| INSTALL_MOD_PATH ?= /lib/modules/`uname -r`/extra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The nat20sw module is an implementation of a nat20device character
device class. It uses the functionality implemented in nat20lib and
nat20crypto to implement a fully fledged DICE service with embedded CA
(ECA).
The root secret is hard coded and thus not useful for production
applications. But it serves as inspirational reference implementation
and as a suitable environment to develop user space tools against.