* [PATCH] MIPS: OCTEON: Don't clobber bootloader data structures.
@ 2013-06-12 18:28 ` David Daney
0 siblings, 0 replies; 3+ messages in thread
From: David Daney @ 2013-06-12 18:28 UTC (permalink / raw)
To: linux-mips, ralf; +Cc: David Daney, stable
From: David Daney <david.daney@cavium.com>
Commit abe77f90dc (MIPS: Octeon: Add kexec and kdump support) added a
bootmem region for the kernel image itself. The problem is that this
is rounded up to a 0x100000 boundary, which is memory that may not be
owned by the kernel. Depending on the kernel's configuration based
size, this 'extra' memory may contain data passed from the bootloader
to the kernel itself, which if clobbered makes the kernel crash in
various ways.
The fix: Quit rounding the size up, so that we only use memory
assigned to the kernel.
Can be applied to v3.8 and later.
Signed-off-by: David Daney <david.daney@cavium.com>
Cc: <stable@vger.kernel.org>
---
This should probably go into 3.10
arch/mips/cavium-octeon/setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index 01b1b3f..1e1e18c 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -996,7 +996,7 @@ void __init plat_mem_setup(void)
cvmx_bootmem_unlock();
/* Add the memory region for the kernel. */
kernel_start = (unsigned long) _text;
- kernel_size = ALIGN(_end - _text, 0x100000);
+ kernel_size = _end - _text;
/* Adjust for physical offset. */
kernel_start &= ~0xffffffff80000000ULL;
--
1.7.11.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] MIPS: OCTEON: Don't clobber bootloader data structures.
@ 2013-06-12 18:28 ` David Daney
0 siblings, 0 replies; 3+ messages in thread
From: David Daney @ 2013-06-12 18:28 UTC (permalink / raw)
To: linux-mips, ralf; +Cc: David Daney, stable
From: David Daney <david.daney@cavium.com>
Commit abe77f90dc (MIPS: Octeon: Add kexec and kdump support) added a
bootmem region for the kernel image itself. The problem is that this
is rounded up to a 0x100000 boundary, which is memory that may not be
owned by the kernel. Depending on the kernel's configuration based
size, this 'extra' memory may contain data passed from the bootloader
to the kernel itself, which if clobbered makes the kernel crash in
various ways.
The fix: Quit rounding the size up, so that we only use memory
assigned to the kernel.
Can be applied to v3.8 and later.
Signed-off-by: David Daney <david.daney@cavium.com>
Cc: <stable@vger.kernel.org>
---
This should probably go into 3.10
arch/mips/cavium-octeon/setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index 01b1b3f..1e1e18c 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -996,7 +996,7 @@ void __init plat_mem_setup(void)
cvmx_bootmem_unlock();
/* Add the memory region for the kernel. */
kernel_start = (unsigned long) _text;
- kernel_size = ALIGN(_end - _text, 0x100000);
+ kernel_size = _end - _text;
/* Adjust for physical offset. */
kernel_start &= ~0xffffffff80000000ULL;
--
1.7.11.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: OCTEON: Don't clobber bootloader data structures.
2013-06-12 18:28 ` David Daney
(?)
@ 2013-06-13 14:35 ` Ralf Baechle
-1 siblings, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2013-06-13 14:35 UTC (permalink / raw)
To: David Daney; +Cc: linux-mips, David Daney, stable
On Wed, Jun 12, 2013 at 11:28:33AM -0700, David Daney wrote:
> Commit abe77f90dc (MIPS: Octeon: Add kexec and kdump support) added a
> bootmem region for the kernel image itself. The problem is that this
> is rounded up to a 0x100000 boundary, which is memory that may not be
> owned by the kernel. Depending on the kernel's configuration based
> size, this 'extra' memory may contain data passed from the bootloader
> to the kernel itself, which if clobbered makes the kernel crash in
> various ways.
>
> The fix: Quit rounding the size up, so that we only use memory
> assigned to the kernel.
>
> Can be applied to v3.8 and later.
Thanks, applied. Will send to Linus with the next pull request.
Ralf
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-13 14:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-12 18:28 [PATCH] MIPS: OCTEON: Don't clobber bootloader data structures David Daney
2013-06-12 18:28 ` David Daney
2013-06-13 14:35 ` Ralf Baechle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.