Skip to content

fix ftrace initialization issue when a module is loaded

Qiu, PeiyangX lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ftrace: fix the race between ftrace and insmodkernel/trace/ftrace.c+14 -70 replies
1/2ftrace: fix the race between ftrace and insmodkernel/trace/ftrace.c+13 -30 replies
2/2module: deal with the failure of complete_formationkernel/module.c+5 -45 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] fix ftrace initialization issue when a module is loaded

When a module is loaded, current ftrace initialization around the new module has some issues.

1) ftrace might race with insmod: Just after load_module calls ftrace_module_init to add ftrace records of the module, ftrace_run_update_code might jump in to change module codes. But load_module calls complete_formation=>set_section_ro_nx to put the module TEXT attribute to RO. Then, ftrace_run_update_code triggers ftrace_bug and fails.

2) complete_formation might fail and the module's ftrace records are not cleaned up.

This patchset fixes above issues.