maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault
Better describe what these functions do. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

szülő
b3a9e3b962
commit
fe557319aa
@@ -756,7 +756,8 @@ int module_trampoline_target(struct module *mod, unsigned long addr,
|
||||
|
||||
stub = (struct ppc64_stub_entry *)addr;
|
||||
|
||||
if (probe_kernel_read(&magic, &stub->magic, sizeof(magic))) {
|
||||
if (copy_from_kernel_nofault(&magic, &stub->magic,
|
||||
sizeof(magic))) {
|
||||
pr_err("%s: fault reading magic for stub %lx for %s\n", __func__, addr, mod->name);
|
||||
return -EFAULT;
|
||||
}
|
||||
@@ -766,7 +767,8 @@ int module_trampoline_target(struct module *mod, unsigned long addr,
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (probe_kernel_read(&funcdata, &stub->funcdata, sizeof(funcdata))) {
|
||||
if (copy_from_kernel_nofault(&funcdata, &stub->funcdata,
|
||||
sizeof(funcdata))) {
|
||||
pr_err("%s: fault reading funcdata for stub %lx for %s\n", __func__, addr, mod->name);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
@@ -226,7 +226,7 @@ __ftrace_make_nop(struct module *mod,
|
||||
unsigned long ip = rec->ip;
|
||||
unsigned long tramp;
|
||||
|
||||
if (probe_kernel_read(&op, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
if (copy_from_kernel_nofault(&op, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
return -EFAULT;
|
||||
|
||||
/* Make sure that that this is still a 24bit jump */
|
||||
@@ -249,7 +249,7 @@ __ftrace_make_nop(struct module *mod,
|
||||
pr_devel("ip:%lx jumps to %lx", ip, tramp);
|
||||
|
||||
/* Find where the trampoline jumps to */
|
||||
if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) {
|
||||
if (copy_from_kernel_nofault(jmp, (void *)tramp, sizeof(jmp))) {
|
||||
pr_err("Failed to read %lx\n", tramp);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user