lkml.org 
[lkml]   [2015]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 9/9] change the relocations behavior for kaslr on x86_64
On 03/04/15 at 03:16pm, Yinghai Lu wrote:
> On Mon, Mar 2, 2015 at 6:58 AM, Baoquan He <bhe@redhat.com> wrote:
>
> > @@ -455,17 +455,16 @@ unsigned char *choose_kernel_location(struct boot_params *params,
> > output_size);
>
> you forgot to change
>
> /* Record the various known unsafe memory ranges. */
> mem_avoid_init((unsigned long)input, input_size,
> (unsigned long)output, init_size);
>
> to
>
> /* Record the various known unsafe memory ranges. */
> mem_avoid_init((unsigned long)input, input_size,
> (unsigned long)*output, init_size);
No, I removed output in patch 1/9 since it's not used in
mem_avoid_init(). It doesn't have this problem. But in next post it need
be done like this.

>
> >
> > /* Walk e820 and find a random address. */
> > - random = find_random_addr(choice, output_size);
> > - if (!random) {
> > + random = find_random_phy_addr((unsigned long)*output, output_size);
> > + if (!random)
> > debug_putstr("KASLR could not find suitable E820 region...\n");
> > - goto out;
> > - }
> > + else
> > + *output = (unsigned char*)random;


\
 
 \ /
  Last update: 2015-03-05 01:01    [W:0.132 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site