aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/host_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/host/host_linux.go')
-rw-r--r--pkg/host/host_linux.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/host/host_linux.go b/pkg/host/host_linux.go
index ef301e2dc..6da153f2d 100644
--- a/pkg/host/host_linux.go
+++ b/pkg/host/host_linux.go
@@ -5,6 +5,7 @@ package host
import (
"bytes"
+ "fmt"
"io/ioutil"
"runtime"
"strconv"
@@ -159,3 +160,13 @@ func extractStringConst(typ prog.Type) (string, bool) {
v = v[:len(v)-1] // string terminating \x00
return v, true
}
+
+func EnableFaultInjection() error {
+ if err := osutil.WriteFile("/sys/kernel/debug/failslab/ignore-gfp-wait", []byte("N")); err != nil {
+ return fmt.Errorf("failed to write /sys/kernel/debug/failslab/ignore-gfp-wait: %v", err)
+ }
+ if err := osutil.WriteFile("/sys/kernel/debug/fail_futex/ignore-private", []byte("N")); err != nil {
+ return fmt.Errorf("failed to write /sys/kernel/debug/fail_futex/ignore-private: %v", err)
+ }
+ return nil
+}