Re: Re: Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-21 Thread Masami Hiramatsu
(2013/03/21 20:39), Ingo Molnar wrote: > > * Masami Hiramatsu wrote: > >> (2013/03/19 5:57), Timo Juhani Lindfors wrote: >>> Masami Hiramatsu writes: Thank you for reporting!! >>> >>> Thanks for fixing these! I spent some time trying to automate the >>> process of finding sensitive functio

Re: Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-21 Thread Ingo Molnar
* Masami Hiramatsu wrote: > (2013/03/19 5:57), Timo Juhani Lindfors wrote: > > Masami Hiramatsu writes: > >> Thank you for reporting!! > > > > Thanks for fixing these! I spent some time trying to automate the > > process of finding sensitive functions and eventually resorted into > > booting a

Re: Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-18 Thread Masami Hiramatsu
(2013/03/19 5:57), Timo Juhani Lindfors wrote: > Masami Hiramatsu writes: >> Thank you for reporting!! > > Thanks for fixing these! I spent some time trying to automate the > process of finding sensitive functions and eventually resorted into > booting a kvm instance with a minimal initrd to test

Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-18 Thread Timo Juhani Lindfors
Masami Hiramatsu writes: > Thank you for reporting!! Thanks for fixing these! I spent some time trying to automate the process of finding sensitive functions and eventually resorted into booting a kvm instance with a minimal initrd to test every single function in a clean and reproducible environ

Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-13 Thread Masami Hiramatsu
(2013/03/13 22:28), Timo Juhani Lindfors wrote: > Masami Hiramatsu writes: >> OK, then I'll update it to just use __always_inline. > > I get a similar case of infinite recursion if I try to kprobe > "inat_get_opcode_attribute": Oops, right! And this is caused by below callchain set_current_kprob

Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-13 Thread Timo Juhani Lindfors
Masami Hiramatsu writes: > OK, then I'll update it to just use __always_inline. I get a similar case of infinite recursion if I try to kprobe "inat_get_opcode_attribute": PID: 3028 TASK: 88003c67e8c0 CPU: 1 COMMAND: "insmod" #0 [88003d60b9b8] __schedule at 813777f8 #1 [fff

Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-12 Thread Masami Hiramatsu
(2013/03/13 1:04), Linus Torvalds wrote: > On Mon, Mar 11, 2013 at 7:22 AM, Masami Hiramatsu > wrote: >> Beacuse hash_64() is called from the get_kprobe() inside >> int3 handler, kernel causes int3 recursion and crashes if >> kprobes user puts a probe on it. >> >> Usually hash_64() is inlined into

Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-12 Thread Linus Torvalds
On Mon, Mar 11, 2013 at 7:22 AM, Masami Hiramatsu wrote: > Beacuse hash_64() is called from the get_kprobe() inside > int3 handler, kernel causes int3 recursion and crashes if > kprobes user puts a probe on it. > > Usually hash_64() is inlined into caller function, but in > some cases, it has inst

Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-12 Thread Ingo Molnar
* Masami Hiramatsu wrote: > > The only complication is that __kprobes is now present in 600+ places, > > which will create merge conflicts. If you remind me during the next > > merge window I can generate the rename on the spot and send it to > > Linus without anyone having to carry the patch

Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-12 Thread Masami Hiramatsu
(2013/03/12 17:21), Ingo Molnar wrote: > > * Masami Hiramatsu wrote: > >> @@ -31,7 +32,7 @@ >> #error Wordsize not 32 or 64 >> #endif >> >> -static inline u64 hash_64(u64 val, unsigned int bits) >> +static __kprobes inline u64 hash_64(u64 val, unsigned int bits) >> { >> u64 hash = val;

Re: Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-12 Thread Masami Hiramatsu
(2013/03/12 17:16), Ingo Molnar wrote: > > * Masami Hiramatsu wrote: > >> Beacuse hash_64() is called from the get_kprobe() inside >> int3 handler, kernel causes int3 recursion and crashes if >> kprobes user puts a probe on it. >> >> Usually hash_64() is inlined into caller function, but in >> s

Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-12 Thread Ingo Molnar
* Masami Hiramatsu wrote: > @@ -31,7 +32,7 @@ > #error Wordsize not 32 or 64 > #endif > > -static inline u64 hash_64(u64 val, unsigned int bits) > +static __kprobes inline u64 hash_64(u64 val, unsigned int bits) > { > u64 hash = val; We should also, really, really fix the '__kprobes'

Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-12 Thread Ingo Molnar
* Masami Hiramatsu wrote: > Beacuse hash_64() is called from the get_kprobe() inside > int3 handler, kernel causes int3 recursion and crashes if > kprobes user puts a probe on it. > > Usually hash_64() is inlined into caller function, but in > some cases, it has instances by gcc's interprocedur

Re: [PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-11 Thread Ananth N Mavinakayanahalli
On Mon, Mar 11, 2013 at 11:22:33PM +0900, Masami Hiramatsu wrote: > Beacuse hash_64() is called from the get_kprobe() inside > int3 handler, kernel causes int3 recursion and crashes if > kprobes user puts a probe on it. > > Usually hash_64() is inlined into caller function, but in > some cases, it

[PATCH -tip ] [BUGFIX] kprobes: Move hash_64() into .text.kprobe section

2013-03-11 Thread Masami Hiramatsu
Beacuse hash_64() is called from the get_kprobe() inside int3 handler, kernel causes int3 recursion and crashes if kprobes user puts a probe on it. Usually hash_64() is inlined into caller function, but in some cases, it has instances by gcc's interprocedural constant propagation. This patch adds