aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/events
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-11-09 11:58:54 -0500
committerOleg Nesterov <oleg@redhat.com>2013-11-20 10:31:00 -0500
commit803200e24abf0f9ec18631290d26b2185477f3a6 (patch)
treef04ac6d7dd72f4b73acaaf86576c7a27cb8b9386 /kernel/events
parent3247343118daa73f2b94b7fa565425d1d9f9ac84 (diff)
uprobes: Don't assume that arch_uprobe->insn/ixol is u8[MAX_UINSN_BYTES]
arch_uprobe should be opaque as much as possible to the generic code, but currently it assumes that insn/ixol must be u8[] of the known size. Remove this unnecessary dependency, we can use "&" and and sizeof() with the same effect. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/uprobes.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index df4ef0971266..445962a72498 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -330,7 +330,7 @@ int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned
330int __weak 330int __weak
331set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr) 331set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr)
332{ 332{
333 return uprobe_write_opcode(mm, vaddr, *(uprobe_opcode_t *)auprobe->insn); 333 return uprobe_write_opcode(mm, vaddr, *(uprobe_opcode_t *)&auprobe->insn);
334} 334}
335 335
336static int match_uprobe(struct uprobe *l, struct uprobe *r) 336static int match_uprobe(struct uprobe *l, struct uprobe *r)
@@ -529,8 +529,8 @@ static int copy_insn(struct uprobe *uprobe, struct file *filp)
529{ 529{
530 struct address_space *mapping = uprobe->inode->i_mapping; 530 struct address_space *mapping = uprobe->inode->i_mapping;
531 loff_t offs = uprobe->offset; 531 loff_t offs = uprobe->offset;
532 void *insn = uprobe->arch.insn; 532 void *insn = &uprobe->arch.insn;
533 int size = MAX_UINSN_BYTES; 533 int size = sizeof(uprobe->arch.insn);
534 int len, err = -EIO; 534 int len, err = -EIO;
535 535
536 /* Copy only available bytes, -EIO if nothing was read */ 536 /* Copy only available bytes, -EIO if nothing was read */
@@ -569,7 +569,7 @@ static int prepare_uprobe(struct uprobe *uprobe, struct file *file,
569 goto out; 569 goto out;
570 570
571 ret = -ENOTSUPP; 571 ret = -ENOTSUPP;
572 if (is_trap_insn((uprobe_opcode_t *)uprobe->arch.insn)) 572 if (is_trap_insn((uprobe_opcode_t *)&uprobe->arch.insn))
573 goto out; 573 goto out;
574 574
575 ret = arch_uprobe_analyze_insn(&uprobe->arch, mm, vaddr); 575 ret = arch_uprobe_analyze_insn(&uprobe->arch, mm, vaddr);
@@ -1264,7 +1264,7 @@ static unsigned long xol_get_insn_slot(struct uprobe *uprobe)
1264 1264
1265 /* Initialize the slot */ 1265 /* Initialize the slot */
1266 copy_to_page(area->page, xol_vaddr, 1266 copy_to_page(area->page, xol_vaddr,
1267 uprobe->arch.ixol, sizeof(uprobe->arch.ixol)); 1267 &uprobe->arch.ixol, sizeof(uprobe->arch.ixol));
1268 /* 1268 /*
1269 * We probably need flush_icache_user_range() but it needs vma. 1269 * We probably need flush_icache_user_range() but it needs vma.
1270 * This should work on supported architectures too. 1270 * This should work on supported architectures too.