]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/book3s: Fix mc_recoverable_range buffer overrun issue.
authorMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Sun, 30 Mar 2014 05:33:23 +0000 (11:03 +0530)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 9 Apr 2014 02:53:15 +0000 (12:53 +1000)
commite56cb41992a5a64db52d68f2a8260be51713bc30
tree5bbd8d03d88a9986950961a0d60b7da9b7db3dff
parent0670b5f0ce3726f70e8e5a5183a2a5ba6a3faaf6
powerpc/book3s: Fix mc_recoverable_range buffer overrun issue.

Currently we wrongly allocate mc_recoverable_range buffer (to hold
recoverable ranges) based on size of the property "mcheck-recoverable-ranges".
This results in allocating less memory to hold available recoverable range
entries from /proc/device-tree/ibm,opal/mcheck-recoverable-ranges.

This patch fixes this issue by allocating mc_recoverable_range buffer based
on number of entries of recoverable ranges instead of device property size.
Without this change we end up allocating less memory and run into memory
corruption issue.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/powernv/opal.c