[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE9FiQWKNDgzJtDVV34e7vWTu7LtqdDKB4KiN1RZwcZrX70zSA@mail.gmail.com>
Date: Wed, 4 Mar 2015 10:06:28 -0800
From: Yinghai Lu <yinghai@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Matt Fleming <matt.fleming@...el.com>,
"H. Peter Anvin" <hpa@...or.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Jiri Kosina <jkosina@...e.cz>,
Borislav Petkov <bp@...e.de>, Baoquan He <bhe@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH v2 04/15] x86, kaslr: get kaslr_enabled back correctly
On Wed, Mar 4, 2015 at 2:16 AM, Borislav Petkov <bp@...en8.de> wrote:
> On Wed, Mar 04, 2015 at 12:00:37AM -0800, Yinghai Lu wrote:
>> commit f47233c2d34f ("x86/mm/ASLR: Propagate base load address calculation")
>> is using address as value for kaslr_enabled.
>>
>> That will random kaslr_enabled get that set or cleared.
>> Will have problem for system really have kaslr enabled.
>>
>> -v2: update changelog.
>
> This is still not good enough. Please do this:
>
> In commit f47233c2d34f we did A. The problem with that is B. Change the
> code to do C.
>
> Now you only have to fill out the A,B and C variables with the
> respective text which is understandable even for people who don't know
> this code.
>
I don't know, that is trivial and obvious.
the old code use address as value instead of using reference...
>>
>>
>> static void __init parse_kaslr_setup(u64 pa_data, u32 data_len)
>> {
>> - kaslr_enabled = (bool)(pa_data + sizeof(struct setup_data));
>> + /* kaslr_setup_data is defined in aslr.c */
>> + unsigned char *data;
>> + unsigned long offset = sizeof(struct setup_data);
>> +
>> + data = early_memremap(pa_data, offset + 1);
>
> early_memremap() needs its retval checked before accessing it.
>
will fix that.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists