Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169428
b: refs/heads/master
c: 74ebb63
h: refs/heads/master
v: v3
  • Loading branch information
Masami Hiramatsu authored and Frederic Weisbecker committed Sep 17, 2009
1 parent 0e6900a commit 0bbbe8c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50d780560785b068c358675c5f0bf6c83b5c373e
refs/heads/master: 74ebb63e7cd25f6fb02a45fc2ea7735bce1217c9
17 changes: 12 additions & 5 deletions trunk/kernel/trace/trace_kprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,18 +1149,23 @@ static __kprobes int kprobe_profile_func(struct kprobe *kp,
struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp);
struct ftrace_event_call *call = &tp->call;
struct kprobe_trace_entry *entry;
int size, i, pc;
int size, __size, i, pc;
unsigned long irq_flags;

local_save_flags(irq_flags);
pc = preempt_count();

size = SIZEOF_KPROBE_TRACE_ENTRY(tp->nr_args);
__size = SIZEOF_KPROBE_TRACE_ENTRY(tp->nr_args);
size = ALIGN(__size + sizeof(u32), sizeof(u64));
size -= sizeof(u32);

do {
char raw_data[size];
struct trace_entry *ent;

/*
* Zero dead bytes from alignment to avoid stack leak
* to userspace
*/
*(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL;
entry = (struct kprobe_trace_entry *)raw_data;
ent = &entry->ent;
Expand All @@ -1183,13 +1188,15 @@ static __kprobes int kretprobe_profile_func(struct kretprobe_instance *ri,
struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp);
struct ftrace_event_call *call = &tp->call;
struct kretprobe_trace_entry *entry;
int size, i, pc;
int size, __size, i, pc;
unsigned long irq_flags;

local_save_flags(irq_flags);
pc = preempt_count();

size = SIZEOF_KRETPROBE_TRACE_ENTRY(tp->nr_args);
__size = SIZEOF_KRETPROBE_TRACE_ENTRY(tp->nr_args);
size = ALIGN(__size + sizeof(u32), sizeof(u64));
size -= sizeof(u32);

do {
char raw_data[size];
Expand Down

0 comments on commit 0bbbe8c

Please sign in to comment.