Thanks to visit codestin.com
Credit goes to github.com

Skip to content

vmm: migration: add seccomp rules for migration threads - #8453

Merged
likebreath merged 3 commits into
cloud-hypervisor:mainfrom
phip1611:upstream-migration-seccomp
Jun 29, 2026
Merged

likebreath merged 3 commits into
cloud-hypervisor:mainfrom
phip1611:upstream-migration-seccomp

Conversation

@phip1611

@phip1611 phip1611 commented Jun 23, 2026

Copy link
Copy Markdown
Member

Add missing seccomp rules for migration threads.

As always with seccomp: I am unsure if 100% of possible syscalls (from all possible code paths) are covered. We'll see.

Split-out from #8021

@phip1611
phip1611 requested a review from a team as a code owner June 23, 2026 08:45
@phip1611 phip1611 self-assigned this Jun 23, 2026
@phip1611
phip1611 force-pushed the upstream-migration-seccomp branch from d2ea93f to e43a9b0 Compare June 23, 2026 08:47
@phip1611
phip1611 requested review from likebreath and sboeuf June 23, 2026 13:41

@sboeuf sboeuf left a comment

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.

LGTM

@likebreath likebreath left a comment

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 fills an important gap we have. Thank you.

I'm curious how you arrived at this list of syscalls, was it by running the integration tests with --seccomp log? If so, did you also manually exercise the TLS path (both with and without multiple connections), as that's not covered by the integration tests ?

@phip1611

Copy link
Copy Markdown
Member Author

I'm curious how you arrived at this list of syscalls, was it by running the integration tests with --seccomp log?

Yes

If so, did you also manually exercise the TLS path (both with and without multiple connections), as that's not covered by the integration tests ?

Not yet. Will do tomorrow. Thanks!

@phip1611

phip1611 commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

I just tested this with TLS! It works. @sboeuf @likebreath

By the way: I think we can easily extend the integration test suite to use TLS - either via generating certs on the fly or by using pre-generated long-living certs (will do this in a follow-up potentially).

In the meantime, if you want to generate the certs for development purposes:

# CA key + self-signed CA cert
certtool --generate-privkey --outfile ca-key.pem

cat > ca.tmpl <<'EOF'
cn = "Test CA"
ca
cert_signing_key
expiration_days = 3650
EOF

certtool --generate-self-signed \
  --load-privkey ca-key.pem \
  --template ca.tmpl \
  --outfile ca-cert.pem


# Server key + certificate signed by CA
certtool --generate-privkey --outfile server-key.pem

cat > server.tmpl <<'EOF'
cn = "localhost"
dns_name = "localhost"
ip_address = "127.0.0.1"
tls_www_server
encryption_key
signing_key
expiration_days = 3650
EOF

certtool --generate-certificate \
  --load-privkey server-key.pem \
  --load-ca-certificate ca-cert.pem \
  --load-ca-privkey ca-key.pem \
  --template server.tmpl \
  --outfile server-cert.pem


# Client key + certificate signed by CA
certtool --generate-privkey --outfile client-key.pem

cat > client.tmpl <<'EOF'
cn = "test-client"
tls_www_client
encryption_key
signing_key
expiration_days = 3650
EOF

certtool --generate-certificate \
  --load-privkey client-key.pem \
  --load-ca-certificate ca-cert.pem \
  --load-ca-privkey ca-key.pem \
  --template client.tmpl \
  --outfile client-cert.pem

and then set tls_dir=/tmp/your-tls-files for receive/send migration

@phip1611
phip1611 force-pushed the upstream-migration-seccomp branch from e43a9b0 to 9b9dd47 Compare June 24, 2026 09:00
@likebreath

Copy link
Copy Markdown
Member

@phip1611 Great. Thank you. You will need a rebase.

@phip1611
phip1611 force-pushed the upstream-migration-seccomp branch from 9b9dd47 to 14b66df Compare June 24, 2026 19:26
@phip1611

Copy link
Copy Markdown
Member Author

Since your review, some things changed because of the work @sboeuf did in d26ed86 (#8264). I think the new version is clean but I'm looking forward to your feedback!

@phip1611
phip1611 force-pushed the upstream-migration-seccomp branch 5 times, most recently from 72344a5 to 983a4d1 Compare June 24, 2026 19:57
Comment thread vmm/src/migration/transport.rs Outdated
@phip1611
phip1611 marked this pull request as draft June 25, 2026 06:25
@phip1611
phip1611 force-pushed the upstream-migration-seccomp branch from 983a4d1 to 8c2c002 Compare June 25, 2026 09:49
@phip1611
phip1611 marked this pull request as ready for review June 25, 2026 10:28
@github-project-automation github-project-automation Bot moved this from 🆕 New to 📋 Backlog in Cloud Hypervisor Roadmap Jun 25, 2026
@likebreath
likebreath added this pull request to the merge queue Jun 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 25, 2026
@likebreath

Copy link
Copy Markdown
Member

Apparently the musl build and arm64 worker are not happy, which makes sense as they likely use different syscalls. @phip1611 I reached out over slack in case you need the ARM CI worker to fix it.

@phip1611
phip1611 force-pushed the upstream-migration-seccomp branch from bd773f1 to 2df3f28 Compare June 26, 2026 11:12
@phip1611 phip1611 mentioned this pull request Jun 26, 2026
@likebreath
likebreath marked this pull request as draft June 26, 2026 16:41
So far, we only have seccomp rules for the postcopy-send thread. This
commit introduces the basic plumbing to add seccomp rules also for the
migration worker (the migration coordinator) as well as the TCP workers
(both, send and receive) in the following.

To streamline code setup, all filters are created at a central place
early in the migration code. Although this means that some filters are
created without the need to do so (e.g., postcopy), this massively
simplifies code setup and error handling. This overhead is negligible.

On-behalf-of: SAP [email protected]
Signed-off-by: Philipp Schuster <[email protected]>
@phip1611
phip1611 force-pushed the upstream-migration-seccomp branch from 2df3f28 to 9ec7c80 Compare June 26, 2026 21:11
@phip1611
phip1611 force-pushed the upstream-migration-seccomp branch from 9ec7c80 to 7558811 Compare June 29, 2026 15:25
@phip1611
phip1611 marked this pull request as ready for review June 29, 2026 15:26
@phip1611

Copy link
Copy Markdown
Member Author

I think I fixed the ARM problem! It was missing SYS_tkill

@likebreath
likebreath added this pull request to the merge queue Jun 29, 2026
Merged via the queue into cloud-hypervisor:main with commit 1ae1cc7 Jun 29, 2026
38 checks passed
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Done in Cloud Hypervisor Roadmap Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants