lkml.org 
[lkml]   [2015]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] livepatch: x86: make kASLR logic more accurate
On Fri, 24 Apr 2015, Josh Poimboeuf wrote:

> > #if defined(CONFIG_RANDOMIZE_BASE)
> > - /* KASLR is enabled, disregard old_addr from user */
> > - func->old_addr = 0;
> > + /* If KASLR has been enabled, adjust old_addr accordingly */
> > + if (kaslr_enabled())
> > + func->old_addr += klp_vmlinux_relocation_offset();
>
> The old_addr field is optional, where a value of 0 means "lookup the
> address in kallsyms". So its value should only be adjusted if old_addr
> is already non-zero. Otherwise the zero value will be replaced with a
> bad address and it will mistakenly call klp_verify_vmlinux_symbol() with
> the bad address instead of klp_find_object_symbol().

Fair enough, good point, will take this into account in v3. Thanks,

--
Jiri Kosina
SUSE Labs


\
 
 \ /
  Last update: 2015-04-25 23:21    [W:0.147 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site