kcov: add missing #include <linux/sched.h>
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.
[[email protected]: rewrote changelog]
Signed-off-by Kefeng Wang <[email protected]>
Acked-by Mark Rutland <[email protected]>
Cc Dmitry Vyukov <[email protected]>
Cc Andrey Ryabinin <[email protected]>
Cc James Morse <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
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
@@ -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>
_