Re: [PATCH 4/4] livepatch/shadow: Add garbage collection of shadow variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/2/22 8:51 AM, Joe Lawrence wrote:
> On 11/1/22 7:02 AM, Petr Mladek wrote:
>> Note that adding the used klp_shadow_types into struct klp_object
>> is not strictly required.
>>
>> Alternative solution is to register/unregister the used types using
>> klp_callbacks or module init()/exit() callbacks. This approach
>> is used in lib/livepatch/test_klp_shadow_vars.c.
>>
>> I believe that this would be usable for kpatch-build.
>> You needed to remove not-longer used shadow variables
>> using these callbacks even before this patchset. I would
>> consider it a bug if you did not remove them. The new API
>> just allows to do this a safe way.
>>
> 
> Ah, let me dig into that example for alternative usage.  At first
> glance, it looks like you're right -- kpatch already supports callbacks,
> so just (un)register the shadow variables here.  I'll be back with more
> info hopefully later this week.
> 

(Un)registering the shadow types from the callbacks worked out fine.  It
adds some verbosity to our shadow variable usage, but I think most of
that is unavoidable as the API is changing anyway.

Adding the shadow type into kpatch klp_objects (or the klp_patch) would
require a bit more work on our part, but doesn't need to hold up
upstream review up this patchset.

Thanks,

-- 
Joe




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux