dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0260-Fix-up-linux-params-usage.patch

27a4da
From 8076e5e56655de506175fa95a56797fb85dcfeee Mon Sep 17 00:00:00 2001
27a4da
From: Peter Jones <pjones@redhat.com>
27a4da
Date: Tue, 30 May 2017 14:16:07 -0400
27a4da
Subject: [PATCH 260/260] Fix up linux params usage...
27a4da
27a4da
Related: rhbz#1310763
27a4da
27a4da
Signed-off-by: Peter Jones <pjones@redhat.com>
27a4da
---
27a4da
 grub-core/loader/i386/linux.c | 5 ++++-
27a4da
 1 file changed, 4 insertions(+), 1 deletion(-)
27a4da
27a4da
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
27a4da
index e3906eb65..656c75fd7 100644
27a4da
--- a/grub-core/loader/i386/linux.c
27a4da
+++ b/grub-core/loader/i386/linux.c
27a4da
@@ -680,6 +680,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
27a4da
 {
27a4da
   grub_file_t file = 0;
27a4da
   struct linux_kernel_header lh;
27a4da
+  grub_uint8_t *linux_params_ptr;
27a4da
   grub_uint8_t setup_sects;
27a4da
   grub_size_t real_size, prot_size, prot_file_size, kernel_offset;
27a4da
   grub_ssize_t len;
27a4da
@@ -811,6 +812,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
27a4da
 		      preferred_address))
27a4da
     goto fail;
27a4da
 
27a4da
+
27a4da
   grub_memset (&linux_params, 0, sizeof (linux_params));
27a4da
   grub_memcpy (&linux_params.setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1);
27a4da
 
27a4da
@@ -820,7 +822,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
27a4da
 
27a4da
   len = sizeof (linux_params) - sizeof (lh);
27a4da
 
27a4da
-  grub_memcpy (&linux_params + sizeof (lh), kernel + kernel_offset, len);
27a4da
+  linux_params_ptr = (void *)&linux_params;
27a4da
+  grub_memcpy (linux_params_ptr + sizeof (lh), kernel + kernel_offset, len);
27a4da
   kernel_offset += len;
27a4da
 
27a4da
   linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;
27a4da
-- 
27a4da
2.13.0
27a4da