Bug 211351
Summary: | Syzkaller:read-only memory access caused with the __ro_after_init | ||
---|---|---|---|
Product: | Networking | Reporter: | kircher (kircherlike) |
Component: | Other | Assignee: | Stephen Hemminger (stephen) |
Status: | NEW --- | ||
Severity: | high | CC: | kubakici |
Priority: | P1 | ||
Hardware: | ARM | ||
OS: | Linux | ||
Kernel Version: | 4.19.90 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
kircher
2021-01-26 14:20:52 UTC
At a glance looks like a problem with __ro_after_init on your platform. The call trace shows genl_register_family() is called from do_init_module(), the __ro_after_init should not have been marked Read-Only yet when genl is called. (In reply to Jakub Kicinski from comment #1) > At a glance looks like a problem with __ro_after_init on your platform. > The call trace shows genl_register_family() is called from do_init_module(), > the __ro_after_init should not have been marked Read-Only yet when genl is > called. After thorough testing, we believe that this problem is caused by ftrace. In kernel 4.19, ftrace calls module_disable_ro before do_init_module to mark the memory as read-only. The calling relationship is ftrace_replace_code ->__ftrace_replace_code ->ftrace_make_call ->module_enable_ro We notice that the following statement exists in the ftrace_make_call function. The module_enable_ro function is called when you enter the if statement.: long offset = (long)pc - (long)addr; if (offset < -SZ_128M || offset >= SZ_128M) { ... module_disable_ro(mod); *dst = trampoline; module_enable_ro(mod, true); ... } Run the following command to reproduce the problem,although we don't know why this if condition is entered: cd /sys/kernel/debug/tracing/ echo function > current_tracer echo :mod:l2tp_netlink > set_ftrace_filter modprobe l2tp_netlink |