Re: [PATCHv2 2/3] kernel: add support for live patching

2014-11-18 Thread Miroslav Benes
/* _LINUX_LIVEPATCH_H_ */ Thanks, -- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org

Re: [PATCHv2 2/3] kernel: add support for live patching

2014-11-19 Thread Miroslav Benes
lpc_find_object_module()? Thank you, -- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCHv2 2/3] kernel: add support for live patching

2014-11-20 Thread Miroslav Benes
you say? Next, I'll look at the three level hierarchy and sysfs directory and see if we can make it simpler yet keep its advantages. Regards, Miroslav Benes SUSE Labs -- 8 -- From aba839eb6b3292b193843715bfce7834969c0c17 Mon Sep 17 00:00:00 2001 From: Miroslav Benes mbe...@suse.cz Date: Wed

Re: [PATCHv2 2/3] kernel: add support for live patching

2014-11-20 Thread Miroslav Benes
On Wed, 19 Nov 2014, Seth Jennings wrote: On Tue, Nov 18, 2014 at 03:45:22PM +0100, Miroslav Benes wrote: On Sun, 16 Nov 2014, Seth Jennings wrote: [...] diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h new file mode 100644 index 000..8b68fef

Re: [PATCHv2 2/3] kernel: add support for live patching

2014-11-21 Thread Miroslav Benes
On Thu, 20 Nov 2014, Josh Poimboeuf wrote: On Thu, Nov 20, 2014 at 02:10:33PM +0100, Miroslav Benes wrote: On Sun, 16 Nov 2014, Seth Jennings wrote: This commit introduces code for the live patching core. It implements an ftrace-based mechanism and kernel interface for doing live

Re: [PATCHv2 2/3] kernel: add support for live patching

2014-11-21 Thread Miroslav Benes
On Thu, 20 Nov 2014, Seth Jennings wrote: On Thu, Nov 20, 2014 at 11:35:52AM -0600, Josh Poimboeuf wrote: On Thu, Nov 20, 2014 at 02:10:33PM +0100, Miroslav Benes wrote: On Sun, 16 Nov 2014, Seth Jennings wrote: This commit introduces code for the live patching core

Re: [PATCHv3 2/3] kernel: add support for live patching

2014-11-21 Thread Miroslav Benes
-- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCHv3 2/3] kernel: add support for live patching

2014-11-21 Thread Miroslav Benes
On Fri, 21 Nov 2014, Josh Poimboeuf wrote: On Fri, Nov 21, 2014 at 03:44:35PM +0100, Miroslav Benes wrote: On Fri, 21 Nov 2014, Jiri Kosina wrote: [...] [ ... snip ... ] +static int klp_init_patch(struct klp_patch *patch) +{ + int ret; + + mutex_lock

Re: [PATCH 2/2] kernel: add support for live patching

2014-11-13 Thread Miroslav Benes
, -- Miroslav Benes SUSE Labs From f659a18a630de27b47d375119d793e28ee50da04 Mon Sep 17 00:00:00 2001 From: Miroslav Benes mbe...@suse.cz Date: Thu, 13 Nov 2014 10:25:48 +0100 Subject: [PATCH] lpc: simplification of structure and sysfs hierarchy Original code has several issues this patch

Re: [PATCH 2/2] kernel: add support for live patching

2014-11-14 Thread Miroslav Benes
On Thu, 13 Nov 2014, Seth Jennings wrote: On Thu, Nov 13, 2014 at 11:16:00AM +0100, Miroslav Benes wrote: Hi, thank you for the first version of the united live patching core. The patch below implements some of our review objections. Changes are described in the commit log

Re: [PATCHv4 2/3] kernel: add support for live patching

2014-11-26 Thread Miroslav Benes
; +} +EXPORT_SYMBOL_GPL(klp_register_patch); Thank you again for good work! -- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ

Re: rcu_sched stall detected, but no state dump

2014-12-11 Thread Miroslav Benes
On Wed, 10 Dec 2014, Paul E. McKenney wrote: On Wed, Dec 10, 2014 at 01:52:02PM +0100, Miroslav Benes wrote: Hi, today I came across RCU stall which was correctly detected, but there is no state dump. This is a bit suspicious, I think. This is the output in serial console

Re: rcu_sched stall detected, but no state dump

2014-12-12 Thread Miroslav Benes
On Thu, 11 Dec 2014, Paul E. McKenney wrote: On Thu, Dec 11, 2014 at 08:50:10AM -0800, Paul E. McKenney wrote: On Thu, Dec 11, 2014 at 10:35:15AM +0100, Miroslav Benes wrote: On Wed, 10 Dec 2014, Paul E. McKenney wrote: On Wed, Dec 10, 2014 at 01:52:02PM +0100, Miroslav Benes wrote

Re: [PATCHv6 2/3] kernel: add support for live patching

2014-12-12 Thread Miroslav Benes
Hi, I think we are really close (or I hope so). I found few suspicious things or nitpicks though. They might have applied also to v5, but I didn't manage to look at that. Sorry about that. On Wed, 10 Dec 2014, Josh Poimboeuf wrote: +/* klp_mutex must be held by caller */ +static bool

Re: [PATCHv2 2/3] kernel: add support for live patching

2014-11-18 Thread Miroslav Benes
at the end of the function header in #else branch. Regards, --- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read

