aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
Diffstat (limited to 'executor')
-rw-r--r--executor/executor.cc4
-rw-r--r--executor/executor_linux.h12
2 files changed, 16 insertions, 0 deletions
diff --git a/executor/executor.cc b/executor/executor.cc
index 2635d5a7c..768081ad6 100644
--- a/executor/executor.cc
+++ b/executor/executor.cc
@@ -1404,6 +1404,10 @@ void setup_features(char** enable, int n)
{
// This does any one-time setup for the requested features on the machine.
// Note: this can be called multiple times and must be idempotent.
+#if SYZ_HAVE_FEATURES
+ // Note: this is not executed in C reproducers.
+ setup_machine();
+#endif
for (int i = 0; i < n; i++) {
bool found = false;
#if SYZ_HAVE_FEATURES
diff --git a/executor/executor_linux.h b/executor/executor_linux.h
index 63c900c5a..d4220c23f 100644
--- a/executor/executor_linux.h
+++ b/executor/executor_linux.h
@@ -225,3 +225,15 @@ static feature_t features[] = {
{"binfmt_misc", setup_binfmt_misc},
{"kcsan", setup_kcsan},
};
+
+static void setup_machine()
+{
+ // nmi_check_duration() prints "INFO: NMI handler took too long" on slow debug kernels.
+ // It happens a lot in qemu, and the messages are frequently corrupted
+ // (intermixed with other kernel output as they are printed from NMI)
+ // and are not matched against the suppression in pkg/report.
+ // This write prevents these messages from being printed.
+ // Note: this is not executed in C reproducers.
+ if (!write_file("/sys/kernel/debug/x86/nmi_longest_ns", "10000000000"))
+ printf("write to /sys/kernel/debug/x86/nmi_longest_ns failed: %s\n", strerror(errno));
+}