Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-09 Thread Yafang Shao
On Thu, May 9, 2024 at 6:16 PM Petr Mladek wrote: > > On Thu 2024-05-09 13:53:17, Yafang Shao wrote: > > On Thu, May 9, 2024 at 1:20 PM Josh Poimboeuf wrote: > > > > > > On Thu, May 09, 2024 at 10:17:43AM +0800, Yafang Shao wrote: > > > > On Wed, May 8, 2024 at 3:03 PM Josh Poimboeuf > > > >

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-09 Thread Petr Mladek
On Mon 2024-05-06 19:35:22, Josh Poimboeuf wrote: > On Mon, May 06, 2024 at 01:32:19PM +0200, Petr Mladek wrote: > > Also it would require adding an API to remove the sysfs files from the > > module_exit callback. > > Could the sysfs removal be triggered from klp_module_going() or a module >

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-09 Thread Petr Mladek
On Thu 2024-05-09 13:53:17, Yafang Shao wrote: > On Thu, May 9, 2024 at 1:20 PM Josh Poimboeuf wrote: > > > > On Thu, May 09, 2024 at 10:17:43AM +0800, Yafang Shao wrote: > > > On Wed, May 8, 2024 at 3:03 PM Josh Poimboeuf wrote: > > > > > > > > On Wed, May 08, 2024 at 02:01:29PM +0800, Yafang

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-08 Thread Yafang Shao
On Thu, May 9, 2024 at 1:20 PM Josh Poimboeuf wrote: > > On Thu, May 09, 2024 at 10:17:43AM +0800, Yafang Shao wrote: > > On Wed, May 8, 2024 at 3:03 PM Josh Poimboeuf wrote: > > > > > > On Wed, May 08, 2024 at 02:01:29PM +0800, Yafang Shao wrote: > > > > On Wed, May 8, 2024 at 1:16 PM Josh

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-08 Thread Josh Poimboeuf
On Thu, May 09, 2024 at 10:17:43AM +0800, Yafang Shao wrote: > On Wed, May 8, 2024 at 3:03 PM Josh Poimboeuf wrote: > > > > On Wed, May 08, 2024 at 02:01:29PM +0800, Yafang Shao wrote: > > > On Wed, May 8, 2024 at 1:16 PM Josh Poimboeuf wrote: > > > > If klp_patch.replace is set on the new patch

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-08 Thread Yafang Shao
On Wed, May 8, 2024 at 3:03 PM Josh Poimboeuf wrote: > > On Wed, May 08, 2024 at 02:01:29PM +0800, Yafang Shao wrote: > > On Wed, May 8, 2024 at 1:16 PM Josh Poimboeuf wrote: > > > If klp_patch.replace is set on the new patch then it will replace all > > > previous patches. > > > > A scenario

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-08 Thread Josh Poimboeuf
On Wed, May 08, 2024 at 02:01:29PM +0800, Yafang Shao wrote: > On Wed, May 8, 2024 at 1:16 PM Josh Poimboeuf wrote: > > If klp_patch.replace is set on the new patch then it will replace all > > previous patches. > > A scenario exists wherein a user could simultaneously disable a loaded >

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-08 Thread Yafang Shao
On Wed, May 8, 2024 at 1:16 PM Josh Poimboeuf wrote: > > On Tue, May 07, 2024 at 10:03:59PM +0800, Yafang Shao wrote: > > On Tue, May 7, 2024 at 10:35 AM Josh Poimboeuf wrote: > > > User space needs to be polling for the transition to complete so it can > > > reverse the patch if it stalls.

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-07 Thread Josh Poimboeuf
On Tue, May 07, 2024 at 10:03:59PM +0800, Yafang Shao wrote: > On Tue, May 7, 2024 at 10:35 AM Josh Poimboeuf wrote: > > User space needs to be polling for the transition to complete so it can > > reverse the patch if it stalls. Otherwise the patch could stall forever > > and go unnoticed. > > >

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-07 Thread Yafang Shao
On Tue, May 7, 2024 at 10:35 AM Josh Poimboeuf wrote: > > On Mon, May 06, 2024 at 01:32:19PM +0200, Petr Mladek wrote: > > Also it would require adding an API to remove the sysfs files from the > > module_exit callback. > > Could the sysfs removal be triggered from klp_module_going() or a module

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-06 Thread Josh Poimboeuf
On Mon, May 06, 2024 at 01:32:19PM +0200, Petr Mladek wrote: > Also it would require adding an API to remove the sysfs files from the > module_exit callback. Could the sysfs removal be triggered from klp_module_going() or a module notifier? > I do not see any reasonable reason to keep the

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-06 Thread Petr Mladek
On Sun 2024-04-07 11:57:30, Yafang Shao wrote: > In our production environment, upon loading a new atomic replace livepatch, > we encountered an issue where the kernel module of the old livepatch > remained, despite being replaced by the new one. This issue can be > reproduced using the following

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-06 Thread Petr Mladek
On Fri 2024-05-03 14:14:34, Josh Poimboeuf wrote: > On Sun, Apr 07, 2024 at 11:57:30AM +0800, Yafang Shao wrote: > > $ ls /sys/kernel/livepatch/ > > livepatch_test_1 livepatch_test_0 was replaced > > > > $ cat /sys/kernel/livepatch/livepatch_test_1/enabled > > 1 > >

Re: [PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-05-03 Thread Josh Poimboeuf
On Sun, Apr 07, 2024 at 11:57:30AM +0800, Yafang Shao wrote: > $ ls /sys/kernel/livepatch/ > livepatch_test_1 livepatch_test_0 was replaced > > $ cat /sys/kernel/livepatch/livepatch_test_1/enabled > 1 > > $ lsmod | grep livepatch > livepatch_test_1 16384

[PATCH v2 2/2] livepatch: Delete the associated module of disabled livepatch

2024-04-06 Thread Yafang Shao
In our production environment, upon loading a new atomic replace livepatch, we encountered an issue where the kernel module of the old livepatch remained, despite being replaced by the new one. This issue can be reproduced using the following steps: - Pre setup: Build two atomic replace