Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-06 Thread Joe Lawrence
Hi Wardenjohn, To follow up, Red Hat kpatch QE pointed me toward this test: https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/tree/main/general/kpatch/kpatch-trace?ref_type=heads which reports a few interesting things via systemd service and ftrace: - Patched functions -

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-04 Thread Joe Lawrence
On Tue, Jun 04, 2024 at 04:14:51PM +0800, zhang warden wrote: > > > > On Jun 1, 2024, at 03:16, Joe Lawrence wrote: > > > > Adding these attributes to livepatch sysfs would be expedient and > > probably easier for us to use, but imposes a recurring burden on us t

Re: [PATCH 0/2] livepatch: Add compiler optimization disclaimer/docs

2024-05-31 Thread Joe Lawrence
On 5/31/24 07:23, Miroslav Benes wrote: > Hi, > > On Tue, 21 Jul 2020, Joe Lawrence wrote: > >> In light of [PATCH] Revert "kbuild: use -flive-patching when >> CONFIG_LIVEPATCH is enabled" [1], we should add some loud disclaimers >> and explanation o

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-31 Thread Joe Lawrence
On Tue, May 21, 2024 at 08:34:46AM +0200, Miroslav Benes wrote: > Hello, > > On Mon, 20 May 2024, zhang warden wrote: > > > > > > > > On May 20, 2024, at 14:46, Miroslav Benes wrote: > > > > > > Hi, > > > > > > On Mon, 20 May 2024, Wardenjohn wrote: > > > > > >> Livepatch module usually

Re: [PATCH v2 2/6] livepatch: Add klp-convert tool

2024-05-30 Thread Joe Lawrence
> > Update Makefiles to correctly support the compilation of the new tool, > update MAINTAINERS file and add a .gitignore file. > > [jpoim...@redhat.com: initial version] > Signed-off-by: Josh Poimboeuf > [joe.lawre...@redhat.com: clean-up and fixes] > Signed-off-b

Re: [PATCH v2 2/6] livepatch: Add klp-convert tool

2024-05-29 Thread Joe Lawrence
Hi Lukas, As mentioned offlist, reviewing and testing this is on my TODO list, but here are some early notes ... On Thu, May 16, 2024 at 03:30:05PM +0200, Lukas Hruska wrote: > Livepatches need to access external symbols which can't be handled > by the normal relocation mechanism. It is needed

Re: [PATCH] livepatch: Add KLP_IDLE state

2024-04-04 Thread Joe Lawrence
On 4/4/24 11:17, Petr Mladek wrote: > On Tue 2024-04-02 09:52:31, Joe Lawrence wrote: >> On Tue, Apr 02, 2024 at 11:09:54AM +0800, zhangwar...@gmail.com wrote: >>> From: Wardenjohn >>> >>> In livepatch, using KLP_UNDEFINED is seems to be confused. >>>

Re: [PATCH] livepatch: Add KLP_IDLE state

2024-04-02 Thread Joe Lawrence
On Tue, Apr 02, 2024 at 11:09:54AM +0800, zhangwar...@gmail.com wrote: > From: Wardenjohn > > In livepatch, using KLP_UNDEFINED is seems to be confused. > When kernel is ready, livepatch is ready too, which state is > idle but not undefined. What's more, if one livepatch process > is finished,

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

2021-03-29 Thread Joe Lawrence
uct task_struct *t) void recalc_sigpending(void) { - if (!recalc_sigpending_tsk(current) && !freezing(current) && - !klp_patch_pending(current)) + if (!recalc_sigpending_tsk(current) && !freezing(current)) clear_thread_flag(TIF_SIGPENDING); } Looks go

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

2021-03-25 Thread Joe Lawrence
On 3/25/21 5:26 AM, Miroslav Benes wrote: 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

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

2021-03-24 Thread Joe Lawrence
seems logical to me, so: Acked-by: Joe Lawrence Thanks, -- Joe

Re: [PATCH V2] docs: livepatch: Fix a typo and remove the unnecessary gaps in a sentence

2021-03-05 Thread Joe Lawrence
wing me, I probably repeated the same phrasing elsewhere. Up to you, thanks. Acked-by: Joe Lawrence -- Joe

Re: [PATCH] kbuild: add extra-y to targets-for-modules

2020-12-16 Thread Joe Lawrence
On 12/16/20 1:14 AM, Masahiro Yamada wrote: On Tue, Dec 8, 2020 at 11:31 PM Artem Savkov wrote: On Tue, Dec 08, 2020 at 05:20:35PM +0800, WANG Chao wrote: Sorry for the late reply. On 11/25/20 at 10:42P, Masahiro Yamada wrote: On Tue, Nov 24, 2020 at 12:05 AM WANG Chao wrote: On

Re: [PATCH] selftests/lkdtm: Use "comm" instead of "diff" for dmesg

2020-09-09 Thread Joe Lawrence
On 9/9/20 3:49 PM, Kees Cook wrote: On Fri, Jun 26, 2020 at 01:59:43PM -0700, Kees Cook wrote: Instead of full GNU diff (which smaller boot environments may not have), use "comm" which is more available. Reported-by: Naresh Kamboju Link:

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

