lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Oct 2013 12:57:40 +0000
From:	Liuyongan <liuyongan@...wei.com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	Qianhuibin <qianhuibin@...wei.com>
Subject: kprobe pre_handler change return IP

I use kprobe to probe a function suppose: 
          int is_winter(int num) { ... }
          int replace_is_winter(int num) { ...} 
I want to replace is_winter() with replace_is_winter(), so when we call is_winter, replace_is_winter will be called.
                                                                                                                  
so:  
   int my_pre_handler(struct kprobe *p, struct pt_regs *regs)
   { 
        regs->ip = (unsigned long)&replace_is_winter;
        return 1;
   } 

and echo 0 > /proc/sys/debug/kprobes-optimization so that jump instruction will not be used.

I got a exception in fault_handler, and trap number is 14.

   fault_handler: p->addr = 0xffffffffa08e201a, ip = ffffffff8021c59d, trap #14n

Anyone here can help me ?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