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>
Este cometimento está contido em:

cometido por
Linus Torvalds

ascendente
b3a9e3b962
cometimento
fe557319aa
@@ -38,7 +38,8 @@ static int ftrace_check_current_call(unsigned long hook_pos,
|
||||
* Read the text we want to modify;
|
||||
* return must be -EFAULT on read error
|
||||
*/
|
||||
if (probe_kernel_read(replaced, (void *)hook_pos, MCOUNT_INSN_SIZE))
|
||||
if (copy_from_kernel_nofault(replaced, (void *)hook_pos,
|
||||
MCOUNT_INSN_SIZE))
|
||||
return -EFAULT;
|
||||
|
||||
/*
|
||||
|
@@ -153,7 +153,7 @@ int do_single_step(struct pt_regs *regs)
|
||||
stepped_address = addr;
|
||||
|
||||
/* Replace the op code with the break instruction */
|
||||
error = probe_kernel_write((void *)stepped_address,
|
||||
error = copy_to_kernel_nofault((void *)stepped_address,
|
||||
arch_kgdb_ops.gdb_bpt_instr,
|
||||
BREAK_INSTR_SIZE);
|
||||
/* Flush and return */
|
||||
@@ -173,7 +173,7 @@ int do_single_step(struct pt_regs *regs)
|
||||
static void undo_single_step(struct pt_regs *regs)
|
||||
{
|
||||
if (stepped_opcode != 0) {
|
||||
probe_kernel_write((void *)stepped_address,
|
||||
copy_to_kernel_nofault((void *)stepped_address,
|
||||
(void *)&stepped_opcode, BREAK_INSTR_SIZE);
|
||||
flush_icache_range(stepped_address,
|
||||
stepped_address + BREAK_INSTR_SIZE);
|
||||
|
@@ -63,7 +63,7 @@ static int patch_insn_write(void *addr, const void *insn, size_t len)
|
||||
|
||||
waddr = patch_map(addr, FIX_TEXT_POKE0);
|
||||
|
||||
ret = probe_kernel_write(waddr, insn, len);
|
||||
ret = copy_to_kernel_nofault(waddr, insn, len);
|
||||
|
||||
patch_unmap(FIX_TEXT_POKE0);
|
||||
|
||||
@@ -76,7 +76,7 @@ NOKPROBE_SYMBOL(patch_insn_write);
|
||||
#else
|
||||
static int patch_insn_write(void *addr, const void *insn, size_t len)
|
||||
{
|
||||
return probe_kernel_write(addr, insn, len);
|
||||
return copy_to_kernel_nofault(addr, insn, len);
|
||||
}
|
||||
NOKPROBE_SYMBOL(patch_insn_write);
|
||||
#endif /* CONFIG_MMU */
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador