[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130104210114.GA11611@x1.alien8.de>
Date: Fri, 4 Jan 2013 22:01:19 +0100
From: Borislav Petkov <bp@...en8.de>
To: Yinghai Lu <yinghai@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
"H. Peter Anvin" <hpa@...or.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Jan Kiszka <jan.kiszka@....de>,
Jason Wessel <jason.wessel@...driver.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7u1 20/31] x86, kexec: replace ident_mapping_init and
init_level4_page
On Thu, Jan 03, 2013 at 04:48:40PM -0800, Yinghai Lu wrote:
> static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
> {
> + struct x86_mapping_info info = {
> + .alloc_pgt_page = alloc_pgt_page,
> + .context = image,
> + .pmd_flag = __PAGE_KERNEL_LARGE_EXEC,
> + };
This is leaving ->kernel_mapping uninitialized to contain a random,
previous stack value. I don't think we want that.
> unsigned long mstart, mend;
> pgd_t *level4p;
> int result;
> int i;
>
> level4p = (pgd_t *)__va(start_pgtable);
> - result = init_level4_page(image, level4p, 0, max_pfn << PAGE_SHIFT);
> + clear_page(level4p);
> + result = kernel_ident_mapping_init(&info, level4p,
> + 0, max_pfn << PAGE_SHIFT);
> if (result)
> return result;
>
> @@ -225,7 +115,8 @@ static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
> mstart = image->segment[i].mem;
> mend = mstart + image->segment[i].memsz;
>
> - result = ident_mapping_init(image, level4p, mstart, mend);
> + result = kernel_ident_mapping_init(&info,
> + level4p, mstart, mend);
>
> if (result)
> return result;
> --
> 1.7.10.4
>
>
--
Regards/Gruss,
Boris.
--
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