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

From: Qiu, PeiyangX
Date: Fri Dec 25 2015 - 01:23:22 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/