-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'for-next/kprobes' into for-next/core
* kprobes: arm64: kprobes: Add KASAN instrumentation around stack accesses arm64: kprobes: Cleanup jprobe_return arm64: kprobes: Fix overflow when saving stack arm64: kprobes: WARN if attempting to step with PSTATE.D=1 kprobes: Add arm64 case in kprobe example module arm64: Add kernel return probes support (kretprobes) arm64: Add trampoline code for kretprobes arm64: kprobes instruction simulation support arm64: Treat all entry code as non-kprobe-able arm64: Blacklist non-kprobe-able symbol arm64: Kprobes with single stepping support arm64: add conditional instruction simulation support arm64: Add more test functions to insn.c arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature
- Loading branch information
Showing
27 changed files
with
1,781 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* arch/arm64/include/asm/kprobes.h | ||
* | ||
* Copyright (C) 2013 Linaro Limited | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
*/ | ||
|
||
#ifndef _ARM_KPROBES_H | ||
#define _ARM_KPROBES_H | ||
|
||
#include <linux/types.h> | ||
#include <linux/ptrace.h> | ||
#include <linux/percpu.h> | ||
|
||
#define __ARCH_WANT_KPROBES_INSN_SLOT | ||
#define MAX_INSN_SIZE 1 | ||
#define MAX_STACK_SIZE 128 | ||
|
||
#define flush_insn_slot(p) do { } while (0) | ||
#define kretprobe_blacklist_size 0 | ||
|
||
#include <asm/probes.h> | ||
|
||
struct prev_kprobe { | ||
struct kprobe *kp; | ||
unsigned int status; | ||
}; | ||
|
||
/* Single step context for kprobe */ | ||
struct kprobe_step_ctx { | ||
unsigned long ss_pending; | ||
unsigned long match_addr; | ||
}; | ||
|
||
/* per-cpu kprobe control block */ | ||
struct kprobe_ctlblk { | ||
unsigned int kprobe_status; | ||
unsigned long saved_irqflag; | ||
struct prev_kprobe prev_kprobe; | ||
struct kprobe_step_ctx ss_ctx; | ||
struct pt_regs jprobe_saved_regs; | ||
char jprobes_stack[MAX_STACK_SIZE]; | ||
}; | ||
|
||
void arch_remove_kprobe(struct kprobe *); | ||
int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr); | ||
int kprobe_exceptions_notify(struct notifier_block *self, | ||
unsigned long val, void *data); | ||
int kprobe_breakpoint_handler(struct pt_regs *regs, unsigned int esr); | ||
int kprobe_single_step_handler(struct pt_regs *regs, unsigned int esr); | ||
void kretprobe_trampoline(void); | ||
void __kprobes *trampoline_probe_handler(struct pt_regs *regs); | ||
|
||
#endif /* _ARM_KPROBES_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* arch/arm64/include/asm/probes.h | ||
* | ||
* Copyright (C) 2013 Linaro Limited | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
*/ | ||
#ifndef _ARM_PROBES_H | ||
#define _ARM_PROBES_H | ||
|
||
#include <asm/opcodes.h> | ||
|
||
struct kprobe; | ||
struct arch_specific_insn; | ||
|
||
typedef u32 kprobe_opcode_t; | ||
typedef void (kprobes_handler_t) (u32 opcode, long addr, struct pt_regs *); | ||
|
||
/* architecture specific copy of original instruction */ | ||
struct arch_specific_insn { | ||
kprobe_opcode_t *insn; | ||
pstate_check_t *pstate_cc; | ||
kprobes_handler_t *handler; | ||
/* restore address after step xol */ | ||
unsigned long restore; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.