s390/kprobes: remove KPROBE_SWAP_INST state
For an unknown reason the s390 kprobes instruction replacement function modifies the kprobe_status of the current CPU to KPROBE_SWAP_INST. This was supposed to catch traps that happened during instruction patching. Such a fault is not supposed to happen, and silently discarding such a fault is certainly also not what we want. In fact s390 is the only architecture which has this odd piece of code. Just remove this and behave like all other architectures. This was pointed out by Jens Remus. Reported-by: Jens Remus <jremus@linux.vnet.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
49913f1fd0
commit
df8bbd0c98
|
@ -63,8 +63,6 @@ typedef u16 kprobe_opcode_t;
|
||||||
|
|
||||||
#define kretprobe_blacklist_size 0
|
#define kretprobe_blacklist_size 0
|
||||||
|
|
||||||
#define KPROBE_SWAP_INST 0x10
|
|
||||||
|
|
||||||
/* Architecture specific copy of original instruction */
|
/* Architecture specific copy of original instruction */
|
||||||
struct arch_specific_insn {
|
struct arch_specific_insn {
|
||||||
/* copy of original instruction */
|
/* copy of original instruction */
|
||||||
|
|
|
@ -161,8 +161,6 @@ struct swap_insn_args {
|
||||||
|
|
||||||
static int swap_instruction(void *data)
|
static int swap_instruction(void *data)
|
||||||
{
|
{
|
||||||
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
|
|
||||||
unsigned long status = kcb->kprobe_status;
|
|
||||||
struct swap_insn_args *args = data;
|
struct swap_insn_args *args = data;
|
||||||
struct ftrace_insn new_insn, *insn;
|
struct ftrace_insn new_insn, *insn;
|
||||||
struct kprobe *p = args->p;
|
struct kprobe *p = args->p;
|
||||||
|
@ -185,9 +183,7 @@ static int swap_instruction(void *data)
|
||||||
ftrace_generate_nop_insn(&new_insn);
|
ftrace_generate_nop_insn(&new_insn);
|
||||||
}
|
}
|
||||||
skip_ftrace:
|
skip_ftrace:
|
||||||
kcb->kprobe_status = KPROBE_SWAP_INST;
|
|
||||||
s390_kernel_write(p->addr, &new_insn, len);
|
s390_kernel_write(p->addr, &new_insn, len);
|
||||||
kcb->kprobe_status = status;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
NOKPROBE_SYMBOL(swap_instruction);
|
NOKPROBE_SYMBOL(swap_instruction);
|
||||||
|
@ -574,9 +570,6 @@ static int kprobe_trap_handler(struct pt_regs *regs, int trapnr)
|
||||||
const struct exception_table_entry *entry;
|
const struct exception_table_entry *entry;
|
||||||
|
|
||||||
switch(kcb->kprobe_status) {
|
switch(kcb->kprobe_status) {
|
||||||
case KPROBE_SWAP_INST:
|
|
||||||
/* We are here because the instruction replacement failed */
|
|
||||||
return 0;
|
|
||||||
case KPROBE_HIT_SS:
|
case KPROBE_HIT_SS:
|
||||||
case KPROBE_REENTER:
|
case KPROBE_REENTER:
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue