[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jLK-k4JZO4eZSasRuSSQxeru94U9whMPcgD6iin40VVTA@mail.gmail.com>
Date: Wed, 1 Oct 2014 11:08:56 -0700
From: Kees Cook <keescook@...omium.org>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: LKML <linux-kernel@...r.kernel.org>, Baoquan He <bhe@...hat.com>,
Vivek Goyal <vgoyal@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"x86@...nel.org" <x86@...nel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
Pavel Machek <pavel@....cz>
Subject: Re: [PATCH] x86, kaslr: avoid setup_data when picking location
On Wed, Oct 1, 2014 at 11:01 AM, H. Peter Anvin <hpa@...or.com> wrote:
> On 09/11/2014 09:19 AM, Kees Cook wrote:
>> --- a/arch/x86/boot/compressed/aslr.c
>> +++ b/arch/x86/boot/compressed/aslr.c
>> @@ -183,12 +183,27 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size,
>> static bool mem_avoid_overlap(struct mem_vector *img)
>> {
>> int i;
>> + struct setup_data *ptr;
>>
>> for (i = 0; i < MEM_AVOID_MAX; i++) {
>> if (mem_overlaps(img, &mem_avoid[i]))
>> return true;
>> }
>>
>> + /* Avoid all entries in the setup_data linked list. */
>> + ptr = (struct setup_data *)(unsigned long)real_mode->hdr.setup_data;
>> + while (ptr) {
>> + struct mem_vector avoid;
>> +
>> + avoid.start = (u64)ptr;
>> + avoid.size = sizeof(*ptr) + ptr->len;
>> +
>> + if (mem_overlaps(img, &avoid))
>> + return true;
>> +
>> + ptr = (struct setup_data *)(unsigned long)ptr->next;
>> + }
>> +
>> return false;
>> }
>>
>>
>
> The use of (u64) in the assignment to avoid.start gives a nuisance
> warning on 32 bits.
Ah, good catch! This should be (unsigned long), I think. Shall I send
a follow-up patch, or do you want to fix this directly?
-Kees
--
Kees Cook
Chrome OS Security
--
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