Skip to content

Commit e8bb71e

Browse files
authored
Merge pull request #4257 from sohankunkerkar/release-1.1
[1.1] libcontainer: force apps to think fips is enabled/disabled for testing
2 parents 5bfff6a + 6379b58 commit e8bb71e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

libcontainer/rootfs_linux.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ func checkProcMount(rootfs, dest, source string) error {
602602
"/proc/slabinfo",
603603
"/proc/net/dev",
604604
"/proc/sys/kernel/ns_last_pid",
605+
"/proc/sys/crypto/fips_enabled",
605606
}
606607
for _, valid := range validProcMounts {
607608
path, err := filepath.Rel(filepath.Join(rootfs, valid), dest)

libcontainer/rootfs_linux_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ func TestCheckMountDestNsLastPid(t *testing.T) {
4646
}
4747
}
4848

49+
func TestCheckCryptoFipsEnabled(t *testing.T) {
50+
dest := "/rootfs/proc/sys/crypto/fips_enabled"
51+
err := checkProcMount("/rootfs", dest, "/proc")
52+
if err != nil {
53+
t.Fatalf("/proc/sys/crypto/fips_enabled should not return an error: %v", err)
54+
}
55+
}
56+
4957
func TestNeedsSetupDev(t *testing.T) {
5058
config := &configs.Config{
5159
Mounts: []*configs.Mount{

0 commit comments

Comments
 (0)