]> Cypherpunks repositories - gostls13.git/commit
cmd/compile, cmd/link: add FIPS verification support
authorRuss Cox <rsc@golang.org>
Tue, 5 Nov 2024 18:51:32 +0000 (13:51 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 13 Nov 2024 01:25:15 +0000 (01:25 +0000)
commit239dbd7dbac883d6f9b6522774a0dfd519f77fa8
tree1275ae3fd7f8fc487636bce39f31a3e9094b579e
parent7eeb0a188eb644486da9f77bae0375d91433d0bf
cmd/compile, cmd/link: add FIPS verification support

For FIPS init-time code+data verification, we need to arrange to
put the FIPS symbols into contiguous regions of the executable
and then record those sections along with the expected checksum.

The cmd/internal/obj changes identify the FIPS symbols and give
them distinguished types, which the linker then places in contiguous
regions. The linker also writes out information to use at run time
to find the FIPS sections, along with the expected hash.

See cmd/internal/obj/fips.go and cmd/link/internal/ld/fips.go
for more details.

The code is disabled in this commit.
CL 625998 and 625999 adds tests.
CL 626000 enables the code.

For #69536.

Change-Id: I48da6db94bc0bea7428c43d4abcf999527bccfcd
Reviewed-on: https://go-review.googlesource.com/c/go/+/625997
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
17 files changed:
src/cmd/compile/internal/base/debug.go
src/cmd/compile/internal/base/flag.go
src/cmd/compile/internal/staticinit/sched.go
src/cmd/compile/internal/walk/complit.go
src/cmd/compile/internal/walk/order.go
src/cmd/internal/obj/data.go
src/cmd/internal/obj/fips.go [new file with mode: 0644]
src/cmd/internal/obj/plist.go
src/cmd/internal/obj/sym.go
src/cmd/internal/objfile/goobj.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/elf.go
src/cmd/link/internal/ld/fips.go [new file with mode: 0644]
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/main.go
src/cmd/link/internal/ld/symtab.go
src/cmd/link/internal/loader/loader.go