2020-08-27 Thread Joe Lawrence
ll. > , "comm" fails with "comm: file 2 is not in sorted order". Suppress the > order checking with --nocheck-order option. > > Signed-off-by: Miroslav Benes Acked-by: Joe Lawrence And not so important for selftests, but helpful for backporting efforts: Fixes: 2f3

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

2020-08-25 Thread Joe Lawrence
work in all cases. I don't have a grasp on how complicated the alternatives might be, so I'll let others comment on best paths forward. I just wanted to note that -z unique-symbol looks like it could reasonable work well for this niche case. [1] https://github.com/joe-lawrence/linux/tree/

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

2020-08-10 Thread Joe Lawrence
On 8/6/20 8:03 AM, Petr Mladek wrote: On Wed 2020-07-22 15:51:39, Josh Poimboeuf wrote: On Wed, Jul 22, 2020 at 01:03:03PM -0400, Joe Lawrence wrote: On 7/21/20 7:04 PM, Josh Poimboeuf wrote: On Tue, Jul 21, 2020 at 12:14:06PM -0400, Joe Lawrence wrote: Compiler optimizations can have

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

2020-08-04 Thread Joe Lawrence
On Fri, Jul 17, 2020 at 09:59:57AM -0700, 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 v4 00/10] Function Granular KASLR

2020-08-03 Thread Joe Lawrence
On 8/3/20 1:45 PM, Kees Cook wrote: On Mon, Aug 03, 2020 at 02:39:32PM +0300, Evgenii Shatokhin wrote: There are at least 2 places where high-order memory allocations might happen during module loading. Such allocations may fail if memory is fragmented, while physically contiguous memory areas

Re: [PATCH 2/7] modules: mark find_symbol static

2020-07-29 Thread Joe Lawrence
On 7/29/20 12:24 PM, Greg Kroah-Hartman wrote: On Wed, Jul 29, 2020 at 06:13:18PM +0200, Jessica Yu wrote: +++ Christoph Hellwig [29/07/20 08:27 +0200]: find_symbol is only used in module.c. Signed-off-by: Christoph Hellwig CCing the livepatching ML, as this may or may not impact its

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

2020-07-22 Thread Joe Lawrence
On 7/21/20 7:04 PM, Josh Poimboeuf wrote: On Tue, Jul 21, 2020 at 12:14:06PM -0400, Joe Lawrence wrote: Compiler optimizations can have serious implications on livepatching. Create a document that outlines common optimization patterns and safe ways to livepatch them. Signed-off-by: Joe

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

2020-07-22 Thread Joe Lawrence
On 7/22/20 10:51 AM, Joe Lawrence wrote: On 7/22/20 10:39 AM, Kees Cook wrote: On Wed, Jul 22, 2020 at 11:27:30AM +0200, Miroslav Benes wrote: 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

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

2020-07-22 Thread Joe Lawrence
On 7/22/20 10:39 AM, Kees Cook wrote: On Wed, Jul 22, 2020 at 11:27:30AM +0200, Miroslav Benes wrote: 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. In a quick

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

2020-07-21 Thread Joe Lawrence
Compiler optimizations can have serious implications on livepatching. Create a document that outlines common optimization patterns and safe ways to livepatch them. Signed-off-by: Joe Lawrence --- .../livepatch/compiler-considerations.rst | 220 ++ Documentation/livepatch

[PATCH 0/2] livepatch: Add compiler optimization disclaimer/docs

2020-07-21 Thread Joe Lawrence
or renamed functions as part of their build, or the selftest scripts, or even adding something to the kernel API. I think we'll have a better idea after reviewing the compiler considerations doc. [1] https://lore.kernel.org/lkml/696262e997359666afa053fe7d1a9fb2bb373964.1595010490.git.jpoim...@redhat

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

2020-07-21 Thread Joe Lawrence
The livepatch samples aren't very careful with respect to compiler IPA-optimization of target kernel functions. Add a quick disclaimer and pointer to the compiler-considerations.rst file to warn readers. Suggested-by: Josh Poimboeuf Signed-off-by: Joe Lawrence --- samples/livepatch/README.rst

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

2020-07-20 Thread Joe Lawrence
On 7/20/20 4:50 AM, Kamalesh Babulal wrote: On 20/07/20 9:05 am, 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 en

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

2020-07-19 Thread Joe Lawrence
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 several drawbacks: [ ... snip ... ] - While there *is* a distro which relies

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

2020-07-14 Thread Joe Lawrence
patch: sysctl: setting key \"kernel.ftrace_enabled\": Device or resource busy % echo 0 > /sys/kernel/livepatch/$MOD_LIVEPATCH/enabled livepatch: '$MOD_LIVEPATCH': initializing unpatching transition livepatch: '$MOD_LIVEPATCH': starting unpatching transition Looks good, thanks. Reviewed-by: Joe Lawrence -- Joe

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

2020-07-10 Thread Joe Lawrence
On Fri, Jul 10, 2020 at 05:27:35PM +0200, Petr Mladek wrote: > On Fri 2020-07-10 10:40:43, Kamalesh Babulal wrote: > > With procfs v3.3.16, the sysctl command doesn't prints the set key and > > value on error. This change breaks livepatch selftest test-ftrace.sh, > > that tests the interaction of

