nspawn: accept OCI runtime-spec 1.x bundles by russell-parks · Pull Request #42665 · systemd/systemd · GitHub
Skip to content

nspawn: accept OCI runtime-spec 1.x bundles#42665

Draft
russell-parks wants to merge 15 commits into
systemd:mainfrom
rezzell:feat/oci-runtime-spec-1x
Draft

nspawn: accept OCI runtime-spec 1.x bundles#42665
russell-parks wants to merge 15 commits into
systemd:mainfrom
rezzell:feat/oci-runtime-spec-1x

Conversation

@russell-parks

Copy link
Copy Markdown

Accept any OCI runtime-spec 1.x bundle that systemd-nspawn can safely interpret.

This relaxes the current 1.0.0-only acceptance to the whole runtime-spec 1.x line, while still rejecting malformed version strings. The implementation keeps the policy narrow: accept newer 1.x bundles that are structurally compatible with what nspawn already interprets, without claiming support for unrelated OCI specs.

Changes in this PR:

  • accept OCI runtime-spec 1.x bundles instead of requiring exactly 1.0.0
  • parse OCI version components more strictly and reject malformed strings
  • extend the OCI tests to cover accepted and rejected runtime-spec versions
  • document the intended scope: runtime-spec bundle compatibility only, not OCI image-spec support

Fork-side CI compatibility fixes observed while validating this branch on rezzell/systemd:

  • #42650 libc: provide openat2 syscall number fallback
  • #42657 libc: provide mount_setattr syscall number fallback
  • #42658 libc: add close_range fallbacks for older libc
  • #42659 sd-event: tolerate older glibc without mallinfo2
  • #42660 basic: resolve strerrorname_np at runtime
  • #42661 basic: guard newer SEGV si_code constants

Those failures were exposed by fork-side ClusterFuzzLite PR fuzzing while testing this branch and are not currently reproduced in upstream CI.

@github-actions github-actions Bot added nspawn util-lib tests sd-event please-review PR is ready for (re-)review by a maintainer labels Jun 19, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this really shouldn't be commited

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove

Comment thread src/basic/signal-util.c
#endif
#ifdef SEGV_MTESERR
[SEGV_MTESERR] = "SEGV_MTESERR",
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, we usually prefer if we just update the uapi headers that define them in our tree.

Comment thread src/nspawn/nspawn-oci.c
s = sd_json_variant_string(v);
if (isempty(s))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"OCI bundle version is missing or empty.");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if check should really move to oci_version_parse() i am sure, it's part of parsing

Comment thread src/nspawn/nspawn-oci.c

r = extract_first_word(&p, &patch, ".", EXTRACT_DONT_COALESCE_SEPARATORS);
if (r <= 0 || p)
return -EINVAL;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are oci versions guaranteed to have all three versions? shouldn#t we be graceful here, and be ok minor or micro are missing, and only insist on major?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything I looked through showed all three but I agree with you it should handle that. Deciding if it's equivalent to a patch of 0 or if 1.3 is technically < 1.3.0. I don't think it would matter either direction.

@poettering poettering added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks and removed please-review PR is ready for (re-)review by a maintainer labels Jun 22, 2026
@poettering

Copy link
Copy Markdown
Member

so the compat support i am not convinced by, but @daandemeyer can comment on that.

can you separate out the compat support from the other stuff that makes newer oci stuff work?

@russell-parks

russell-parks commented Jun 22, 2026

Copy link
Copy Markdown
Author

@russell-parks russell-parks marked this pull request as draft June 22, 2026 22:13
@russell-parks russell-parks force-pushed the feat/oci-runtime-spec-1x branch from 373217f to e0c050b Compare June 24, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nspawn reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks sd-event tests util-lib

Development

Successfully merging this pull request may close these issues.

2 participants