Skip to contentSkip to conversation

kcov: add missing #include <linux/sched.h>

PATCH New [email protected] 1 participant 1 message Dec 7, 2016 KCOV

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 kcov: add missing #include <linux/sched.h>

From: Kefeng Wang <[email protected]>
Subject: kcov: add missing #include <linux/sched.h>

In __sanitizer_cov_trace_pc we use task_struct and fields within it, but as we haven't included <linux/sched.h>, it is not guaranteed to be defined. While we usually happen to acquire the definition through a transitive include, this is fragile (and hasn't been true in the past, causing issues with backports).

Include <linux/sched.h> to avoid any fragility.

---

 kernel/kcov.c |    1 +
 1 file changed, 1 insertion(+)
kernel/kcov.c renamed from kernel/kcov.c~kcov-add-missing-include-linux-schedh +1 -0
diff -puN kernel/kcov.c~kcov-add-missing-include-linux-schedh kernel/kcov.c
@@ -7,6 +7,7 @@
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/printk.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/vmalloc.h>

_