Re: [RFC 03/16] kgr: initial code

2014-05-26 Thread Jiri Kosina
On Tue, 20 May 2014, Jiri Slaby wrote: > Yes, this is a problem I was thinking of in another context yesterday. > Patching ->read or any other file_openrations which hold state over > user<->kernel switches may be a potential threat like above. The same as > in other implementations of live patchi

Re: [RFC 03/16] kgr: initial code

2014-05-21 Thread Aravinda Prasad
On Tuesday 20 May 2014 05:06 PM, Jiri Slaby wrote: > On 05/14/2014 11:28 AM, Aravinda Prasad wrote: >>> +/* >>> + * The stub needs to modify the RIP value stored in struct pt_regs >>> + * so that ftrace redirects the execution properly. >>> + */ >>> +#define KGR_STUB_ARCH_SLOW(_name, _new_functio

Re: [RFC 03/16] kgr: initial code

2014-05-20 Thread Jiri Slaby
On 05/14/2014 11:28 AM, Aravinda Prasad wrote: >> +/* >> + * The stub needs to modify the RIP value stored in struct pt_regs >> + * so that ftrace redirects the execution properly. >> + */ >> +#define KGR_STUB_ARCH_SLOW(_name, _new_function)\ >> +static void _new_function ##_stu

Re: [RFC 03/16] kgr: initial code

2014-05-14 Thread Aravinda Prasad
On Wednesday 14 May 2014 04:14 PM, Jiri Slaby wrote: > On 05/14/2014 12:41 PM, Aravinda Prasad wrote: >> >> >> On Wednesday 14 May 2014 03:42 PM, Jiri Slaby wrote: >>> On 05/14/2014 11:28 AM, Aravinda Prasad wrote: On Wednesday 30 April 2014 08:00 PM, Jiri Slaby wrote: > From: Jiri Kosin

Re: [RFC 03/16] kgr: initial code

2014-05-14 Thread Jiri Slaby
On 05/14/2014 12:41 PM, Aravinda Prasad wrote: > > > On Wednesday 14 May 2014 03:42 PM, Jiri Slaby wrote: >> On 05/14/2014 11:28 AM, Aravinda Prasad wrote: >>> On Wednesday 30 April 2014 08:00 PM, Jiri Slaby wrote: From: Jiri Kosina Provide initial implementation. We are now able

Re: [RFC 03/16] kgr: initial code

2014-05-14 Thread Aravinda Prasad
On Wednesday 14 May 2014 03:42 PM, Jiri Slaby wrote: > On 05/14/2014 11:28 AM, Aravinda Prasad wrote: >> On Wednesday 30 April 2014 08:00 PM, Jiri Slaby wrote: >>> From: Jiri Kosina >>> >>> Provide initial implementation. We are now able to do ftrace-based >>> runtime patching of the kernel code

Re: [RFC 03/16] kgr: initial code

2014-05-14 Thread Jiri Slaby
On 05/14/2014 11:28 AM, Aravinda Prasad wrote: > On Wednesday 30 April 2014 08:00 PM, Jiri Slaby wrote: >> From: Jiri Kosina >> >> Provide initial implementation. We are now able to do ftrace-based >> runtime patching of the kernel code. >> >> In addition to that, we will provide a kgr_patcher mod

Re: [RFC 03/16] kgr: initial code

2014-05-14 Thread Aravinda Prasad
On Wednesday 30 April 2014 08:00 PM, Jiri Slaby wrote: > From: Jiri Kosina > > Provide initial implementation. We are now able to do ftrace-based > runtime patching of the kernel code. > > In addition to that, we will provide a kgr_patcher module in the next > patch to test the functionality.

Re: [RFC 03/16] kgr: initial code

2014-05-01 Thread Jiri Kosina
On Thu, 1 May 2014, Andi Kleen wrote: > > diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S > > index 1e96c3628bf2..a03b1e9d2de3 100644 > > --- a/arch/x86/kernel/entry_64.S > > +++ b/arch/x86/kernel/entry_64.S > > @@ -615,6 +615,7 @@ GLOBAL(system_call_after_swapgs) > > movq

Re: [RFC 03/16] kgr: initial code

2014-05-01 Thread Andi Kleen
Jiri Slaby writes: > OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); > diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S > index 1e96c3628bf2..a03b1e9d2de3 100644 > --- a/arch/x86/kernel/entry_64.S > +++ b/arch/x86/kernel/entry_64.S > @@ -615,6 +615,7 @@ GLOBAL(syste

Re: [RFC 03/16] kgr: initial code

2014-04-30 Thread Jiri Slaby
On 04/30/2014 04:56 PM, Steven Rostedt wrote: > On Wed, 30 Apr 2014 16:30:36 +0200 > Jiri Slaby wrote: >> --- a/arch/x86/kernel/entry_64.S >> +++ b/arch/x86/kernel/entry_64.S >> @@ -615,6 +615,7 @@ GLOBAL(system_call_after_swapgs) >> movq %rax,ORIG_RAX-ARGOFFSET(%rsp) >> movq %rcx,RIP-

Re: [RFC 03/16] kgr: initial code

2014-04-30 Thread Steven Rostedt
On Wed, 30 Apr 2014 16:30:36 +0200 Jiri Slaby wrote: > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 25d2c6f7325e..789a4c870ab3 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -130,6 +130,7 @@ config X86 > select HAVE_CC_STACKPROTECTOR > select GENERIC_CPU_AUT

[RFC 03/16] kgr: initial code

2014-04-30 Thread Jiri Slaby
From: Jiri Kosina Provide initial implementation. We are now able to do ftrace-based runtime patching of the kernel code. In addition to that, we will provide a kgr_patcher module in the next patch to test the functionality. Limitations/TODOs: - rmmod of the module that provides the patch is n