lkml.org 
[lkml]   [2015]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: module: save load_info for livepatch modules
On Fri, 13 Nov 2015, Miroslav Benes wrote:

> As for load_info, I don't have a strong opinion whether to keep it for all
> modules or for livepatch modules only.

I have. We cannot keep it, even for livepatch modules...

In info->hdr there is a temporary copy of the whole module (see
init_module syscall and the first parts of load_module). In load_module
a final struct module * is created with parts of info->hdr copied (I'll
get to that later). So if we saved info->hdr for later purposes we would
just have two copies of the same module in the memory. The original one
with !SHF_ALLOC sections and everything in vmalloc area, and the new
final copy with SHF_ALLOC sections only. This is not good.

If this is correct (and I think it is after some staring into the code) we
need to do something different. We should build the info we need for
delayed relocations from the final copy (or refactor the existing
module code).

The second problem... dynrela sections need to be marked with SHF_ALLOC
flag, right? Perhaps it would be better not to do it and copy also
SHF_RELA_LIVEPATCH sections. It is equivalent but not hidden somewhere
else (in userspace "kpatch-build" tool).

Miroslav


\
 
 \ /
  Last update: 2015-11-13 14:01    [W:0.082 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site