Commit 166ad0e1 authored by Kefeng Wang's avatar Kefeng Wang Committed by Linus Torvalds

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: default avatarKefeng Wang <>
Acked-by: default avatarMark Rutland <>
Cc: Dmitry Vyukov <>
Cc: Andrey Ryabinin <>
Cc: James Morse <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 53855d10
......@@ -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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment