lkml.org 
[lkml]   [2017]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] livepatch: add (un)patch hooks
From
Date
On 07/27/2017 05:36 PM, Josh Poimboeuf wrote:
> On Thu, Jul 27, 2017 at 04:43:58PM -0400, Joe Lawrence wrote:
>> On 07/20/2017 12:17 AM, Josh Poimboeuf wrote:
>>> - The post-patch and post-unpatch hooks will need to be run from either
>>> klp_complete_transition() or klp_module_coming/going(), depending on
>>> whether the to-be-patched module is already loaded or is being
>>> loaded/unloaded.
>>
>> You're suggesting that post-(un)patch-hooks:
>>
>> 1 - Notify klp_objects when a KLP_(UN)PATCHED transition completes
>
> Right. (From klp_complete_transition())

We should be careful to only call hooks for those klp_objects that were
actually (un)patched. I don't think there is such state that makes it
all the way out to klp_complete_transition(), but since both the
completion and module_coming/going code both operate under the
klp_mutex, perhaps klp_is_object_loaded() is a sufficient check?

>> and for subsequently loaded klp_objects (ie modules):
>>
>> 2 - On load - notify it with current KLP_(UN)PATCHED state,
>> Steady state - same as (1) above.
>
> Right. (From klp_module_coming/going())
>

At least this should be easier to implement since we know what the story
is for the klp_object in hand.

-- Joe

\
 
 \ /
  Last update: 2017-07-28 20:09    [W:0.130 / U:0.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site