Re: [PATCHv4 2/3] kernel: add support for live patching

2014-12-02 Thread Miroslav Benes
On Mon, 1 Dec 2014, Josh Poimboeuf wrote: On Mon, Dec 01, 2014 at 02:31:35PM +0100, Miroslav Benes wrote: On Wed, 26 Nov 2014, Josh Poimboeuf wrote: Hi Miroslav, Just addressing one of your comments below. I'll let Seth respond to the others :-) On Wed, Nov 26, 2014

Re: [PATCHv4 2/3] kernel: add support for live patching

2014-12-03 Thread Miroslav Benes
0e925c303acf8b596ba8941417e1c3991cdb0adc Mon Sep 17 00:00:00 2001 From: Miroslav Benes mbe...@suse.cz Date: Tue, 2 Dec 2014 14:34:21 +0100 Subject: [PATCH] Restructure of klp_init_* functions Structure of klp_init_{patch|objects|funcs} functions could be a bit hard to read. We can move the loops

Re: rcu_sched stall detected, but no state dump

2014-12-19 Thread Miroslav Benes
On Mon, 15 Dec 2014, Miroslav Benes wrote: On Fri, 12 Dec 2014, Paul E. McKenney wrote: On Fri, Dec 12, 2014 at 03:06:20PM +0100, Miroslav Benes wrote: [...] One last thing. Is there a reason that there is not any similar INFO in the console for tiny implementation? I enabled

Re: rcu_sched stall detected, but no state dump

2014-12-22 Thread Miroslav Benes
On Fri, 19 Dec 2014, Paul E. McKenney wrote: On Fri, Dec 19, 2014 at 12:09:48PM +0100, Miroslav Benes wrote: On Mon, 15 Dec 2014, Miroslav Benes wrote: On Fri, 12 Dec 2014, Paul E. McKenney wrote: On Fri, Dec 12, 2014 at 03:06:20PM +0100, Miroslav Benes wrote

Re: rcu_sched stall detected, but no state dump

2014-12-15 Thread Miroslav Benes
On Fri, 12 Dec 2014, Paul E. McKenney wrote: On Fri, Dec 12, 2014 at 03:06:20PM +0100, Miroslav Benes wrote: On Thu, 11 Dec 2014, Paul E. McKenney wrote: On Thu, Dec 11, 2014 at 08:50:10AM -0800, Paul E. McKenney wrote: On Thu, Dec 11, 2014 at 10:35:15AM +0100, Miroslav Benes wrote

Re: [PATCHv7 1/3] kernel: add TAINT_LIVEPATCH

2014-12-17 Thread Miroslav Benes
patch module will appear beside the patched function in the backtrace. Signed-off-by: Seth Jennings sjenn...@redhat.com Reviewed-by: Miroslav Benes mbe...@suse.cz Thanks, -- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body

Re: [PATCHv7 3/3] samples: add sample live patching module

2014-12-17 Thread Miroslav Benes
On Tue, 16 Dec 2014, Seth Jennings wrote: Add a sample live patching module. Signed-off-by: Seth Jennings sjenn...@redhat.com Reviewed-by: Miroslav Benes mbe...@suse.cz Thanks, -- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body

Re: [PATCHv7 2/3] kernel: add support for live patching

2014-12-17 Thread Miroslav Benes
-by: Miroslav Benes mbe...@suse.cz and for the rest Reviewed-by: Miroslav Benes mbe...@suse.cz Thanks. Great work! -- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH] livepatch: clean up klp_find_object_module() usage: was: Re: [PATCHv4 2/3] kernel: add support for live patching

2014-12-01 Thread Miroslav Benes
On Fri, 28 Nov 2014, Petr Mladek wrote: On Fri 2014-11-28 18:07:37, Petr Mladek wrote: On Tue 2014-11-25 11:15:08, Seth Jennings wrote: This commit introduces code for the live patching core. It implements an ftrace-based mechanism and kernel interface for doing live patching of

Re: [PATCHv4 2/3] kernel: add support for live patching

2014-12-01 Thread Miroslav Benes
On Wed, 26 Nov 2014, Josh Poimboeuf wrote: Hi Miroslav, Just addressing one of your comments below. I'll let Seth respond to the others :-) On Wed, Nov 26, 2014 at 03:19:17PM +0100, Miroslav Benes wrote: +/** + * struct klp_func - function structure for live patching

rcu_sched stall detected, but no state dump

2014-12-10 Thread Miroslav Benes
behaviour I could try to find a good kernel release and bisect it. Best regards, -- Miroslav Benes SUSE Labs#include linux/module.h #include linux/kernel.h #include linux/kthread.h #include linux/delay.h static struct task_struct *test_thread; static int test_thread_fn(void *data) { while (1

[PATCH] livepatch: change ARCH_HAVE_LIVE_PATCHING to HAVE_LIVE_PATCHING

2015-01-20 Thread Miroslav Benes
Change ARCH_HAVE_LIVE_PATCHING to HAVE_LIVE_PATCHING in Kconfigs. HAVE_ bools are prevalent there and we should go with the flow. Suggested-by: Andrew Morton a...@linux-foundation.org Signed-off-by: Miroslav Benes mbe...@suse.cz --- arch/x86/Kconfig | 2 +- kernel/livepatch/Kconfig | 4

Re: [PATCH] livepatch: support for repatching a function

2015-01-20 Thread Miroslav Benes
of the changelog above). Maybe it is useless now but the code is going to get complicated and it costs nothing... Otherwise it looks ok to me (except for thing mentioned by Jiri). Thank you -- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body

Re: [PATCH 1/2] livepatch: Revert livepatch: enforce patch stacking semantics

2015-01-22 Thread Miroslav Benes
... Yes, but in such situation you can unregister patch1 and proceed with new live patch. No problem. As Jiri has already written. Or are we missing something? Regards, -- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message

Re: [PATCH] livepatch: fix uninitialized return value

2015-01-21 Thread Miroslav Benes
On Tue, 20 Jan 2015, Josh Poimboeuf wrote: Fix a potentially uninitialized return value. Signed-off-by: Josh Poimboeuf jpoim...@redhat.com Reviewed-by: Miroslav Benes mbe...@suse.cz --- kernel/livepatch/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel

Re: [RFC PATCH 6/9] livepatch: create per-task consistency model

2015-02-11 Thread Miroslav Benes
On Tue, 10 Feb 2015, Josh Poimboeuf wrote: On Tue, Feb 10, 2015 at 04:59:17PM +0100, Miroslav Benes wrote: On Mon, 9 Feb 2015, Josh Poimboeuf wrote: Add a basic per-task consistency model. This is the foundation which will eventually enable us to patch those ~10% of security

Re: [RFC PATCH 6/9] livepatch: create per-task consistency model

2015-02-10 Thread Miroslav Benes
On Mon, 9 Feb 2015, Josh Poimboeuf wrote: Add a basic per-task consistency model. This is the foundation which will eventually enable us to patch those ~10% of security patches which change function prototypes and/or data semantics. When a patch is enabled, livepatch enters into a

Re: [RFC PATCH 8/9] livepatch: allow patch modules to be removed

2015-02-16 Thread Miroslav Benes
On Fri, 13 Feb 2015, Josh Poimboeuf wrote: On Fri, Feb 13, 2015 at 05:17:10PM +0100, Miroslav Benes wrote: On Fri, 13 Feb 2015, Josh Poimboeuf wrote: Hm, even with Jiri Slaby's suggested fix to add the completion to the unregister path, I still get a lockdep warning. This looks more

Re: [RFC PATCH 6/9] livepatch: create per-task consistency model

