Re: [PATCH 1/1] livepatch: Rename KLP_* to KLP_TRANSITION_*

2024-05-09 Thread Miroslav Benes
On Tue, 7 May 2024, zhangwar...@gmail.com wrote: > From: Wardenjohn > > The original macros of KLP_* is about the state of the transition. > Rename macros of KLP_* to KLP_TRANSITION_* to fix the confusing > description of klp transition state. > > Signed-off-by: Wardenjohn

Re: [PATCH v1 0/5] livepatch: klp-convert tool - Minimal version

2024-04-11 Thread Miroslav Benes
Hi, > > Summary of changes in this minimal version > > > > > > - rebase for v6.5 > > - cleaned-up SoB chains (suggested by pmladek) > > - klp-convert: remove the symbol map auto-resolving solution > > - klp-convert: add macro for flagging variables inside a LP src to be

Re: [ANNOUNCE and CfP] Live Patching MC at LPC 2023

2023-09-15 Thread Miroslav Benes
Hello, On Fri, 11 Aug 2023, Miroslav Benes wrote: > Hi, > > On Wed, 14 Jun 2023, Miroslav Benes wrote: > > > Hello, > > > > the Live Patching Microconference for Linux Plumbers Conference 2023 has > > been accepted. > > > > It is

Re: the qemu-nbd process automatically exit with the commit 43347d56c 'livepatch: send a fake signal to all blocking tasks'

2021-04-15 Thread Miroslav Benes
On Wed, 14 Apr 2021, Josef Bacik wrote: > On 4/14/21 11:21 AM, xiaojun.zhao...@gmail.com wrote: > > On Wed, 14 Apr 2021 13:27:43 +0200 (CEST) > > Miroslav Benes wrote: > > > >> Hi, > >> > >> On Wed, 14 Apr 2021, xiaojun.zhao...@gmail.com wrote:

Re: the qemu-nbd process automatically exit with the commit 43347d56c 'livepatch: send a fake signal to all blocking tasks'

