.. | .. |
---|
108 | 108 | goto skip_check; |
---|
109 | 109 | |
---|
110 | 110 | /* read the text we want to modify */ |
---|
111 | | - if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE)) |
---|
| 111 | + if (copy_from_kernel_nofault(replaced, (void *)ip, MCOUNT_INSN_SIZE)) |
---|
112 | 112 | return -EFAULT; |
---|
113 | 113 | |
---|
114 | 114 | /* Make sure it is what we expect it to be */ |
---|
.. | .. |
---|
117 | 117 | |
---|
118 | 118 | skip_check: |
---|
119 | 119 | /* replace the text with the new text */ |
---|
120 | | - if (probe_kernel_write(((void *)ip), new_code, MCOUNT_INSN_SIZE)) |
---|
| 120 | + if (copy_to_kernel_nofault(((void *)ip), new_code, MCOUNT_INSN_SIZE)) |
---|
121 | 121 | return -EPERM; |
---|
122 | 122 | flush_icache_range(ip, ip + MCOUNT_INSN_SIZE); |
---|
123 | 123 | |
---|
.. | .. |
---|
129 | 129 | unsigned char __attribute__((aligned(8))) replaced[MCOUNT_INSN_SIZE]; |
---|
130 | 130 | unsigned long ip = rec->ip; |
---|
131 | 131 | |
---|
132 | | - if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE)) |
---|
| 132 | + if (copy_from_kernel_nofault(replaced, (void *)ip, MCOUNT_INSN_SIZE)) |
---|
133 | 133 | return -EFAULT; |
---|
134 | 134 | if (rec->flags & FTRACE_FL_CONVERTED) { |
---|
135 | 135 | struct ftrace_call_insn *call_insn, *tmp_call; |
---|