mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
hw-breakpoints: Tag ptrace breakpoint as exclude_kernel
Tag ptrace breakpoints with the exclude_kernel attribute set. This will make it easier to set generic policies on breakpoints, when it comes to ensure nobody unpriviliged try to breakpoint on the kernel. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Paul Mundt <lethal@linux-sh.org> Cc: Will Deacon <will.deacon@arm.com> Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Cc: K. Prasad <prasad@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
d00a47cce5
commit
73266fc1df
3 changed files with 8 additions and 2 deletions
|
|
@ -34,6 +34,12 @@ static inline void hw_breakpoint_init(struct perf_event_attr *attr)
|
|||
attr->sample_period = 1;
|
||||
}
|
||||
|
||||
static inline void ptrace_breakpoint_init(struct perf_event_attr *attr)
|
||||
{
|
||||
hw_breakpoint_init(attr);
|
||||
attr->exclude_kernel = 1;
|
||||
}
|
||||
|
||||
static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
|
||||
{
|
||||
return bp->attr.bp_addr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue