Fix trixie FIPS Go package: correct version and robust changelog update#84
Closed
sigabrtv1-ui wants to merge 1 commit intosonic-net:mainfrom
Closed
Fix trixie FIPS Go package: correct version and robust changelog update#84sigabrtv1-ui wants to merge 1 commit intosonic-net:mainfrom
sigabrtv1-ui wants to merge 1 commit intosonic-net:mainfrom
Conversation
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
The GOLANG_VERSOIN variable was set to '1.24~2' but the golang-debian submodule changelog has version '1.24.4-1'. This caused the sed command in src/golang/Makefile to silently fail: sed -i 's/1.24~2/1.24~2+fips/' debian/changelog Since '1.24~2' doesn't appear in the changelog, the +fips suffix was never added, and the published package was effectively stock Debian Go without sonic-fips patches (sonic_fips detection, symcryptprovider). Fixes: 1. Update GOLANG_VERSOIN to match actual debian changelog version 2. Use dpkg-parsechangelog in Makefile for robust version detection, preventing this class of bug when the debian submodule is updated This fixes FIPS test failures (fips/test_fips.py) for trixie containers with Go binaries, where the telemetry process doesn't load symcrypt because the Go runtime can't detect SONiC FIPS mode. Fixes: sonic-net#83 Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
fcc0d2b to
d271ec5
Compare
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Author
|
Closing — sonic-net/sonic-buildimage#26431 addresses the FIPS Go issue from the sonic-buildimage side. |
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.
Description
The trixie FIPS Go package published to
packages.trafficmanager.netis currently the stock Debian golang without sonic-fips patches applied. This PR fixes the build so patches are correctly applied.Root Cause
GOLANG_VERSOINinrules/golang.mkwas set to1.24~2, but thegolang-debiansubmodule (82620eaf) has changelog version1.24.4-1. The sed command insrc/golang/Makefile:sed -i "s/1.24~2/1.24~2+fips/" debian/changelogsilently fails because
1.24~2does not appear in the changelog. As a result:+fipsversion suffix is never added.debis version1.24.4-1(indistinguishable from stock Debian)Changes
rules/golang.mk: UpdateGOLANG_VERSOINfrom1.24~2to1.24.4-1to match the actual debian changelog versionsrc/golang/Makefile: Usedpkg-parsechangelog --show-field Versioninstead of hardcoded$(GOLANG_VERSOIN)for robust version detection, preventing this class of bug when the debian submodule is updatedImpact
Without this fix, all Go binaries in trixie containers are missing:
sonic_fips=1detection in/proc/cmdline(Go only checks/proc/sys/crypto/fips_enabled)symcryptprovideras the FIPS provider name (Go looks for"fips"instead)OPENSSL_init_crypto(INIT_LOAD_CONFIG)call (OpenSSL config not loaded)This causes
fips/test_fips.pyfailures in sonic-buildimage CI for any trixie container with Go binaries (e.g., gnmi container migration in sonic-net/sonic-buildimage#25957).Verification
After this fix, the built package should:
1.24.4-1+fips(with+fipssuffix)hostfips.gowithsonic_fips=1detectionopenssl.gowithsymcryptprovidername# Verify the built deb dpkg-deb -x golang-1.24-go_1.24.4-1+fips_amd64.deb /tmp/verify/ grep sonic_fips /tmp/verify/usr/share/go-1.24/src/crypto/internal/backend/hostfips.go grep symcryptprovider /tmp/verify/usr/share/go-1.24/src/vendor/github.com/golang-fips/openssl/v2/openssl.goFollow-up needed
After this PR merges and the packages are republished,
sonic-buildimageneeds a corresponding update inrules/sonic-fips.mkto change the trixieFIPS_GOLANG_VERSIONfrom1.24.4-1to1.24.4-1+fips.Fixes #83