Skip to content

Conversation

@kolyshkin
Copy link
Contributor

Inspired by PR #5056.

@@ -51,7 +55,7 @@ func Files(unsetEnv bool) []*os.File {
}

nfds, err := strconv.Atoi(os.Getenv("LISTEN_FDS"))
if err != nil || nfds == 0 {
if err != nil || nfds <= 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I used the latest version of this file; this change comes from coreos/go-systemd@de1b3a8

@cyphar cyphar changed the title Copy go-systemd/actvation.Files code to avoid brining in crypto/tls Copy go-systemd/activation.Files code to avoid brining in crypto/tls Dec 7, 2025
@cyphar cyphar changed the title Copy go-systemd/activation.Files code to avoid brining in crypto/tls Copy go-systemd/activation.Files code to avoid bringing in crypto/tls Dec 7, 2025
@cyphar
Copy link
Member

cyphar commented Dec 7, 2025

This is probably an even better solution than a build tag to be honest...

@cyphar
Copy link
Member

cyphar commented Dec 7, 2025

My only question is whether we should put this in internal/third_party/systemd to make the provenence more obvious.

It appears that when we import github.com/coreos/go-systemd/activation,
it brings in the whole crypto/tls package (which is not used by runc
directly or indirectly), making the runc binary size larger and
potentially creating issues with FIPS compliance.

Let's copy the code of function we use from go-systemd/activation
to avoid that.

The space savings are:

$ size runc.before runc.after
   text	   data	    bss	    dec	    hex	filename
7101084	5049593	 271560	12422237	 bd8c5d	runc.before
6508796	4623281	 229128	11361205	 ad5bb5	runc.after

Reported-by: Dimitri John Ledkov <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
Remove unused code and argument from the ActivationFiles,
and simplify its usage.

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin
Copy link
Contributor Author

My only question is whether we should put this in internal/third_party/systemd to make the provenence more obvious.

implemented

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