diff options
authorKefeng Wang <>2016-12-07 14:44:36 -0800
committerLinus Torvalds <>2016-12-07 17:10:00 -0800
commit166ad0e1e2132ff0cda08b94af8301655fcabbcd (patch)
parent53855d10f4567a0577360b6448d52a863929775b (diff)
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. [ rewrote changelog] Link: Signed-off-by: Kefeng Wang <> Acked-by: Mark Rutland <> Cc: Dmitry Vyukov <> Cc: Andrey Ryabinin <> Cc: James Morse <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/kcov.c b/kernel/kcov.c
index 30e6d05aa5a9..3cbb0c879705 100644
--- a/kernel/kcov.c
+++ b/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>