Skip to content

Add platform-overridable device secret SAL API - #334

Closed
JaxCalder wants to merge 1 commit into
developfrom
feature/device-secret-sal
Closed

JaxCalder wants to merge 1 commit into
developfrom
feature/device-secret-sal

Conversation

@JaxCalder

Copy link
Copy Markdown
Contributor

Adds Dmod_TakeDeviceSecret(Buffer, Size), a platform-overridable SAL function (like Dmod_Reboot, #333): the platform that boots the system hands out a secret unique to the device (or to the firmware build), to be taken once.

  • Root of whatever is kept encrypted at rest (a vault of secrets, dmsecrets): the module that owns the policy - in DMOD's own system the device file system, which serves it under a node with permissions - takes it at start; other modules ask that module, they do not get it raw.
  • The weak default returns -ENOSYS (the host, tests). A platform overrides it: the length on success, -ENOSPC when the buffer is too small (the secret is then not consumed), -EACCES once it was taken, -EINVAL for a NULL buffer.
  • Why a SAL function and not a mount parameter / environment / an address: the firmware knows the secret, drivers must stay generic, and an address or an environment variable would tell every module where to read it.

The weak default is tested (tests_dmod_device_secret, passes). The first user is dmod-boot (it supplies the secret at build time) and dmdevfs.

🤖 Generated with Claude Code

Dmod_TakeDeviceSecret(): the platform hands out a secret unique to the device
(or the firmware build) - to be taken once, by the module that owns the policy
(dmdevfs), which serves it under a node with permissions. The weak default
returns -ENOSYS, as Dmod_Reboot.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@JaxCalder

Copy link
Copy Markdown
Contributor Author

Closing: a module that imports a SAL function the loader does not have crashes at load time on an older loader (found while testing dmdevfs against the released loader), so adding a SAL function for this makes every consumer's CI depend on a new runtime image. The secret will be handed over with an ioctl on the dmdevfs mount instead (a new DMDRVI_IOCTL_DEVFS_* command), which needs no change in the loader.

@JaxCalder JaxCalder closed this Oct 18, 2026
@JohnAmadis
JohnAmadis deleted the feature/device-secret-sal branch October 18, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants