Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1179135 > unrolled thread
| Started by | Kees Cook <keescook@chromium.org> |
|---|---|
| First post | 2015-07-08 00:50 +0200 |
| Last post | 2015-07-08 00:50 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 12/42] x86, kaslr: Fix a bug that relocation can not be handled when kernel is loaded above 2G Kees Cook <keescook@chromium.org> - 2015-07-08 00:50 +0200
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2015-07-08 00:50 +0200 |
| Subject | Re: [PATCH 12/42] x86, kaslr: Fix a bug that relocation can not be handled when kernel is loaded above 2G |
| Message-ID | <pJJQC-36d-13@gated-at.bofh.it> |
On Tue, Jul 7, 2015 at 1:19 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> From: Baoquan He <bhe@redhat.com>
>
> When process 32 bit relocation tables a local variable extended is
> defined to calculate the physical address of relocs entry. However
> it's type is int which is enough for i386, for x86_64 not enough.
> That's why relocation can only be handled when kernel is loaded
> below 2G, otherwise a overflow will happen and cause system hang.
>
> Here change it to long as 32 bit inverse relocation processing does,
> and this change is safe for i386 relocation handling too.
>
> Signed-off-by: Baoquan He <bhe@redhat.com>
This looks right, thanks!
Acked-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> arch/x86/boot/compressed/misc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
> index 83f98a5..bfa4f0a 100644
> --- a/arch/x86/boot/compressed/misc.c
> +++ b/arch/x86/boot/compressed/misc.c
> @@ -273,7 +273,7 @@ static void handle_relocations(void *output, unsigned long output_len)
> * So we work backwards from the end of the decompressed image.
> */
> for (reloc = output + output_len - sizeof(*reloc); *reloc; reloc--) {
> - int extended = *reloc;
> + long extended = *reloc;
> extended += map;
>
> ptr = (unsigned long)extended;
> --
> 1.8.4.5
>
--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top | Article view | linux.kernel
csiph-web