diff options
| author | Kui-Feng Lee <[email protected]> | 2022-12-16 14:18:54 -0800 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2022-12-28 14:11:48 -0800 |
| commit | 7ff94f276f8ea05df82eb115225e9b26f47a3347 (patch) | |
| tree | 66ab8a720acbe92e8d791ad5ae383d9ed6fce1fe /tools/perf/scripts/python/Perf-Trace-Util/Context.c | |
| parent | 8f161ca1105a6af6614333f13aa7be4aab8b633a (diff) | |
bpf: keep a reference to the mm, in case the task is dead.
Fix the system crash that happens when a task iterator travel through
vma of tasks.
In task iterators, we used to access mm by following the pointer on
the task_struct; however, the death of a task will clear the pointer,
even though we still hold the task_struct. That can cause an
unexpected crash for a null pointer when an iterator is visiting a
task that dies during the visit. Keeping a reference of mm on the
iterator ensures we always have a valid pointer to mm.
Co-developed-by: Song Liu <[email protected]>
Signed-off-by: Song Liu <[email protected]>
Signed-off-by: Kui-Feng Lee <[email protected]>
Reported-by: Nathan Slingerland <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/Context.c')
0 files changed, 0 insertions, 0 deletions