2021-04-14 Thread Miroslav Benes
Hi, On Wed, 14 Apr 2021, xiaojun.zhao...@gmail.com wrote: > I found the qemu-nbd process(started with qemu-nbd -t -c /dev/nbd0 > nbd.qcow2) will automatically exit when I patched for functions of > the nbd with livepatch. > > The nbd relative source: > static int nbd_start_device_ioctl(struct

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-04-06 Thread Miroslav Benes
Hi, > > Driver developers will simply have to open code these protections. In > > light of what I see on LTP / fuzzing, I suspect the use case will grow > > and we'll have to revisit this in the future. But for now, sure, we can > > just open code the required protections everywhere to not crash

Re: [PATCH v3 00/16] x86,objtool: Optimize !RETPOLINE

2021-03-30 Thread Miroslav Benes
tely > rewritten, but it all seems to work nicely. Reviewed-by: Miroslav Benes for the objtool changes. All looks much better in this version. I have only one minor thing. There are only two call sites of elf_add_string(). The one in elf_create_section() passes shstrtab, the other one in e

[PATCH v2] livepatch: Replace the fake signal sending with TIF_NOTIFY_SIGNAL infrastructure

2021-03-29 Thread Miroslav Benes
ur bespoke solution with the generic one. Reviewed-by: Jens Axboe Reviewed-by: Petr Mladek Signed-off-by: Miroslav Benes --- v2: - #include from kernel/signal.c removed [Petr] kernel/livepatch/transition.c | 5 ++--- kernel/signal.c | 4 +--- 2 files changed, 3 insertions(+), 6

[PATCH] livepatch: Replace the fake signal sending with TIF_NOTIFY_SIGNAL infrastructure

2021-03-26 Thread Miroslav Benes
ur bespoke solution with the generic one. Signed-off-by: Miroslav Benes --- Tested on x86_64, s390x and ppc64le archs. kernel/livepatch/transition.c | 5 ++--- kernel/signal.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/livepatch/transition.

Re: [PATCH] livepatch: klp_send_signal should treat PF_IO_WORKER like PF_KTHREAD

2021-03-26 Thread Miroslav Benes
On Thu, 25 Mar 2021, Jens Axboe wrote: > On 3/25/21 3:30 AM, Miroslav Benes wrote: > >> (PF_KTHREAD | PF_IO_WORKER) is open coded in soo many places maybe this is > >> a > >> silly question, but... > >> > >> If the livepatch code could

Re: [PATCH] livepatch: klp_send_signal should treat PF_IO_WORKER like PF_KTHREAD

2021-03-25 Thread Miroslav Benes
> (PF_KTHREAD | PF_IO_WORKER) is open coded in soo many places maybe this is a > silly question, but... > > If the livepatch code could use fake_signal_wake_up(), we could consolidate > the pattern in klp_send_signals() with the one in freeze_task(). Then there > would only one place for wake up

Re: [PATCH] livepatch: klp_send_signal should treat PF_IO_WORKER like PF_KTHREAD

2021-03-25 Thread Miroslav Benes
On Thu, 25 Mar 2021, Dong Kai wrote: > commit 15b2219facad ("kernel: freezer should treat PF_IO_WORKER like > PF_KTHREAD for freezing") is to fix the freezeing issue of IO threads > by making the freezer not send them fake signals. > > Here live patching consistency model call klp_send_signals

Re: [PATCH] docs: livepatch: Fix a typo

2021-03-25 Thread Miroslav Benes
On Thu, 25 Mar 2021, Bhaskar Chowdhury wrote: > On 10:05 Thu 25 Mar 2021, Miroslav Benes wrote: > >Hi, > > > >On Thu, 25 Mar 2021, Bhaskar Chowdhury wrote: > > > >> > >> s/varibles/variables/ > >> > >> Signed-off-by: Bhaskar Chowdh

Re: [PATCH] docs: livepatch: Fix a typo

2021-03-25 Thread Miroslav Benes
Hi, On Thu, 25 Mar 2021, Bhaskar Chowdhury wrote: > > s/varibles/variables/ > > Signed-off-by: Bhaskar Chowdhury > --- > Documentation/livepatch/shadow-vars.rst | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Documentation/livepatch/shadow-vars.rst >

Re: [PATCH v2 06/14] objtool: Fix static_call list generation

2021-03-22 Thread Miroslav Benes
> --- a/tools/objtool/check.c > +++ b/tools/objtool/check.c > @@ -1045,6 +1045,12 @@ static int add_call_destinations(struct > } else > insn->call_dest = reloc->sym; > > + if (insn->call_dest && insn->call_dest->static_call_tramp) { > +

Re: [PATCH 6/9] objtool: Add elf_create_undef_symbol()

2021-03-17 Thread Miroslav Benes
On Wed, 17 Mar 2021, Peter Zijlstra wrote: > On Wed, Mar 17, 2021 at 02:52:23PM +0100, Miroslav Benes wrote: > > > > + if (!elf_symbol_add(elf, sym, SHN_XINDEX)) { > > > + WARN("elf_symbol_add"); > > > + return NULL; > > > + }

Re: [PATCH 6/9] objtool: Add elf_create_undef_symbol()

2021-03-17 Thread Miroslav Benes
[ also correcting my e-mail address ] On Fri, 12 Mar 2021, Peter Zijlstra wrote: Just a remark regarding SHN_XINDEX... > +static bool elf_symbol_add(struct elf *elf, struct symbol *sym, Elf32_Word > shndx) > +{ > + struct list_head *entry; > + struct rb_node *pnode; > + > +

Re: [PATCH -tip 3/5] kprobes: treewide: Remove trampoline_address from kretprobe_trampoline_handler()

2021-03-10 Thread Miroslav Benes
Hi Masami, > --- a/include/linux/kprobes.h > +++ b/include/linux/kprobes.h > @@ -205,15 +205,23 @@ extern void arch_prepare_kretprobe(struct > kretprobe_instance *ri, > struct pt_regs *regs); > extern int arch_trampoline_kprobe(struct kprobe *p); > > +void

Re: [PATCH RFC] MIPS: livepatch: Add LIVEPATCH basic code

2021-03-10 Thread Miroslav Benes
Hi, I cannot really comment on mips arch specifics but few words from the live patching perspective. On Mon, 1 Mar 2021, Jinyang He wrote: > Add the basic code of livepatch. livepatch is temporarily unavailable. > Two core functions are missing, one is DYNAMIC_FTRACE_WITH_REGS, and > another

Re: [PATCH 0/2] x86/unwind/orc: Handle missing ORC data better

2021-02-24 Thread Miroslav Benes
y missing ORC data > > arch/x86/kernel/unwind_orc.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) I apologize for a really late reply. It seems it has not been merged yet, so Reviewed-by: Miroslav Benes M

Re: [PATCH] module: potential uninitialized return in module_kallsyms_on_each_symbol()

2021-02-10 Thread Miroslav Benes
67cf78 ("kallsyms: refactor {,module_}kallsyms_on_each_symbol") > Signed-off-by: Dan Carpenter Reviewed-by: Miroslav Benes M

Re: [PATCH v2 0/3] objtool: Support the stack swizzle

2021-02-09 Thread Miroslav Benes
. > > - rebased to tip/objtool/core I haven't tested it, but it all looks good to me. Reviewed-by: Miroslav Benes M

Re: [GIT PULL] x86/urgent for v5.11-rc7

2021-02-09 Thread Miroslav Benes
On Tue, 9 Feb 2021, Steven Rostedt wrote: > On Tue, 9 Feb 2021 09:32:34 +0100 (CET) > Miroslav Benes wrote: > > > powerpc has this > > > > static inline unsigned long klp_get_ftrace_l

Re: [GIT PULL] x86/urgent for v5.11-rc7

2021-02-09 Thread Miroslav Benes
On Mon, 8 Feb 2021, Steven Rostedt wrote: > On Mon, 8 Feb 2021 16:47:05 +0100 > Peter Zijlstra wrote: > > > > /* > > > * Convert a function address into the appropriate ftrace location. > > > * > > > * Usually this is just the address of the function, but on some > > > architectures > > >

Re: [PATCH 10/13] module: pass struct find_symbol_args to find_symbol

2021-02-03 Thread Miroslav Benes
mbol_args to find_symbol > > Simplify the calling convention by passing the find_symbol_args structure > to find_symbol instead of initializing it inside the function. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 08/13] module: remove each_symbol_in_section

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > each_symbol_in_section just contains a trivial loop over its arguments. > Just open code the loop in the two callers. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 09/13] module: merge each_symbol_section into find_symbol

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > each_symbol_section is only called by find_symbol, so merge the two > functions. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 10/13] module: pass struct find_symbol_args to find_symbol

2021-02-02 Thread Miroslav Benes
> void *__symbol_get(const char *symbol) > { > - struct module *owner; > - const struct kernel_symbol *sym; > + struct find_symbol_arg fsa = { > + .name = symbol, > + .gplok = true, > + .warn = true, > + }; > > preempt_disable(); >

Re: [PATCH 13/13] module: remove EXPORT_UNUSED_SYMBOL*

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the > unused functionality as we generally just remove unused code anyway. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 12/13] module: remove EXPORT_SYMBOL_GPL_FUTURE

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > As far as I can tell this has never been used at all, and certainly > not any time recently. Right, I've always wondered about this one. > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 11/13] module: move struct symsearch to module.c

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > struct symsearch is only used inside of module.h, so move the definition > out of module.h. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 07/13] module: mark module_mutex static

2021-02-02 Thread Miroslav Benes
-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 06/13] kallsyms: only build {,module_}kallsyms_on_each_symbol when required

2021-02-02 Thread Miroslav Benes
On Tue, 2 Feb 2021, Christoph Hellwig wrote: > kallsyms_on_each_symbol and module_kallsyms_on_each_symbol are only used > by the livepatching code, so don't build them if livepatching is not > enabled. > > Signed-off-by: Christoph Hellwig Reviewed-by: Miroslav Benes M

Re: [PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol

2021-02-02 Thread Miroslav Benes
On Mon, 1 Feb 2021, Christoph Hellwig wrote: > On Mon, Feb 01, 2021 at 02:37:12PM +0100, Miroslav Benes wrote: > > > > This change is not needed. (objname == NULL) means that we are > > > > interested only in symbols in "vmlinux". > > > > > &g

Re: [PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol

2021-02-01 Thread Miroslav Benes
One more thing... > @@ -4379,8 +4379,7 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, > const char *, > unsigned int i; > int ret; > > - module_assert_mutex(); > - > + mutex_lock(_mutex); > list_for_each_entry(mod, , list) { > /* We hold

Re: [PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol

2021-02-01 Thread Miroslav Benes
On Mon, 1 Feb 2021, Christoph Hellwig wrote: > On Fri, Jan 29, 2021 at 10:43:36AM +0100, Petr Mladek wrote: > > > --- a/kernel/livepatch/core.c > > > +++ b/kernel/livepatch/core.c > > > @@ -164,12 +164,8 @@ static int klp_find_object_symbol(const char > > > *objname, const char *name, > > >

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-02-01 Thread Miroslav Benes
On Mon, 1 Feb 2021, Jessica Yu wrote: > +++ Miroslav Benes [29/01/21 16:29 +0100]: > >On Thu, 28 Jan 2021, Christoph Hellwig wrote: > > > >> Allow for a RCU-sched critical section around find_module, following > >> the lower level find_module_all helper, and sw

Re: [PATCH] stacktrace: Move documentation for arch_stack_walk_reliable() to header

2021-01-27 Thread Miroslav Benes
mas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: "H. Peter Anvin" > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: Christian Borntraeger > Cc: Josh Poimboeuf > Cc: Jiri Kosina > Cc: Miroslav Benes > Cc: Petr Mladek > Cc: Joe Lawrence >

Re: [PATCH v6 0/2] Documentation: livepatch: Document reliable stacktrace and minor cleanup

2021-01-27 Thread Miroslav Benes
trace.rst | 309 ++ > 4 files changed, 313 insertions(+), 22 deletions(-) > create mode 100644 Documentation/livepatch/reliable-stacktrace.rst sorry for the late reply (slowly crawling through my email backlog). Thanks a lot for putting this together! FWIW (so it is at least archived in the thread) Acked-by: Miroslav Benes M

Re: [PATCH] objtool: Don't fail the kernel build on fatal errors

2021-01-15 Thread Miroslav Benes
ooking for objtool warnings than > ever before, so such warnings not likely to be ignored for long. > > Suggested-by: Nick Desaulniers > Signed-off-by: Josh Poimboeuf Reviewed-by: Miroslav Benes M

Re: [PATCH] objtool: Don't fail on missing symbol table

2021-01-15 Thread Miroslav Benes
t; Signed-off-by: Josh Poimboeuf Reviewed-by: Miroslav Benes with the note below. > --- > tools/objtool/elf.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c > index be89c741ba9a..2b0f4f52f7b5 1

Re: [PATCH 3/3] objtool: Support stack layout changes in alternatives

2021-01-08 Thread Miroslav Benes
> That comment is indeed now obsolete. I can squash something like so: > > diff --git a/tools/objtool/check.c b/tools/objtool/check.c > index 81d56fdef1c3..ce67437aaf3f 100644 > --- a/tools/objtool/check.c > +++ b/tools/objtool/check.c > @@ -958,21 +958,8 @@ static int

Re: [PATCH 3/3] objtool: Support stack layout changes in alternatives

2021-01-07 Thread Miroslav Benes
On Tue, 22 Dec 2020, Josh Poimboeuf wrote: > BTW, another benefit of these changes is that, thanks to some related > cleanups (new fake nops and alt_group struct) objtool can finally be rid > of fake jumps, which were a constant source of headaches. \o/ You may also want to remove/edit the

Re: [PATCH] objtool: Fix seg fault with Clang non-section symbols

2020-12-16 Thread Miroslav Benes
wed-by: Nick Desaulniers > Link: https://github.com/ClangBuiltLinux/linux/issues/1207 > Signed-off-by: Josh Poimboeuf Reviewed-by: Miroslav Benes M

Re: [PATCH 3/3 v6] livepatch: Use the default ftrace_ops instead of REGS when ARGS is available

2020-11-13 Thread Miroslav Benes
> diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h > index e00fe88146e0..7c9474d52060 100644 > --- a/arch/x86/include/asm/ftrace.h > +++ b/arch/x86/include/asm/ftrace.h > @@ -54,6 +54,9 @@ arch_ftrace_get_regs(struct ftrace_regs *fregs) > return NULL; >

Re: [PATCH 07/11 v3] livepatch: Trigger WARNING if livepatch function fails due to recursion

2020-11-06 Thread Miroslav Benes
he old unpatched function will be called > placing the system into an unknown state. > > Link: https://lore.kernel.org/r/20201029145709.GD16774@alley > > Cc: Josh Poimboeuf > Cc: Jiri Kosina > Cc: Joe Lawrence > Cc: live-patch...@vger.kernel.org > Suggested-by: Miroslav Benes

Re: [PATCH 06/11 v3] livepatch/ftrace: Add recursion protection to the ftrace callback

2020-11-06 Thread Miroslav Benes
28115613.291169...@goodmis.org > > Cc: Masami Hiramatsu > Cc: Andrew Morton > Cc: Josh Poimboeuf > Cc: Jiri Kosina > Cc: Miroslav Benes > Cc: Joe Lawrence > Cc: live-patch...@vger.kernel.org > Reviewed-by: Petr Mladek > Signed-off-by: Steven Rostedt (VMware) Acked-by: Miroslav Benes M

Re: [PATCH v2 0/3] module: refactor module_sig_check()

2020-11-04 Thread Miroslav Benes
ule: avoid *goto*s in module_sig_check() > [3/3] module: only handle errors with the *switch* statement in > module_sig_check() Reviewed-by: Miroslav Benes M

Re: [RFC][PATCH 3/3 v3] livepatching: Use the default ftrace_ops instead of REGS when ARGS is available

2020-10-30 Thread Miroslav Benes
ed my tests too and the patch looks good to me, so Acked-by: Miroslav Benes M > Signed-off-by: Steven Rostedt (VMware) > --- > arch/powerpc/include/asm/livepatch.h | 4 +++- > arch/s390/include/asm/livepatch.h| 5 - > arch/x86/include/asm/ftrace.h| 3 +++ > arch/x

Re: [PATCH 6/9] livepatch/ftrace: Add recursion protection to the ftrace callback

2020-10-30 Thread Miroslav Benes
> > > > + bit = ftrace_test_recursion_trylock(); > > > > + if (bit < 0) > > > > + return; > > > > > > This means that the original function will be called in case of > > > recursion. > > > That's probably fair, but I'm wondering if we should at least WARN about > >

Re: [PATCH 1/9] ftrace: Move the recursion testing into global headers

2020-10-30 Thread Miroslav Benes
Hi, > +static __always_inline int trace_get_context_bit(void) > +{ > + int bit; > + > + if (in_interrupt()) { > + if (in_nmi()) > + bit = 0; > + > + else if (in_irq()) > + bit = 1; > + else > +

Re: [PATCH 6/9] livepatch/ftrace: Add recursion protection to the ftrace callback

2020-10-29 Thread Miroslav Benes
On Thu, 29 Oct 2020, Petr Mladek wrote: > On Thu 2020-10-29 14:51:06, Miroslav Benes wrote: > > On Wed, 28 Oct 2020, Steven Rostedt wrote: > > > Hm, I've always thought that we did not need any kind of recursion > > protection for our callback. It is marked as notr

Re: [PATCH 6/9] livepatch/ftrace: Add recursion protection to the ftrace callback

2020-10-29 Thread Miroslav Benes
he patch set correctly. > Cc: Josh Poimboeuf > Cc: Jiri Kosina > Cc: Miroslav Benes > Cc: Petr Mladek > Cc: Joe Lawrence > Cc: live-patch...@vger.kernel.org > Signed-off-by: Steven Rostedt (VMware) > --- > kernel/livepatch/patch.c | 5 + > 1 file changed,

Re: [PATCH] module: set MODULE_STATE_GOING state when a module fails to load

2020-10-29 Thread Miroslav Benes
On Wed, 28 Oct 2020, Jessica Yu wrote: > +++ Miroslav Benes [27/10/20 15:03 +0100]: > >If a module fails to load due to an error in prepare_coming_module(), > >the following error handling in load_module() runs with > >MODULE_STATE_COMING in module's state. Fix it

Re: [PATCH] Documentation: livepatch: document reliable stacktrace

2020-10-29 Thread Miroslav Benes
Hi, On Fri, 23 Oct 2020, Mark Rutland wrote: > Add documentation for reliable stacktrace. This is intended to describe > the semantics and to be an aid for implementing architecture support for > HAVE_RELIABLE_STACKTRACE. thanks a lot for doing the work! > Unwinding is a subtle area, and

[PATCH] module: set MODULE_STATE_GOING state when a module fails to load

2020-10-27 Thread Miroslav Benes
If a module fails to load due to an error in prepare_coming_module(), the following error handling in load_module() runs with MODULE_STATE_COMING in module's state. Fix it by correctly setting MODULE_STATE_GOING under "bug_cleanup" label. Signed-off-by: Miroslav Benes --- kernel/mo

Re: [PATCHSET RFC v3 0/6] Add support for TIF_NOTIFY_SIGNAL

2020-10-12 Thread Miroslav Benes
On Sat, 10 Oct 2020, Jens Axboe wrote: > On 10/9/20 9:21 AM, Jens Axboe wrote: > > On 10/9/20 2:01 AM, Miroslav Benes wrote: > >> On Thu, 8 Oct 2020, Oleg Nesterov wrote: > >> > >>> On 10/05, Jens Axboe wrote: > >>>> > >>>> Hi,

Re: [PATCHSET RFC v3 0/6] Add support for TIF_NOTIFY_SIGNAL

2020-10-09 Thread Miroslav Benes
On Thu, 8 Oct 2020, Oleg Nesterov wrote: > On 10/05, Jens Axboe wrote: > > > > Hi, > > > > The goal is this patch series is to decouple TWA_SIGNAL based task_work > > from real signals and signal delivery. > > I think TIF_NOTIFY_SIGNAL can have more users. Say, we can move > try_to_freeze() from

Re: [PATCH v4 04/29] objtool: Add a pass for generating __mcount_loc

2020-10-05 Thread Miroslav Benes
On Fri, 2 Oct 2020, Josh Poimboeuf wrote: > On Thu, Oct 01, 2020 at 03:36:12PM +0200, Peter Zijlstra wrote: > > On Thu, Oct 01, 2020 at 03:17:07PM +0200, Miroslav Benes wrote: > > > > > I also wonder about making 'mcount' command separate from 'check'. > > > Si

Re: [PATCH v4 04/29] objtool: Add a pass for generating __mcount_loc

2020-10-01 Thread Miroslav Benes
Hi Sami, On Tue, 29 Sep 2020, Sami Tolvanen wrote: > From: Peter Zijlstra > > Add the --mcount option for generating __mcount_loc sections > needed for dynamic ftrace. Using this pass requires the kernel to > be compiled with -mfentry and CC_USING_NOP_MCOUNT to be defined > in Makefile. > >

Re: [PATCH v5 00/10] Function Granular KASLR

2020-09-25 Thread Miroslav Benes
Hi Kristen, On Wed, 23 Sep 2020, Kristen Carlson Accardi wrote: > Function Granular Kernel Address Space Layout Randomization (fgkaslr) > - > > This patch set is an implementation of finer grained kernel address space >

Re: [PATCH v5 10/10] livepatch: only match unique symbols when using fgkaslr

2020-09-24 Thread Miroslav Benes
Hi, On Wed, 23 Sep 2020, Kristen Carlson Accardi wrote: > If any type of function granular randomization is enabled, the sympos > algorithm will fail, as it will be impossible to resolve symbols when > there are duplicates using the previous symbol position. > > Override the value of sympos to

Re: [PATCH v3 0/3] arm64: Convert to ARCH_STACKWALK

2020-09-16 Thread Miroslav Benes
4: stacktrace: Make stack walk callback consistent with generic > code > arm64: stacktrace: Convert to ARCH_STACKWALK The patches look good to me. Reviewed-by: Miroslav Benes M

Re: [PATCH v3 00/10] Make check implementation arch agnostic

2020-09-11 Thread Miroslav Benes
] https://lkml.org/lkml/2020/7/30/424 Hi, Josh merged the patch set already, but FWIW Reviewed-by: Miroslav Benes for the new changes (patches 7, 9 and 10). Miroslav

Re: [PATCH] objtool: support symtab_shndx during dump

2020-09-04 Thread Miroslav Benes
On Thu, 3 Sep 2020, Josh Poimboeuf wrote: > On Wed, Aug 12, 2020 at 10:57:11AM -0700, Kristen Carlson Accardi wrote: > > > if (GELF_ST_TYPE(sym.st_info) == STT_SECTION) { > > - scn = elf_getscn(elf, sym.st_shndx); > > + if

Re: [PATCH] objtool: support symtab_shndx during dump

2020-09-03 Thread Miroslav Benes
On Wed, 12 Aug 2020, Kristen Carlson Accardi wrote: > When getting the symbol index number, make sure to use the > extended symbol table information in order to support symbol > index's greater than 64K. > > Signed-off-by: Kristen Carlson Accardi Reviewed-by: Miroslav Benes M

Re: [PATCH 1/2] docs/livepatch: Add new compiler considerations doc

2020-09-02 Thread Miroslav Benes
Hi, first, I'm sorry for the late reply. Thanks, Josh, for the reminder. CCing Nicolai. Nicolai, could you take a look at the proposed documentation too, please? You have more up-to-date experience. On Tue, 21 Jul 2020, Joe Lawrence wrote: > +Examples > + > + > +Interprocedural

Re: refactoring livepatch documentation was Re: [PATCH 1/2] docs/livepatch: Add new compiler considerations doc

2020-09-02 Thread Miroslav Benes
[side note: So not only that my INBOX is a mess after the summer. I also lost some emails apparently. I'm really sorry about that. ] CCing Nicolai too. > Hi Petr, Josh, > > The compiler optimization pitfall document can wait for refactored livepatch > documentation if that puts it into better

Re: [PATCH 2/2] samples/livepatch: Add README.rst disclaimer

2020-09-02 Thread Miroslav Benes
ed-by: Josh Poimboeuf > Signed-off-by: Joe Lawrence Acked-by: Miroslav Benes M

Re: [PATCH v2 3/3] arm64: stacktrace: Convert to ARCH_STACKWALK

2020-09-02 Thread Miroslav Benes
Hi, it could be a silly question, but better to ask... > + if (regs) > + start_backtrace(, regs->regs[29], regs->pc); > + else > + start_backtrace(, thread_saved_fp(task), > + thread_saved_pc(task)); Would this also work for task ==

Re: [PATCH v2 2/3] arm64: stacktrace: Make stack walk callback consistent with generic code

2020-09-02 Thread Miroslav Benes
ion when arm64 is converted to use > arch_stack_walk() change the signature of the arm64 specific callback to > match that of the generic code. > > Signed-off-by: Mark Brown Reviewed-by: Miroslav Benes M

Re: [PATCH v2 1/3] stacktrace: Remove reliable argument from arch_stack_walk() callback

2020-09-02 Thread Miroslav Benes
; Signed-off-by: Mark Brown Reviewed-by: Miroslav Benes M

Re: [PATCH] ftrace: Free the trampoline when ftrace_startup() fails

2020-08-31 Thread Miroslav Benes
I used Masami's address which did not work. Sorry about that. Should be ok now. On Mon, 31 Aug 2020, Miroslav Benes wrote: > Commit fc0ea795f53c ("ftrace: Add symbols for ftrace trampolines") > missed to remove ops from new ftrace_ops_trampoline_list in

[PATCH] ftrace: Free the trampoline when ftrace_startup() fails

2020-08-31 Thread Miroslav Benes
ine itself is not freed in this case. Fix it by calling ftrace_trampoline_free() during the rollback. Fixes: fc0ea795f53c ("ftrace: Add symbols for ftrace trampolines") Signed-off-by: Miroslav Benes --- It would be fair to add Fixes: f8b8be8a310a ("ftrace, kprobes: Support IPMODI

Re: [PATCH v4 00/10] Function Granular KASLR

2020-08-28 Thread Miroslav Benes
Leaving Josh's proposals here for reference... > > I'm not sure how LTO does it, but a few more (half-brained) ideas > > that > > could work: > > > > 1) Add a field in kallsyms to keep track of a symbol's original > > offset > >before randomization/re-sorting. Livepatch could use that field

Re: [PATCH v4 4/4] objtool: check: Use orc definition only when needed

2020-08-28 Thread Miroslav Benes
hes with no orc implementation to provide dummy > orc definitions. > > Signed-off-by: Julien Thierry This is definitely simpler than what v3 had. Reviewed-by: Miroslav Benes M

Re: [PATCH v4 2/4] objtool: Move orc outside of check

2020-08-28 Thread Miroslav Benes
On Tue, 25 Aug 2020, Julien Thierry wrote: > Now that the objtool_file can be obtained outside of the check function, > orc generation builtin no longer requires check to explicitly call its > orc related functions. > > Signed-off-by: Julien Thierry Reviewed-by: Miroslav Benes M

[PATCH] selftests/livepatch: Do not check order when using "comm" for dmesg checking

2020-08-27 Thread Miroslav Benes
Normal state [ 86.844422] livepatch: 'test_klp_callbacks_demo': starting unpatching transition , "comm" fails with "comm: file 2 is not in sorted order". Suppress the order checking with --nocheck-order option. Signed-off-by: Miroslav Benes --- The strange thing is, I can reprod

Ftrace regression in v5.9-rc1 due to commit fc0ea795f53c ("ftrace: Add symbols for ftrace trampolines")

2020-08-26 Thread Miroslav Benes
Hi, during v5.9-rc1 testing I ran into an issue (BUG dump at the end of the email). I suspected commit fc0ea795f53c ("ftrace: Add symbols for ftrace trampolines") (which git bisect later confirmed) and a missing call to ftrace_remove_trampoline_from_kallsyms() somewhere. And indeed there is an

Re: [PATCH v2 0/9] Make check implementation arch agnostic

2020-07-31 Thread Miroslav Benes
> Changes since v1 [4]: > - Rebased on recent tip/objtool/core > - Split the unwind hint rework into multiple patches as suggested by > Miroslav For remaining patches 7-9 Reviewed-by: Miroslav Benes M

Re: [PATCH v3 2/4] objtool: Move orc outside of check

2020-07-31 Thread Miroslav Benes
On Thu, 30 Jul 2020, Julien Thierry wrote: > > > On 7/30/20 3:15 PM, Josh Poimboeuf wrote: > > On Thu, Jul 30, 2020 at 02:29:20PM +0100, Julien Thierry wrote: > >> > >> > >> On 7/30/20 2:22 PM, pet...@infradead.org wrote: > >>> On Thu, Jul 30, 2020 at 01:40:42PM +0100, Julien Thierry wrote: >

Re: [PATCH v4 00/10] Function Granular KASLR

2020-07-22 Thread Miroslav Benes
Let me CC live-patching ML, because from a quick glance this is something which could impact live patching code. At least it invalidates assumptions which "sympos" is based on. Miroslav On Fri, 17 Jul 2020, Kristen Carlson Accardi wrote: > Function Granular Kernel Address Space Layout

Re: [PATCH] Revert "kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled"

2020-07-21 Thread Miroslav Benes
On Sun, 19 Jul 2020, Joe Lawrence wrote: > On 7/17/20 2:29 PM, Josh Poimboeuf wrote: > > Use of the new -flive-patching flag was introduced with the following > > commit: > > > >43bd3a95c98e ("kbuild: use -flive-patching when CONFIG_LIVEPATCH is > >enabled") > > > > This flag has

Re: [PATCH] Revert "kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled"

2020-07-21 Thread Miroslav Benes
; > This reverts commit 43bd3a95c98e1a86b8b55d97f745c224ecff02b9. > > Fixes: 43bd3a95c98e ("kbuild: use -flive-patching when CONFIG_LIVEPATCH is > enabled") > Reported-by: Randy Dunlap > Signed-off-by: Josh Poimboeuf Acked-by: Miroslav Benes M

Re: [PATCH 3/3] arm64: stacktrace: Convert to ARCH_STACKWALK

2020-07-17 Thread Miroslav Benes
On Thu, 16 Jul 2020, Mark Brown wrote: > On Thu, Jul 16, 2020 at 01:56:13PM +0200, Miroslav Benes wrote: > > On Wed, 15 Jul 2020, Mark Brown wrote: > > > > -void save_stack_trace(struct stack_trace *trace) > > > -{ > > > - __save_stack_trace(current,

Re: [PATCH 1/3] stacktrace: Remove reliable argument from arch_stack_walk() callback

2020-07-17 Thread Miroslav Benes
On Wed, 15 Jul 2020, Mark Brown wrote: > Currently the callback passed to arch_stack_walk() has an argument called > reliable passed to it to indicate if the stack entry is reliable, a comment > says that this is used by some printk() consumers. However in the current > kernel none of the

Re: [PATCH 3/3] arm64: stacktrace: Convert to ARCH_STACKWALK

2020-07-16 Thread Miroslav Benes
Hi, On Wed, 15 Jul 2020, Mark Brown wrote: > Historically architectures have had duplicated code in their stack trace > implementations for filtering what gets traced. In order to avoid this > duplication some generic code has been provided using a new interface > arch_stack_walk(), enabled by

Re: linux-next: Tree for Jun 23 (objtool (2))

2020-07-16 Thread Miroslav Benes
On Wed, 15 Jul 2020, Josh Poimboeuf wrote: > On Wed, Jul 15, 2020 at 03:41:55PM +0200, Petr Mladek wrote: > > On Wed 2020-07-15 14:10:54, Petr Mladek wrote: > > > On Wed 2020-07-15 13:11:14, Miroslav Benes wrote: > > > > Petr, would you agree to revert -flive-patch

Re: linux-next: Tree for Jun 23 (objtool (2))

2020-07-15 Thread Miroslav Benes
On Tue, 14 Jul 2020, Josh Poimboeuf wrote: > On Tue, Jul 14, 2020 at 12:56:21PM +0200, Miroslav Benes wrote: > > On Thu, 2 Jul 2020, Josh Poimboeuf wrote: > > > > > On Tue, Jun 23, 2020 at 08:06:07AM -0700, Randy Dunlap wrote: > > > > On 6/22/20 11:28 PM, Step

Re: [PATCH v2] selftests/livepatch: adopt to newer sysctl error format

2020-07-14 Thread Miroslav Benes
sions using '-q' option. > > Explicitly print the final status on success so that it can be verified > in the log. The error message is enough on failure. > > Reported-by: Kamalesh Babulal > Signed-off-by: Petr Mladek Acked-by: Miroslav Benes M

Re: linux-next: Tree for Jun 23 (objtool (2))

2020-07-14 Thread Miroslav Benes
On Thu, 2 Jul 2020, Josh Poimboeuf wrote: > On Tue, Jun 23, 2020 at 08:06:07AM -0700, Randy Dunlap wrote: > > On 6/22/20 11:28 PM, Stephen Rothwell wrote: > > > Hi all, > > > > > > Changes since 20200622: > > > > > > > on x86_64: > > > > arch/x86/kernel/cpu/mce/core.o: warning: objtool:

Re: [RFC][PATCH v5 03/51] objtool: Make recordmcount into mcount subcmd

2020-06-25 Thread Miroslav Benes
On Thu, 18 Jun 2020, Matt Helsley wrote: > Rather than a standalone executable merge recordmcount as a sub command > of objtool. This is a small step towards cleaning up recordmcount and > eventually sharing ELF code with objtool. > > For the initial step all that's required is a bit of

Re: [RFC][PATCH v5 01/51] objtool: Factor out reasons to build objtool

2020-06-24 Thread Miroslav Benes
Hi, this is a nice improvement. > diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile > index 7770edcda3a0..aa0c6d3d2d46 100644 > --- a/tools/objtool/Makefile > +++ b/tools/objtool/Makefile > @@ -1,6 +1,7 @@ > # SPDX-License-Identifier: GPL-2.0 > include ../scripts/Makefile.include >

Re: [PATCH] objtool: Free memory in error case in special_get_alts

2020-06-15 Thread Miroslav Benes
Hi, On Fri, 12 Jun 2020, Tobias Klauser wrote: > Avoid a memory leak in case get_alt_entry returns an error. yes, this is not the only one, but I doubt we want to spend time on that. The process is about to exit anyway. Miroslav > Signed-off-by: Tobias Klauser > --- >

Re: [PATCH 0/7] Make check implementation arch agnostic

2020-06-10 Thread Miroslav Benes
5 add abstraction to handle alternatives > - Patch 6 adds abstraction to handle jump table > - Patch 7 abstracts the use of unwind hints. Adding it as RFC as I'm sure > there's room for improvement. Reviewed-by: Miroslav Benes for patches 1-6. M

Re: [RFC PATCH 7/7] objtool: Make unwind_hints available for all architectures

2020-06-10 Thread Miroslav Benes
Hi Julien, On Mon, 8 Jun 2020, Julien Thierry wrote: > Unwind hints are useful to give some information about the call frame > or stack states in non-standard code. > > Despite unwind hints being used in arch-independent code, the > unwind_hint structure type itself is define in x86 kernel

Re: [PATCH v2 0/4] Remove dependency of check subcmd upon orc

2020-06-09 Thread Miroslav Benes
4.html > [2] https://lkml.org/lkml/2020/6/4/675 Reviewed-by: Miroslav Benes M

Re: [PATCH v2 1/4] selftests/livepatch: simplify test-klp-callbacks busy target tests

2020-06-05 Thread Miroslav Benes
gt; Signed-off-by: Joe Lawrence Acked-by: Miroslav Benes M

Re: [PATCH 4/4] objtool: orc_gen: Move orc_entry out of instruction structure

2020-06-05 Thread Miroslav Benes
Hi, a nit below... On Thu, 4 Jun 2020, Julien Thierry wrote: > One orc_entry is associated with each instruction in the object file, > but having the orc_entry contained by the instruction structure forces > architectures not implementing the orc subcommands to provide a dummy > definition of

Re: [PATCH] kernel/modules: fix build without ARCH_HAS_STRICT_MODULE_RWX

2020-06-05 Thread Miroslav Benes
Hi, On Thu, 4 Jun 2020, Max Filippov wrote: > On configurations with CONFIG_ARCH_HAS_STRICT_MODULE_RWX disabled kernel > build fails with the following message: > > kernel/module.c:3593:2: error: implicit declaration of function > ‘module_enable_ro’; > > Add empty module_enable_ro

  1   2   3   4   5   6   7   8   9   10   >