From: Thomas Gleixner <tglx@linutronix.de>
To: Baoquan He <bhe@redhat.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com,
mingo@kernel.org, keescook@chromium.org, thgarnie@google.com,
caoj.fnst@cn.fujitsu.com, izumi.taku@jp.fujitsu.com
Subject: Re: [PATCH v2 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions
Date: Tue, 4 Jul 2017 16:00:16 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1707041555570.9000@nanos> (raw)
In-Reply-To: <1499155442-17467-3-git-send-email-bhe@redhat.com>
On Tue, 4 Jul 2017, Baoquan He wrote:
> +/* Marks if efi mirror regions have been found and handled. */
> +static bool efi_mirror_found;
> +
> +static void process_efi_entry(unsigned long minimum, unsigned long image_size)
> +{
> + struct efi_info *e = &boot_params->efi_info;
> + struct mem_vector region;
> + efi_memory_desc_t *md;
> + unsigned long pmap;
> + char *signature;
> + u32 nr_desc;
> + int i;
> +
> +
> +#ifdef CONFIG_EFI
> + signature = (char *)&boot_params->efi_info.efi_loader_signature;
> +#endif
So if CONFIG_EFI=n you happily dereference the uninitialized signature
pointer ...
Why is process_efi_entry() invoked at all if EFI is not enabled?
> + if (strncmp(signature, EFI32_LOADER_SIGNATURE, 4) &&
> + strncmp(signature, EFI64_LOADER_SIGNATURE, 4))
> + return;
> +
Thanks,
tglx
next prev parent reply other threads:[~2017-07-04 14:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 8:04 [PATCH v2 0/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Baoquan He
2017-07-04 8:04 ` [PATCH v2 1/2] x86/boot/KASLR: Adapt process_e820_entry for any type of memory entry Baoquan He
2017-07-05 22:06 ` Kees Cook
2017-07-06 1:21 ` Baoquan He
2017-07-04 8:04 ` [PATCH v2 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Baoquan He
2017-07-04 14:00 ` Thomas Gleixner [this message]
2017-07-04 14:30 ` Baoquan He
2017-07-04 14:46 ` Thomas Gleixner
2017-07-04 15:36 ` Matt Fleming
2017-07-04 15:46 ` Thomas Gleixner
2017-07-04 23:16 ` Baoquan He
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1707041555570.9000@nanos \
--to=tglx@linutronix.de \
--cc=bhe@redhat.com \
--cc=caoj.fnst@cn.fujitsu.com \
--cc=hpa@zytor.com \
--cc=izumi.taku@jp.fujitsu.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=thgarnie@google.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).