Skip to content

Commit

Permalink
Merge pull request #4257 from sohankunkerkar/release-1.1
Browse files Browse the repository at this point in the history
[1.1] libcontainer: force apps to think fips is enabled/disabled for testing
  • Loading branch information
mrunalp committed Apr 26, 2024
2 parents 5bfff6a + 6379b58 commit e8bb71e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions libcontainer/rootfs_linux.go
Expand Up @@ -602,6 +602,7 @@ func checkProcMount(rootfs, dest, source string) error {
"/proc/slabinfo",
"/proc/net/dev",
"/proc/sys/kernel/ns_last_pid",
"/proc/sys/crypto/fips_enabled",
}
for _, valid := range validProcMounts {
path, err := filepath.Rel(filepath.Join(rootfs, valid), dest)
Expand Down
8 changes: 8 additions & 0 deletions libcontainer/rootfs_linux_test.go
Expand Up @@ -46,6 +46,14 @@ func TestCheckMountDestNsLastPid(t *testing.T) {
}
}

func TestCheckCryptoFipsEnabled(t *testing.T) {
dest := "/rootfs/proc/sys/crypto/fips_enabled"
err := checkProcMount("/rootfs", dest, "/proc")
if err != nil {
t.Fatalf("/proc/sys/crypto/fips_enabled should not return an error: %v", err)
}
}

func TestNeedsSetupDev(t *testing.T) {
config := &configs.Config{
Mounts: []*configs.Mount{
Expand Down

0 comments on commit e8bb71e

Please sign in to comment.