Re: [PATCH] selftests/lkdtm: Use "comm" instead of "diff" for dmesg

2020-06-30 Thread Joe Lawrence
ESG" - > "$LOG" || true > > cat "$LOG" > # Check for expected output I'm not familiar with running lkdtm tests, but I copied the same fixup for the livepatching selftests and "comm" slides in nicely over there, so, Acked-by: Joe Lawrence -- Joe

Re: [PATCH 1/2] selftests/lkdtm: Don't clear dmesg when running tests

2020-06-26 Thread Joe Lawrence
On 6/26/20 4:02 AM, Petr Mladek wrote: On Wed 2020-06-24 16:12:47, Joe Lawrence wrote: On Wed, Jun 24, 2020 at 10:39:55AM +0200, Petr Mladek wrote: On Tue 2020-06-23 23:48:36, Joe Lawrence wrote: On 6/22/20 4:51 AM, Naresh Kamboju wrote: On Fri, 8 May 2020 at 12:23, Michael Ellerman wrote

Re: [PATCH 1/2] selftests/lkdtm: Don't clear dmesg when running tests

2020-06-24 Thread Joe Lawrence
On Wed, Jun 24, 2020 at 10:39:55AM +0200, Petr Mladek wrote: > On Tue 2020-06-23 23:48:36, Joe Lawrence wrote: > > On 6/22/20 4:51 AM, Naresh Kamboju wrote: > > > On Fri, 8 May 2020 at 12:23, Michael Ellerman wrote: > > > > > > > > It is Very Rude to c

Re: [PATCH 1/2] selftests/lkdtm: Don't clear dmesg when running tests

2020-06-23 Thread Joe Lawrence
On 6/22/20 4:51 AM, Naresh Kamboju wrote: On Fri, 8 May 2020 at 12:23, Michael Ellerman wrote: It is Very Rude to clear dmesg in test scripts. That's because the script may be part of a larger test run, and clearing dmesg potentially destroys the output of other tests. We can avoid using

Re: [PATCH v2 6/9] s390/module: Use s390_kernel_write() for late relocations

2020-04-30 Thread Joe Lawrence
On 4/30/20 12:48 PM, Josh Poimboeuf wrote: On Thu, Apr 30, 2020 at 10:38:21AM -0400, Joe Lawrence wrote: On Thu, Apr 23, 2020 at 01:10:30PM -0500, Josh Poimboeuf wrote: This is more of note for the future, but when/if we add livepatch support on arm64 we'll need to make the very same adjustment

Re: [PATCH v2 6/9] s390/module: Use s390_kernel_write() for late relocations

2020-04-30 Thread Joe Lawrence
On Thu, Apr 23, 2020 at 01:10:30PM -0500, Josh Poimboeuf wrote: > On Thu, Apr 23, 2020 at 09:12:28AM -0500, Josh Poimboeuf wrote: > > > > this is strange. While I would have expected an exception similar to > > > > this, it really should have happened on the "sturg" instruction which > > > > does

Re: [PATCH v3 3/3] selftests/livepatch: Test interaction with ftrace_enabled

2019-10-16 Thread Joe Lawrence
On 10/16/19 1:06 PM, Kamalesh Babulal wrote: On 10/16/19 5:03 PM, Miroslav Benes wrote: From: Joe Lawrence Since livepatching depends upon ftrace handlers to implement "patched" code functionality, verify that the ftrace_enabled sysctl value interacts with livepatch registration a

Re: [PATCH v3 2/3] selftests/livepatch: Make dynamic debug setup and restore generic

2019-10-16 Thread Joe Lawrence
On 10/16/19 1:10 PM, Kamalesh Babulal wrote: On 10/16/19 5:03 PM, Miroslav Benes wrote: From: Joe Lawrence Livepatch selftests currently save the current dynamic debug config and tweak it for the selftests. The config is restored at the end. Make the infrastructure generic, so that more

Re: [PATCH v3 5/6] x86/ftrace: Use text_poke()

2019-10-15 Thread Joe Lawrence
On 10/15/19 11:31 AM, Jessica Yu wrote: +++ Joe Lawrence [15/10/19 11:06 -0400]: On 10/15/19 10:13 AM, Miroslav Benes wrote: Yes, it does. klp_module_coming() calls module_disable_ro() on all patching modules which patch the coming module in order to call apply_relocate_add(). New (patching

Re: [PATCH v3 5/6] x86/ftrace: Use text_poke()

2019-10-15 Thread Joe Lawrence
On 10/15/19 10:13 AM, Miroslav Benes wrote: Yes, it does. klp_module_coming() calls module_disable_ro() on all patching modules which patch the coming module in order to call apply_relocate_add(). New (patching) code for a module can be relocated only when the relevant module is loaded. FWIW,

Re: [PATCH v2] ftrace: Introduce PERMANENT ftrace_ops flag

2019-10-15 Thread Joe Lawrence
-->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- >From a22ca55b3f429b7c9ceed6be87a571f77520994c Mon Sep 17 00:00:00 2001 From: Joe Lawrence Date: Tue, 15 Oct 2019 10:33:18 -0400 Subject: [PATCH] selftests/livepatch: test interaction with ft

Re: [PATCH v2] ftrace: Introduce PERMANENT ftrace_ops flag

2019-10-15 Thread Joe Lawrence
. -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- -->8-- >From c8c9f22e3816ca4c90ab7e7159d2ce536eaa5fad Mon Sep 17 00:00:00 2001 From: Joe Lawrence Date: Mon, 14 Oct 2019 18:25:01 -0400 Subject: [PATCH] selftests/livepatch: test inter

Re: [PATCH v2] ftrace: Introduce PERMANENT ftrace_ops flag

2019-10-14 Thread Joe Lawrence
nabled. Equally, a callback with the flag > set cannot be registered if ftrace_enabled is disabled. > > Signed-off-by: Miroslav Benes > --- > v1->v2: > - different logic, proposed by Joe Lawrence > > Two things I am not sure about much: > > - return codes. I c

Re: [PATCH v3 5/5] livepatch: Selftests of the API for tracking system state changes

2019-10-09 Thread Joe Lawrence
On Wed, Oct 09, 2019 at 04:18:59PM +0200, Petr Mladek wrote: > On Fri 2019-10-04 10:47:42, Joe Lawrence wrote: > > On Thu, Oct 03, 2019 at 11:01:37AM +0200, Petr Mladek wrote: > > > Four selftests for the new API. > > > > > > --- /dev/null > > >

Re: [PATCH 0/3] ftrace: Introduce PERMANENT ftrace_ops flag

2019-10-09 Thread Joe Lawrence
On Wed, Oct 09, 2019 at 01:22:34PM +0200, Petr Mladek wrote: > On Tue 2019-10-08 15:35:34, Joe Lawrence wrote: > > On Mon, Oct 07, 2019 at 10:17:11AM +0200, Miroslav Benes wrote: > > > Livepatch uses ftrace for redirection to new patched functions. It is > > > thus

Re: [PATCH 0/3] ftrace: Introduce PERMANENT ftrace_ops flag

2019-10-08 Thread Joe Lawrence
On Mon, Oct 07, 2019 at 10:17:11AM +0200, Miroslav Benes wrote: > Livepatch uses ftrace for redirection to new patched functions. It is > thus directly affected by ftrace sysctl knobs such as ftrace_enabled. > Setting ftrace_enabled to 0 also disables all live patched functions. It > is not a

Re: [PATCH v3 5/5] livepatch: Selftests of the API for tracking system state changes

2019-10-04 Thread Joe Lawrence
ivepatch/test-state.sh > @@ -0,0 +1,180 @@ > +#!/bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (C) 2018 Joe Lawrence > + nit: this should probably read as: # Copyright (C) 2019 Petr Mladek > +. $(dirname $0)/functions.sh > + > +MOD_LIVEPATCH=test_klp

Re: [PATCH v3 0/5] livepatch: new API to track system state changes

2019-10-04 Thread Joe Lawrence
state.c > create mode 100644 lib/livepatch/test_klp_state2.c > create mode 100644 lib/livepatch/test_klp_state3.c > create mode 100755 tools/testing/selftests/livepatch/test-state.sh > > -- > 2.16.4 > Hi Petr, Thanks for respinning this one with the latest updates. The implementation looks fine to me. I have two really minor nits for the selftest (I'll reply to that commit), but I wouldn't hold up the series for them. Acked-by: Joe Lawrence -- Joe

Re: [RFC PATCH 2/2] livepatch: Clear relocation targets on a module removal

2019-09-06 Thread Joe Lawrence
On 9/6/19 1:51 PM, Miroslav Benes wrote: Now, I don't think that replacing .ko on disk is a good idea. We've already discussed it. It would lead to a maintenance/packaging problem, because you never know which version of the module is loaded in the system. The state space grows rather rapidly

Re: [RFC PATCH 2/2] livepatch: Clear relocation targets on a module removal

2019-09-05 Thread Joe Lawrence
On 9/5/19 7:09 AM, Petr Mladek wrote: On Wed 2019-09-04 21:50:55, Josh Poimboeuf wrote: On Wed, Sep 04, 2019 at 10:49:32AM +0200, Petr Mladek wrote: I wonder what is necessary for a productive discussion on Plumbers: + Josh would like to see what code can get removed when late

Re: [RFC PATCH 2/2] livepatch: Clear relocation targets on a module removal

2019-09-04 Thread Joe Lawrence
On 9/4/19 4:49 AM, Petr Mladek wrote: On Tue 2019-09-03 15:02:34, Miroslav Benes wrote: On Mon, 2 Sep 2019, Joe Lawrence wrote: On 9/2/19 12:13 PM, Miroslav Benes wrote: I can easily foresee more problems like those in the future. Going forward we have to always keep track of which special

Re: [RFC PATCH 2/2] livepatch: Clear relocation targets on a module removal

2019-09-02 Thread Joe Lawrence
ate module patching. Hi Miroslav, I was tinkering with the "blue-sky" ideas that I mentioned to Josh the other day. I dunno if you had a chance to look at what removing that code looks like, but I can continue to flesh out that idea if it looks interesting: https://github.com/joe-lawr

Re: [RFC PATCH 2/2] livepatch: Clear relocation targets on a module removal

2019-08-27 Thread Joe Lawrence
On 8/26/19 10:54 AM, Josh Poimboeuf wrote: On Fri, Aug 23, 2019 at 10:13:06AM +0200, Petr Mladek wrote: On Thu 2019-08-22 17:36:49, Josh Poimboeuf wrote: On Fri, Aug 16, 2019 at 11:46:08AM +0200, Petr Mladek wrote: On Wed 2019-08-14 10:12:44, Josh Poimboeuf wrote: On Wed, Aug 14, 2019 at

Re: [PATCH v4 06/10] modpost: Add modinfo flag to livepatch modules

2019-08-19 Thread Joe Lawrence
thing one more time? What do you think? Definitely, yes. I occasionally force a push to: https://github.com/joe-lawrence/linux/tree/klp-convert-v5-expanded as I've been updating and collecting feedback from v4. Once updates settle, I'll send out a new v5 set. -- Joe

Re: [PATCH v4 06/10] modpost: Add modinfo flag to livepatch modules

2019-08-19 Thread Joe Lawrence
On 8/18/19 11:50 PM, Masahiro Yamada wrote: Hi Joe, On Sat, Aug 17, 2019 at 4:01 AM Joe Lawrence wrote: I didn't realize that we're supposed to be able to still build external modules after "make clean". If that's the case, then one might want to build an external klp-module a

Re: [PATCH v4 06/10] modpost: Add modinfo flag to livepatch modules

2019-08-16 Thread Joe Lawrence
On 8/16/19 8:43 AM, Joe Lawrence wrote: On 8/16/19 4:19 AM, Miroslav Benes wrote: Hi, I cleaned up the build system, and pushed it based on my kbuild tree. Please see: git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git klp-cleanup This indeed looks much simpler

Re: [PATCH v4 07/10] livepatch: Add sample livepatch module

2019-08-16 Thread Joe Lawrence
On 8/16/19 7:35 AM, Masahiro Yamada wrote: Hi Joe, On Thu, May 9, 2019 at 11:39 PM Joe Lawrence wrote: --- /dev/null +++ b/samples/livepatch/livepatch-annotated-sample.c @@ -0,0 +1,102 @@ Please use SPDX instead of the license boilerplate. Thanks. Good eye, this revision was spun

Re: [PATCH v4 06/10] modpost: Add modinfo flag to livepatch modules

2019-08-16 Thread Joe Lawrence
On 8/16/19 4:19 AM, Miroslav Benes wrote: Hi, I cleaned up the build system, and pushed it based on my kbuild tree. Please see: git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git klp-cleanup This indeed looks much simpler and cleaner (as far as I can judge with my

Re: [PATCH] selftests: livepatch: add missing fragments to config

2019-08-14 Thread Joe Lawrence
On 8/14/19 7:16 AM, Anders Roxell wrote: When generating config with 'make defconfig kselftest-merge' fragment CONFIG_TEST_LIVEPATCH=m isn't set. Rework to enable CONFIG_LIVEPATCH and CONFIG_DYNAMIC_DEBUG as well. Signed-off-by: Anders Roxell --- tools/testing/selftests/livepatch/config | 2

Re: [PATCH v4 06/10] modpost: Add modinfo flag to livepatch modules

2019-08-12 Thread Joe Lawrence
On Wed, Jul 31, 2019 at 02:58:27PM +0900, Masahiro Yamada wrote: > Hi Joe, > > > On Thu, May 9, 2019 at 11:39 PM Joe Lawrence wrote: > > > > From: Miroslav Benes > > > > Currently, livepatch infrastructure in the kernel relies on > > MODULE_INFO(livep

Re: [PATCH v4 03/10] livepatch: Add klp-convert tool

2019-08-09 Thread Joe Lawrence
On Wed, Jul 31, 2019 at 12:36:05PM +0900, Masahiro Yamada wrote: > On Wed, Jul 31, 2019 at 11:50 AM Masahiro Yamada > wrote: > > > > On Thu, May 9, 2019 at 11:39 PM Joe Lawrence > > wrote: > > > > > > From: Josh Poimboeuf > > > > > >

Re: [PATCH] kprobes: Allow kprobes coexist with livepatch

2019-07-26 Thread Joe Lawrence
On 7/26/19 12:14 PM, Steven Rostedt wrote: On Thu, 25 Jul 2019 22:07:52 -0400 Joe Lawrence wrote: These results reflect my underestanding of FTRACE_OPS_FL_IPMODIFY in light of your changes, so feel free to add my: Acked-by: Joe Lawrence Is this an urgent patch (needs to go in now

Re: [PATCH] kprobes: Allow kprobes coexist with livepatch

2019-07-25 Thread Joe Lawrence
_ unknown tracepoint Error: File /sys/kernel/debug/tracing/events/probe/cmdline_proc_show not found. Hint: Perhaps this kernel misses some CONFIG_ setting to enable this feature?. Run 'perf list' for a list of valid events Usage: perf record [] [] or: perf record [] -- [] -e, --eventevent selector. use 'perf list' to list available events These results reflect my underestanding of FTRACE_OPS_FL_IPMODIFY in light of your changes, so feel free to add my: Acked-by: Joe Lawrence -- Joe

kprobes, livepatch and FTRACE_OPS_FL_IPMODIFY

2019-07-24 Thread Joe Lawrence
Hi Masami, I wanted to revisit FTRACE_OPS_FL_IPMODIFY blocking of kprobes and livepatch, at least in cases where kprobe pre_handlers don't modify regs->ip. (We've discussed this previously at part of a kpatch github issue #47: https://github.com/dynup/kpatch/issues/47) The particular use case I

Re: [PATCH] s390/livepatch: Implement reliable stack tracing for the consistency model

2019-07-16 Thread Joe Lawrence
On Wed, Jul 10, 2019 at 12:59:18PM +0200, Miroslav Benes wrote: > The livepatch consistency model requires reliable stack tracing > architecture support in order to work properly. In order to achieve > this, two main issues have to be solved. First, reliable and consistent > call chain backtracing

Re: [PATCH v4 00/10] klp-convert livepatch build tooling

2019-06-25 Thread Joe Lawrence
On Tue, Jun 25, 2019 at 01:36:37PM +0200, Miroslav Benes wrote: > > [ ... snip ... ] > > If I revert commit d59cadc0a8f8 ("[squash] klp-convert: make > convert_rela() list-safe") (from Joe's expanded github tree), the problem > disappears. > > I haven't spotted any problem in the code and I cannot

Re: [PATCH v4 00/10] klp-convert livepatch build tooling

2019-06-25 Thread Joe Lawrence
On 6/25/19 7:36 AM, Miroslav Benes wrote: > [ ... snip ... ] > So I made a couple of experiments and found that GCC is somehow involved. If klp-convert (from scripts/livepatch/) is compiled with our GCC 4.8.5 from SLE12, the output is incorrect. If I compile it with GCC 7.4.0 from openSUSE

Re: [RFC 3/5] livepatch: Allow to distinguish different version of system state changes

2019-06-21 Thread Joe Lawrence
On Fri, Jun 21, 2019 at 10:09:11AM -0400, Joe Lawrence wrote: > More word play: would it be any clearer to drop the use of > "modification" when talking about klp_states? Sometimes I read > modification to mean a change to a klp_state itself rather than the > system at

Re: [RFC 5/5] livepatch: Selftests of the API for tracking system state changes

2019-06-21 Thread Joe Lawrence
state.c > @@ -0,0 +1,161 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (C) 2019 SUSE > > [ ... snip ... ] > > +MODULE_AUTHOR("Joe Lawrence "); Feel free to update the module author for these. -- Joe

Re: [RFC 4/5] livepatch: Documentation of the new API for tracking system state changes

2019-06-21 Thread Joe Lawrence
On Tue, Jun 11, 2019 at 03:56:26PM +0200, Petr Mladek wrote: > Documentation explaining the motivation, capabilities, and usage > of the new API for tracking system state changes. > > Signed-off-by: Petr Mladek > --- > Documentation/livepatch/index.rst| 1 + >

Re: [RFC 3/5] livepatch: Allow to distinguish different version of system state changes

2019-06-21 Thread Joe Lawrence
On Tue, Jun 11, 2019 at 03:56:25PM +0200, Petr Mladek wrote: > The atomic replace runs pre/post (un)install callbacks only from the new > livepatch. There are several reasons for this: > > + Simplicity: clear ordering of operations, no interactions between > old and new callbacks. > >

Re: [RFC 2/5] livepatch: Basic API to track system state changes

2019-06-21 Thread Joe Lawrence
On Tue, Jun 11, 2019 at 03:56:24PM +0200, Petr Mladek wrote: > This is another step how to help maintaining more livepatches. > > One big help was the atomic replace and cumulative livepatches. These > livepatches replaces the already installed ones. Therefore it should nit: s/replaces/replaces

Re: [RFC 0/5] livepatch: new API to track system state changes

2019-06-21 Thread Joe Lawrence
On Tue, Jun 11, 2019 at 03:56:22PM +0200, Petr Mladek wrote: > Hi, > > this is another piece in the puzzle that helps to maintain more > livepatches. > > Especially pre/post (un)patch callbacks might change a system state. > Any newly installed livepatch has to somehow deal with system state >

Re: [PATCH v4 00/10] klp-convert livepatch build tooling

2019-06-14 Thread Joe Lawrence
On 6/14/19 4:34 AM, Petr Mladek wrote: On Thu 2019-06-13 16:48:02, Joe Lawrence wrote: On 6/13/19 9:15 AM, Joe Lawrence wrote: On 6/13/19 9:00 AM, Miroslav Benes wrote: Hi Joe, first, I'm sorry for the lack of response so far. Maybe you've already noticed but the selftests fail. Well

Re: [PATCH v4 00/10] klp-convert livepatch build tooling

2019-06-13 Thread Joe Lawrence
On 6/13/19 9:15 AM, Joe Lawrence wrote: > On 6/13/19 9:00 AM, Miroslav Benes wrote: >> Hi Joe, >> >> first, I'm sorry for the lack of response so far. >> >> Maybe you've already noticed but the selftests fail. Well, at least in >> my VM. When test_klp_conve

Re: [PATCH v4 00/10] klp-convert livepatch build tooling

2019-06-13 Thread Joe Lawrence
On 6/13/19 9:00 AM, Miroslav Benes wrote: Hi Joe, first, I'm sorry for the lack of response so far. Maybe you've already noticed but the selftests fail. Well, at least in my VM. When test_klp_convert1.ko is loaded, the process is killed with [ 518.041826] BUG: kernel NULL pointer

Re: Oops caused by race between livepatch and ftrace

2019-05-21 Thread Joe Lawrence
On 5/20/19 5:19 PM, Joe Lawrence wrote: On 5/20/19 5:09 PM, Johannes Erdfelt wrote: On Mon, May 20, 2019, Joe Lawrence wrote: These two testing scenarios might be interesting to add to our selftests suite. Can you post or add the source(s) to livepatch-test.ko to the tarball? I made

Re: Oops caused by race between livepatch and ftrace

2019-05-20 Thread Joe Lawrence
On 5/20/19 5:09 PM, Johannes Erdfelt wrote: On Mon, May 20, 2019, Joe Lawrence wrote: [ fixed jeyu's email address ] Thank you, the bounce message made it seem like my mail server was blocked and not that the address didn't exist. I think MAINTAINERS needs an update since it still has

Re: Oops caused by race between livepatch and ftrace

2019-05-20 Thread Joe Lawrence
[ fixed jeyu's email address ] On 5/20/19 3:49 PM, Johannes Erdfelt wrote: [ ... snip ... ] I have put together a test case that can reproduce the crash using KVM. The tarball includes a minimal kernel and initramfs, along with a script to run qemu and the .config used to build the kernel. By

[tip:core/urgent] stacktrace: Unbreak stack_trace_save_tsk_reliable()

2019-05-19 Thread tip-bot for Joe Lawrence
Commit-ID: 7eaf51a2e094229b75cc0c315f1cbbe2f3960058 Gitweb: https://git.kernel.org/tip/7eaf51a2e094229b75cc0c315f1cbbe2f3960058 Author: Joe Lawrence AuthorDate: Fri, 17 May 2019 14:51:17 -0400 Committer: Thomas Gleixner CommitDate: Sun, 19 May 2019 11:43:22 +0200 stacktrace: Unbreak

Re: [PATCH] stacktrace: fix CONFIG_ARCH_STACKWALK stack_trace_save_tsk_reliable return

2019-05-17 Thread Joe Lawrence
On Fri, May 17, 2019 at 02:51:17PM -0400, Joe Lawrence wrote: > Miroslav reported that the livepatch self-tests were failing, > specifically a case in which the consistency model ensures that we do > not patch a current executing function, "TEST: busy target module". >

[PATCH] stacktrace: fix CONFIG_ARCH_STACKWALK stack_trace_save_tsk_reliable return

2019-05-17 Thread Joe Lawrence
trace retrieval") Reported-by: Miroslav Benes Signed-off-by: Joe Lawrence --- kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c index 27bafc1e271e..90d3e0bf0302 100644 --- a/kernel/stacktrace.c +++

Re: livepatching selftests failure on current master branch

2019-05-17 Thread Joe Lawrence
On 5/17/19 10:17 AM, Miroslav Benes wrote: Hi, I noticed that livepatching selftests fail on our master branch (https://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.git/). ... TEST: busy target module ... not ok --- expected +++ result @@ -7,16 +7,24 @@ livepatch:

[PATCH v4 03/10] livepatch: Add klp-convert tool

2019-05-09 Thread Joe Lawrence
Signed-off-by: Konstantin Khlebnikov Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- MAINTAINERS | 1 + include/uapi/linux/livepatch.h | 5 + scripts/Makefile| 1 + scripts/livepatch/.gitignore| 1 + scripts/livepatch/Makefile

[PATCH v4 05/10] modpost: Integrate klp-convert

2019-05-09 Thread Joe Lawrence
-by: Miroslav Benes Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- scripts/Kbuild.include | 4 +++- scripts/Makefile.modpost | 16 +++- scripts/mod/modpost.c| 6 +- scripts/mod/modpost.h| 1 + 4 files changed, 24 insertions(+), 3 deletions(-) diff --git

[PATCH v4 04/10] livepatch: Add klp-convert annotation helpers

2019-05-09 Thread Joe Lawrence
From: Josh Poimboeuf Define macros KLP_MODULE_RELOC and KLP_SYMPOS in include/linux/livepatch.h to improve user-friendliness of the livepatch annotation process. Signed-off-by: Josh Poimboeuf Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- include/linux/livepatch.h | 12

[PATCH v4 07/10] livepatch: Add sample livepatch module

2019-05-09 Thread Joe Lawrence
sample updates the function cmdline_proc_show to print the string referenced by the symbol saved_command_line appended by the string "livepatch=1". Update livepatch-sample.c to remove livepatch MODULE_INFO statement. Signed-off-by: Josh Poimboeuf Signed-off-by: Joao Moreira Signed-o

[PATCH v4 10/10] livepatch/klp-convert: abort on special sections

2019-05-09 Thread Joe Lawrence
r this (ie, moving data structure entries and relocations to their ".klp.arch" equivalents) but the hardest part will be determining klp_object relationships. This may require some larger changes to livepatch API, so defer support for now. Signed-off-by: Joe Lawrence --- scripts/livepatc

[PATCH v4 09/10] livepatch/selftests: add klp-convert

2019-05-09 Thread Joe Lawrence
Add a simple klp-convert livepatch selftest that exercises various symbol homonym sympos scenarios. Signed-off-by: Joe Lawrence --- lib/livepatch/Makefile| 10 ++ lib/livepatch/test_klp_convert1.c | 106 ++ lib/livepatch/test_klp_convert2.c

[PATCH v4 02/10] kbuild: Support for Symbols.list creation

2019-05-09 Thread Joe Lawrence
was originally proposed by Miroslav Benes as a workaround for identifying livepathes without depending on modinfo during the modpost stage. It was moved to this patch as the approach also shown to be useful while building Symbols.list. Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence

[PATCH v4 08/10] documentation: Update on livepatch elf format

2019-05-09 Thread Joe Lawrence
From: Joao Moreira Add a section to Documentation/livepatch/module-elf-format.txt describing how klp-convert works for fixing relocations. Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- Documentation/livepatch/livepatch.txt | 3 ++ Documentation/livepatch/module-elf

[PATCH v4 00/10] klp-convert livepatch build tooling

2019-05-09 Thread Joe Lawrence
to github: 1 - an expanded branch with changes separate from the original https://github.com/joe-lawrence/linux/tree/klp-convert-v4-expanded 2 - a squashed branch of (1) that comprises v4: https://github.com/joe-lawrence/linux/tree/klp-convert-v4 Non-trivial commits in the expanded branch have

[PATCH v4 06/10] modpost: Add modinfo flag to livepatch modules

2019-05-09 Thread Joe Lawrence
and store it in (MODVERDIR)/livepatchmods. Give this list as an argument for modpost which will use it to identify livepatch modules. As MODULE_INFO is no longer needed, remove it. Signed-off-by: Miroslav Benes Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- lib/livepatch/test_klp_atomic

[PATCH v4 01/10] livepatch: Create and include UAPI headers

2019-05-09 Thread Joe Lawrence
Poimboeuf Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- MAINTAINERS| 1 + include/linux/livepatch.h | 1 + include/uapi/linux/livepatch.h | 15 +++ kernel/livepatch/core.c| 4 ++-- 4 files changed, 19 insertions(+), 2 deletions(-) create

Re: [PATCH] livepatch: Remove stale kobj_added entries from kernel-doc descriptions

2019-05-07 Thread Joe Lawrence
@free_work:patch cleanup from workqueue-context D'oh, missed that in the review. Good eye, Kamalesh. Acked-by: Joe Lawrence -- Joe

Re: [PATCH 0/2] livepatch: Remove custom kobject state handling and duplicated code

2019-05-03 Thread Joe Lawrence
atch: Remove custom kobject state handling > livepatch: Remove duplicated code for early initialization > > include/linux/livepatch.h | 3 -- > kernel/livepatch/core.c | 86 > --- > 2 files changed, 37 insertions(+), 52 deletions(-) &

Re: [PATCH v3 0/9] klp-convert livepatch build tooling

2019-05-03 Thread Joe Lawrence
On Tue, Apr 16, 2019 at 01:37:13PM +0200, Miroslav Benes wrote: > > [ ... snip ... ] > > Quick look, but it seems quite similar to the problem we had with > apply_alternatives(). See arch/x86/kernel/livepatch.c and the commit which > introduced it. That was an interesting diversion :) I think I

Re: Livepatch vs LTO

2019-04-25 Thread Joe Lawrence
On 4/25/19 11:26 AM, Josh Poimboeuf wrote: Hi all, On IRC, Peter expressed some concern about -flive-patching, specifically that the flag isn't compatible with LTO. The upstream kernel currently doesn't support LTO, but Android is using it with LLVM:

Re: [PATCH v3 3/9] livepatch: Add klp-convert tool

2019-04-24 Thread Joe Lawrence
On 4/24/19 1:47 PM, Miroslav Benes wrote: On Tue, 23 Apr 2019, Joe Lawrence wrote: diff --git a/scripts/livepatch/klp-convert.c b/scripts/livepatch/klp-convert.c index 82c27d219372..126395f1c0cd 100644 --- a/scripts/livepatch/klp-convert.c +++ b/scripts/livepatch/klp-convert.c @@ -517,6 +517,7

Re: [PATCH v3 0/9] klp-convert livepatch build tooling

2019-04-24 Thread Joe Lawrence
On 4/24/19 3:13 PM, Joao Moreira wrote: Future Work --- I don't see an easy way to support multiple homonym symbols with unique values in the current livepatch module Elf format. The only solutions that come to mind right now include renaming homonym symbols somehow to retain the

  1   2   3   4   5   6   7   >