2015-02-12 Thread Miroslav Benes
On Wed, 11 Feb 2015, Josh Poimboeuf wrote: On Wed, Feb 11, 2015 at 11:21:51AM +0100, Miroslav Benes wrote: On Mon, 9 Feb 2015, Josh Poimboeuf wrote: [...] @@ -38,14 +39,34 @@ static void notrace klp_ftrace_handler(unsigned long ip, ops = container_of(fops, struct klp_ops

Re: [RFC PATCH 6/9] livepatch: create per-task consistency model

2015-02-17 Thread Miroslav Benes
On Tue, 17 Feb 2015, Josh Poimboeuf wrote: On Mon, Feb 16, 2015 at 03:19:10PM +0100, Miroslav Benes wrote: On Mon, 9 Feb 2015, Josh Poimboeuf wrote: [...] + +void klp_unpatch_objects(struct klp_patch *patch) +{ + struct klp_object *obj; + + for (obj = patch-objs; obj

Re: [RFC PATCH 8/9] livepatch: allow patch modules to be removed

2015-02-17 Thread Miroslav Benes
On Tue, 17 Feb 2015, Josh Poimboeuf wrote: On Mon, Feb 16, 2015 at 05:06:15PM +0100, Miroslav Benes wrote: On Fri, 13 Feb 2015, Josh Poimboeuf wrote: On Fri, Feb 13, 2015 at 05:17:10PM +0100, Miroslav Benes wrote: On Fri, 13 Feb 2015, Josh Poimboeuf wrote: Hm, even with Jiri

Re: [RFC PATCH 6/9] livepatch: create per-task consistency model

2015-02-16 Thread Miroslav Benes
On Mon, 9 Feb 2015, Josh Poimboeuf wrote: Add a basic per-task consistency model. This is the foundation which will eventually enable us to patch those ~10% of security patches which change function prototypes and/or data semantics. When a patch is enabled, livepatch enters into a

Re: [RFC PATCH 6/9] livepatch: create per-task consistency model

2015-02-18 Thread Miroslav Benes
On Wed, 18 Feb 2015, Josh Poimboeuf wrote: On Wed, Feb 18, 2015 at 01:42:56PM +0100, Miroslav Benes wrote: On Tue, 17 Feb 2015, Josh Poimboeuf wrote: On Tue, Feb 17, 2015 at 04:48:39PM +0100, Miroslav Benes wrote: On Tue, 17 Feb 2015, Josh Poimboeuf wrote: On Mon, Feb 16

[PATCH] livepatch: remove extern specifier from header files

2015-02-18 Thread Miroslav Benes
Storage-class specifier 'extern' is redundant in front of the function declaration. According to the C specification it has the same meaning as if not present at all. So remove it. Signed-off-by: Miroslav Benes mbe...@suse.cz --- arch/x86/include/asm/livepatch.h | 4 ++-- include/linux

Re: [RFC PATCH 6/9] livepatch: create per-task consistency model

2015-02-18 Thread Miroslav Benes
On Tue, 17 Feb 2015, Josh Poimboeuf wrote: On Tue, Feb 17, 2015 at 04:48:39PM +0100, Miroslav Benes wrote: On Tue, 17 Feb 2015, Josh Poimboeuf wrote: On Mon, Feb 16, 2015 at 03:19:10PM +0100, Miroslav Benes wrote: and externs for functions are redundant. I agree

[PATCH RFC tip/perf/core] ftrace/x86: Let dynamic trampolines call ops-func even for dynamic fops

2015-02-19 Thread Miroslav Benes
are not allowed for dynamic fops if CONFIG_PREEMPT=y. Signed-off-by: Miroslav Benes mbe...@suse.cz --- The patch is the result of my discussion with Steven few weeks ago [1]. I feel content with the outcome but not with the way. ftrace_ops_get_func is called at two different places now. One

Question about ftrace, dynamically allocated trampolines and dynamic fops

2015-01-29 Thread Miroslav Benes
? Even for nonpreemptive kernel and dynamic fops ftrace_ops_list_func has unnecessary overhead. I'm almost sure I must have missed something but I cannot see what. Could you point me at the right direction? Thanks a lot in advance, -- Miroslav Benes SUSE Labs -- To unsubscribe from this list: send

Re: [RFC PATCH 2/9] livepatch: separate enabled and patched states

2015-02-13 Thread Miroslav Benes
On Mon, 9 Feb 2015, Josh Poimboeuf wrote: Once we have a consistency model, patches and their objects will be enabled and disabled at different times. For example, when a patch is disabled, its loaded objects' funcs can remain registered with ftrace indefinitely until the unpatching

Re: [RFC PATCH 3/9] livepatch: move patching functions into patch.c

2015-02-13 Thread Miroslav Benes
On Mon, 9 Feb 2015, Josh Poimboeuf wrote: Move functions related to the actual patching of functions and objects into a new patch.c file. I am definitely for splitting the code to several different files. Otherwise it would be soon unmanageable. However I don't know if this patch is the best

Re: [RFC PATCH 0/9] livepatch: consistency model

2015-02-13 Thread Miroslav Benes
On Fri, 13 Feb 2015, Jiri Kosina wrote: On Fri, 13 Feb 2015, Josh Poimboeuf wrote: How about we take a slightly different aproach -- put a probe (or ftrace) on __switch_to() during a klp transition period, and examine stacktraces for tasks that are just about to start running from

Re: [RFC PATCH 2/9] livepatch: separate enabled and patched states

2015-02-13 Thread Miroslav Benes
On Fri, 13 Feb 2015, Josh Poimboeuf wrote: On Fri, Feb 13, 2015 at 01:57:38PM +0100, Miroslav Benes wrote: On Mon, 9 Feb 2015, Josh Poimboeuf wrote: Once we have a consistency model, patches and their objects will be enabled and disabled at different times. For example, when a patch

Re: [RFC PATCH 8/9] livepatch: allow patch modules to be removed

2015-02-13 Thread Miroslav Benes
On Fri, 13 Feb 2015, Josh Poimboeuf wrote: On Thu, Feb 12, 2015 at 04:22:24PM +0100, Miroslav Benes wrote: On Tue, 10 Feb 2015, Jiri Slaby wrote: On 02/09/2015, 06:31 PM, Josh Poimboeuf wrote: --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c ... @@ -497,10

Re: [RFC PATCH 6/9] livepatch: create per-task consistency model

2015-02-11 Thread Miroslav Benes
On Mon, 9 Feb 2015, Josh Poimboeuf wrote: [...] @@ -38,14 +39,34 @@ static void notrace klp_ftrace_handler(unsigned long ip, ops = container_of(fops, struct klp_ops, fops); rcu_read_lock(); + func = list_first_or_null_rcu(ops-func_stack, struct klp_func,

Re: [RFC PATCH 8/9] livepatch: allow patch modules to be removed

2015-02-12 Thread Miroslav Benes
On Tue, 10 Feb 2015, Jiri Slaby wrote: On 02/09/2015, 06:31 PM, Josh Poimboeuf wrote: --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c ... @@ -497,10 +500,6 @@ static struct attribute *klp_patch_attrs[] = { static void klp_kobj_release_patch(struct kobject *kobj) {

Re: [RFC PATCH 1/9] livepatch: simplify disable error path

2015-02-13 Thread Miroslav Benes
stack. Signed-off-by: Josh Poimboeuf jpoim...@redhat.com This makes sense, so Reviewed-by: Miroslav Benes mbe...@suse.cz I think this patch could be taken independently of the consistency model. If no one else has any objection... Miroslav --- kernel/livepatch/core.c | 67

Re: [PATCH RFC tip/perf/core] ftrace/x86: Let dynamic trampolines call ops-func even for dynamic fops

2015-03-05 Thread Miroslav Benes
On Thu, 5 Mar 2015, Steven Rostedt wrote: On Thu, 5 Mar 2015 16:56:43 +0100 (CET) Miroslav Benes mbe...@suse.cz wrote: I don't know if you plan to do something about this patch or if you just missed it in your e-mail pile. Should I resend it or have you already scratched

Re: [PATCH RFC tip/perf/core] ftrace/x86: Let dynamic trampolines call ops-func even for dynamic fops

2015-03-05 Thread Miroslav Benes
On Thu, 19 Feb 2015, Miroslav Benes wrote: Dynamically allocated trampolines call ftrace_ops_get_func to get the function which they should call. For dynamic fops (FTRACE_OPS_FL_DYNAMIC flag is set) ftrace_ops_list_func is always returned. This is reasonable for static trampolines but goes

Re: Question about ftrace, dynamically allocated trampolines and dynamic fops

2015-01-30 Thread Miroslav Benes
On Thu, 29 Jan 2015, Steven Rostedt wrote: On Thu, 29 Jan 2015 10:40:58 +0100 (CET) Miroslav Benes mbe...@suse.cz wrote: Hi, solving a possible race condition in kGraft and thinking about the same in klp live patching I looked quite a lot at ftrace code. One thing about recent

Re: [PATCH RFC tip/perf/core] ftrace/x86: Let dynamic trampolines call ops-func even for dynamic fops

2015-04-02 Thread Miroslav Benes
On Thu, 5 Mar 2015, Steven Rostedt wrote: On Thu, 5 Mar 2015 16:56:43 +0100 (CET) Miroslav Benes mbe...@suse.cz wrote: I don't know if you plan to do something about this patch or if you just missed it in your e-mail pile. Should I resend it or have you already scratched

Re: [PATCH RFC tip/perf/core] ftrace/x86: Let dynamic trampolines call ops-func even for dynamic fops

2015-04-03 Thread Miroslav Benes
On Thu, 2 Apr 2015, Steven Rostedt wrote: On Thu, 2 Apr 2015 13:11:16 +0200 (CEST) Miroslav Benes mbe...@suse.cz wrote: On Thu, 5 Mar 2015, Steven Rostedt wrote: On Thu, 5 Mar 2015 16:56:43 +0100 (CET) Miroslav Benes mbe...@suse.cz wrote: I don't know if you plan to do

[PATCH] x86/kaslr: Fix typo in documentation

2015-04-14 Thread Miroslav Benes
Documentation/x86/boot.txt labels the bit in boot_params.hdr.loadflags as ALSR_FLAG while it should be KASLR_FLAG. Signed-off-by: Miroslav Benes mbe...@suse.cz --- Documentation/x86/boot.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/x86/boot.txt b

Re: [PATCH 2/2] livepatch: Fix the bug if the function name is larger than KSYM_NAME_LEN-1

2015-04-27 Thread Miroslav Benes
On Sun, 26 Apr 2015, Minfei Huang wrote: On 04/15/15 at 01:58P, Miroslav Benes wrote: On Wed, 15 Apr 2015, Minfei Huang wrote: On 04/15/15 at 10:30P, Miroslav Benes wrote: On Wed, 15 Apr 2015, Minfei Huang wrote: Yes, the function name can be changed, before the extra

Re: [RFC kgr on klp 9/9] livepatch: send a fake signal to all tasks

2015-05-06 Thread Miroslav Benes
Hi, On Mon, 4 May 2015, Oleg Nesterov wrote: Well, I can't really comment this change because I didn't see other changes, and I do not know what klp_kgraft_task_in_progress() means... On 05/04, Jiri Slaby wrote: Luckily we can force the task to do that by sending it a fake signal,

Re: [PATCH] livepatch: Prevent to enable uninitialized patch

2015-05-11 Thread Miroslav Benes
*/ klp_module_notify_going(patch, obj); -- 2.2.2 -- To unsubscribe from this list: send the line unsubscribe live-patching in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- Miroslav Benes SUSE

Re: [PATCH] livepatch: Prevent to enable uninitialized patch

2015-05-12 Thread Miroslav Benes
On Mon, 11 May 2015, Minfei Huang wrote: On 05/11/15 at 02:02P, Miroslav Benes wrote: On Mon, 11 May 2015, Minfei Huang wrote: From: Minfei Huang minfei.hu...@hotmail.com The previous patches can be applied, while the corresponding module is loaded. Now the code cannot handle

Re: [PATCH v2] livepatch: Prevent livepatch to apply the uninitialized patch

2015-05-12 Thread Miroslav Benes
On Tue, 12 May 2015, Minfei Huang wrote: The previous patches can be applied, once the corresponding module is loaded. In general, the patch will do relocation (if necessary) and obtain/verify function address before we start to enable patch. In some case, the uninitialized patch can be

Re: [PATCH v4] livepatch: Prevent to apply the patch once coming module notifier fails

2015-05-14 Thread Miroslav Benes
Hi, I have few nitpicks... The subject is slightly misleading. We still apply the patch (or the patch is already applied to be precise). Only the coming module is not patched and won't be patched. So I propose something like livepatch: prevent patch inconsistencies if the coming module

Re: [PATCH v5] livepatch: Prevent patch inconsistencies if the coming module notifier fails

2015-05-15 Thread Miroslav Benes
, if the coming modified notifier fails. Signed-off-by: Minfei Huang mnfhu...@gmail.com Reviewed-by: Miroslav Benes mbe...@suse.cz Regards, Miroslav --- v4: - remove the label out in function klp_init_object_loaded v3: - modify the code style v2: - add the error message to make it more

Re: [PATCH 2/2] livepatch: Fix the bug if the function name is larger than KSYM_NAME_LEN-1

2015-04-15 Thread Miroslav Benes
On Wed, 15 Apr 2015, Minfei Huang wrote: On 04/15/15 at 10:30P, Miroslav Benes wrote: On Wed, 15 Apr 2015, Minfei Huang wrote: Yes, the function name can be changed, before the extra module is installed to the production system. We discuss around and around, there are still

Re: [PATCH 2/2] livepatch: Fix the bug if the function name is larger than KSYM_NAME_LEN-1

2015-04-15 Thread Miroslav Benes
On Wed, 15 Apr 2015, Minfei Huang wrote: On 04/14/15 at 08:41pm, Petr Mladek wrote: On Wed 2015-04-15 01:01:39, Minfei Huang wrote: On 04/14/15 at 06:27pm, Petr Mladek wrote: On Tue 2015-04-14 23:55:36, Minfei Huang wrote: On 04/14/15 at 10:11P, Josh Poimboeuf wrote: On Tue,

Re: [PATCH] livepatch: add module locking around kallsyms calls

2015-06-02 Thread Miroslav Benes
On Tue, 2 Jun 2015, Minfei Huang wrote: On Mon, Jun 1, 2015 at 11:48 PM, Miroslav Benes mbe...@suse.cz wrote: The list of loaded modules is walked through in module_kallsyms_on_each_symbol (called by kallsyms_on_each_symbol). The module_mutex lock should be acquired to prevent potential

Re: [rcu] INFO: rcu_sched stall on CPU (30000 ticks this GP) idle=140000000000001 (t=30000 jiffies q=1)

2015-06-15 Thread Miroslav Benes
Hi, On Mon, 15 Jun 2015, Fengguang Wu wrote: Greetings, 0day kernel testing robot got the below dmesg and the first bad commit is git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master commit ec1fe396ff42e240c9b32111ee53665c5916fe5e Author: Miroslav Benes mbe

Re: [PATCH] livepatch: add sysfs interface /sys/kernel/livepatch/state

2015-06-17 Thread Miroslav Benes
and your code rewritten without notice. The list of applied patches can be obtained just by 'ls /sys/kernel/livepatch' and their state is in enabled attribute in each respective patch (no, you cannot obtain the order in the stack). Thanks, Miroslav Benes SUSE Labs -- To unsubscribe from this list

Re: [PATCH] livepatch: add sysfs interface /sys/kernel/livepatch/state

2015-06-17 Thread Miroslav Benes
On Wed, 17 Jun 2015, Li Bin wrote: On 2015/6/17 16:13, Miroslav Benes wrote: On Wed, 17 Jun 2015, Li Bin wrote: The list of applied patches can be obtained just by 'ls /sys/kernel/livepatch' and their state is in enabled attribute in each respective patch (no, you cannot obtain

[PATCH] livepatch: add module locking around kallsyms calls

2015-06-01 Thread Miroslav Benes
0be964be0d45 (module: Sanitize RCU usage and locking) in recent next- trees. Signed-off-by: Miroslav Benes mbe...@suse.cz --- kernel/livepatch/core.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index e6c8d54

Re: [RFC PATCH 0/5] Arch-independent livepatch

2015-11-11 Thread Miroslav Benes
On Mon, 9 Nov 2015, Jessica Yu wrote: > This patchset removes livepatch's need for architecture-specific relocation > code by leveraging existing code in the module loader to perform > arch-dependent work. Specifically, instead of duplicating code and > re-implementing what the

Re: [RFC PATCH 2/5] module: save load_info for livepatch modules

2015-11-11 Thread Miroslav Benes
On Mon, 9 Nov 2015, Jessica Yu wrote: > diff --git a/include/linux/module.h b/include/linux/module.h > index 3a19c79..c8680b1 100644 > --- a/include/linux/module.h > +++ b/include/linux/module.h [...] > +#ifdef CONFIG_LIVEPATCH > +extern void klp_prepare_patch_module(struct module *mod, > +

Re: [RFC PATCH 3/5] livepatch: reuse module loader code to write relocations

2015-11-11 Thread Miroslav Benes
On Mon, 9 Nov 2015, Jessica Yu wrote: > diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h > index 31db7a0..601e892 100644 > --- a/include/linux/livepatch.h > +++ b/include/linux/livepatch.h > @@ -85,7 +85,7 @@ struct klp_reloc { > /** > * struct klp_object - kernel object

Re: [PATCH v3] livepatch: old_name,number scheme in livepatch sysfs directory

2015-11-10 Thread Miroslav Benes
On Mon, 9 Nov 2015, Josh Poimboeuf wrote: > On Mon, Nov 09, 2015 at 05:01:18PM -0600, Chris J Arges wrote: > > On 11/09/2015 02:56 PM, Josh Poimboeuf wrote: > > > I'd recommend splitting this up into two separate patches: > > > > > > 1. introduce old_sympos > > > 2. change the sysfs interface >

Re: [PATCH v3] livepatch: old_name,number scheme in livepatch sysfs directory

2015-11-10 Thread Miroslav Benes
On Mon, 9 Nov 2015, Chris J Arges wrote: > In cases of duplicate symbols in vmlinux, old_sympos will be used to > disambiguate instead of old_addr. Normally old_sympos will be 0, and > default to only returning the first found instance of that symbol. If an > incorrect symbol position is

Re: samples: livepatch: init reloc list and mark as klp module

2015-11-12 Thread Miroslav Benes
On Thu, 12 Nov 2015, Jessica Yu wrote: > +++ Petr Mladek [11/11/15 16:42 +0100]: > > On Mon 2015-11-09 23:45:54, Jessica Yu wrote: > > > Intialize the list of relocation sections in the sample > > > klp_object (even if the list will be empty in this case). > > > Also mark module as a livepatch

Re: [PATCH 2/3 v4] livepatch: add old_sympos as disambiguator field to klp_reloc

2015-11-12 Thread Miroslav Benes
On Wed, 11 Nov 2015, Chris J Arges wrote: > In cases of duplicate symbols, sympos will be used to disambiguate instead > of val. By default old_sympos will be 0, and patching will only succeed if > the symbol is unique. Specifying a positive value will ensure that > occurrence of the symbol will

Re: [PATCH 1/3 v4] livepatch: add old_sympos as disambiguator field to klp_func

2015-11-12 Thread Miroslav Benes
Next to Josh's remarks I have some more (mainly nitpicks, so it is often up to you). On Wed, 11 Nov 2015, Chris J Arges wrote: > In cases of duplicate symbols, old_sympos will be used to disambiguate > instead of old_addr. By default old_sympos will be 0, and patching will > only succeed if

Re: module: save load_info for livepatch modules

2015-11-12 Thread Miroslav Benes
On Thu, 12 Nov 2015, Petr Mladek wrote: > On Thu 2015-11-12 00:33:12, Jessica Yu wrote: > > +++ Miroslav Benes [11/11/15 15:17 +0100]: > > >On Mon, 9 Nov 2015, Jessica Yu wrote: > > > > > >>diff --git a/include/linux/module.h b/include/linux/modul

Re: module: save load_info for livepatch modules

2015-11-12 Thread Miroslav Benes
On Thu, 12 Nov 2015, Petr Mladek wrote: > On Wed 2015-11-11 23:44:08, Jessica Yu wrote: > > +++ Petr Mladek [11/11/15 15:31 +0100]: > > >On Mon 2015-11-09 23:45:52, Jessica Yu wrote: > > >>diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > > >>index 6e53441..087a8c7 100644 > > >>---

Re: [PATCH 2/4 v5] livepatch: Simplify code for relocated external symbols

2015-11-13 Thread Miroslav Benes
On Thu, 12 Nov 2015, Chris J Arges wrote: > From: Petr Mladek > > The livepatch module might be linked from several .o files. > All symbols that need to be shared between these .o files > should be exported. This is a normal programming practice. > I do not see any reason to

Re: module: save load_info for livepatch modules

2015-11-16 Thread Miroslav Benes
On Fri, 13 Nov 2015, Jessica Yu wrote: > +++ Miroslav Benes [13/11/15 13:46 +0100]: > > On Fri, 13 Nov 2015, Miroslav Benes wrote: > > > > > As for load_info, I don't have a strong opinion whether to keep it for all > > > modules or for livepatch modules only

Re: module: save load_info for livepatch modules

2015-11-16 Thread Miroslav Benes
On Fri, 13 Nov 2015, Jessica Yu wrote: > +++ Miroslav Benes [13/11/15 13:56 +0100]: > > On Fri, 13 Nov 2015, Miroslav Benes wrote: > > > > > I agree this seems like the best approach. So if we preserve > > > mod_arch_syminfo (in case of s390) we should fre

Re: livepatch: reuse module loader code to write relocations

2015-11-12 Thread Miroslav Benes
On Wed, 11 Nov 2015, Jessica Yu wrote: > +++ Miroslav Benes [11/11/15 15:30 +0100]: > > On Mon, 9 Nov 2015, Jessica Yu wrote: > > > > So I guess we don't need klp_reloc anymore. > > Yes, that's correct. I am noticing just now that I forgot to remove > the kl

Re: [PATCH] x86/livepatch: Fix crash with !CONFIG_DEBUG_SET_MODULE_RONX

2015-11-03 Thread Miroslav Benes
On Mon, 2 Nov 2015, Josh Poimboeuf wrote: > When loading a patch module on a kernel with > !CONFIG_DEBUG_SET_MODULE_RONX, the following crash occurs: > > [ 205.988776] livepatch: enabling patch 'kpatch_meminfo_string' > [ 205.989829] BUG: unable to handle kernel paging request at >

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-03 Thread Miroslav Benes
On Mon, 2 Nov 2015, Chris J Arges wrote: [...] > +static int klp_get_func_pos_callback(void *data, const char *name, > + struct module *mod, unsigned long addr) > +{ > + struct klp_find_arg *args = data; > + > + if ((mod && !args->objname) || (!mod &&

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-03 Thread Miroslav Benes
On Mon, 2 Nov 2015, Chris J Arges wrote: > The following directory structure will allow for cases when the same > function name exists in a single object. > /sys/kernel/livepatch/// There is still a period here and in the documentation :) > The number corresponds to the nth occurrence of

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-05 Thread Miroslav Benes
On Wed, 4 Nov 2015, Josh Poimboeuf wrote: > On Wed, Nov 04, 2015 at 10:52:52AM +0100, Miroslav Benes wrote: > > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > > Object entry would be empty for not loaded object. I would not > > > > dare to propose to remove s

Re: [PATCH] livepatch: Cleanup page permission changes

2015-11-04 Thread Miroslav Benes
() for every iteration of the > loop in klp_write_object_relocations() is messy and inefficient. Change > all the RO pages to RW before the loop and convert them back to RO after > the loop. > > Suggested-by: Miroslav Benes <mbe...@suse.cz> > Signed-off-by: Josh Poimboeuf <jpoim...@redh

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-04 Thread Miroslav Benes
On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > On Tue, Nov 03, 2015 at 05:09:48PM +0100, Miroslav Benes wrote: > > On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > > > > > On Tue, Nov 03, 2015 at 11:52:08AM +0100, Miroslav Benes wrote: > > > > > > &g

Re: [PATCH v2] livepatch: old_name.number scheme in livepatch sysfs directory

2015-11-03 Thread Miroslav Benes
On Tue, 3 Nov 2015, Josh Poimboeuf wrote: > On Tue, Nov 03, 2015 at 11:52:08AM +0100, Miroslav Benes wrote: > > On Mon, 2 Nov 2015, Chris J Arges wrote: > > > > [...] > > > > > +static int klp_get_func_pos_callback(void *data, const char *name, > >

Re: [PATCH 1/4 v5] livepatch: add old_sympos as disambiguator field to klp_func

2015-11-13 Thread Miroslav Benes
On Thu, 12 Nov 2015, Chris J Arges wrote: > diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h > index 31db7a0..3d18dff 100644 > --- a/include/linux/livepatch.h > +++ b/include/linux/livepatch.h > @@ -37,8 +37,9 @@ enum klp_state { > * struct klp_func - function structure for

Re: module: save load_info for livepatch modules

2015-11-13 Thread Miroslav Benes
On Thu, 12 Nov 2015, Jessica Yu wrote: > +++ Josh Poimboeuf [12/11/15 11:05 -0600]: > > On Thu, Nov 12, 2015 at 04:03:45PM +0100, Petr Mladek wrote: > > > On Thu 2015-11-12 14:22:28, Miroslav Benes wrote: > > > > On Thu, 12 Nov 2015, Petr Mladek wrote: > > &

Re: module: save load_info for livepatch modules

2015-11-13 Thread Miroslav Benes
On Fri, 13 Nov 2015, Jessica Yu wrote: > +++ Miroslav Benes [12/11/15 15:19 +0100]: > > On Thu, 12 Nov 2015, Petr Mladek wrote: > > > > > On Wed 2015-11-11 23:44:08, Jessica Yu wrote: > > > > +++ Petr Mladek [11/11/15 15:31 +0100]: > > > &g

Re: livepatch: reuse module loader code to write relocations

2015-11-13 Thread Miroslav Benes
On Thu, 12 Nov 2015, Josh Poimboeuf wrote: > On Thu, Nov 12, 2015 at 03:22:44PM -0500, Jessica Yu wrote: > > Looking into this more, I think we do need one __klp_rela section per > > function being patched. Each rela section is linked to the section to > > which the relocations apply via the

Re: module: save load_info for livepatch modules

2015-11-13 Thread Miroslav Benes
On Fri, 13 Nov 2015, Miroslav Benes wrote: > As for load_info, I don't have a strong opinion whether to keep it for all > modules or for livepatch modules only. I have. We cannot keep it, even for livepatch modules... In info->hdr there is a temporary copy of the whole module (see in

Re: module: save load_info for livepatch modules

2015-11-13 Thread Miroslav Benes
On Fri, 13 Nov 2015, Miroslav Benes wrote: > I agree this seems like the best approach. So if we preserve > mod_arch_syminfo (in case of s390) we should free it not in > module_finalize, but somewhere in free_module... where > module_arch_cleanup() is called

Re: [PATCH 2/3 v9] livepatch: add sympos as disambiguator field to klp_reloc

2015-12-14 Thread Miroslav Benes
remove val, as it can be refactored as a > local variable in klp_write_object_relocations. > > Signed-off-by: Chris J Arges <chris.j.ar...@canonical.com> FWIW Reviewed-by: Miroslav Benes <mbe...@suse.cz> Miroslav -- To unsubscribe from this list: send the line &quo

Re: [PATCH] livepatch: fix race between enabled_store() and klp_unregister_patch()

2015-12-15 Thread Miroslav Benes
ril so here it is just for the sake of completeness. It is based on Jiri Slaby's kgraft consistency model for klp and it is maybe a superset, but you get the idea. -->8--- >From b854b3feac2883f5b0a17ea7a5c83b4389fcd6ad Mon Sep 17 00:00:00 2001 From: Miroslav Benes <mbe...@suse.cz>

Re: livepatch: reuse module loader code to write relocations

2015-12-16 Thread Miroslav Benes
On Wed, 16 Dec 2015, Jessica Yu wrote: > +++ Jessica Yu [09/12/15 14:10 -0500]: > > +++ Josh Poimboeuf [08/12/15 12:38 -0600]: > > > > > > There was a lot of discussion for v1, so I'm not sure, but I thought we > > > ended up deciding to get rid of the klp_reloc_sec struct? Instead I > > >

  1   2   3   4   5   6   7   8   9   10   >