aboutsummaryrefslogtreecommitdiff
path: root/hw/fsp
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2014-07-30 10:30:28 +0530
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-08-08 16:07:25 +1000
commit14296103ae8afb7d38a8b24274f29dd0cc89fb4c (patch)
tree64c5cc343c023ec486a37a10eed45594526479be /hw/fsp
parente810dcbc09c375a39ce36f461eb0cc2f7e9a1aed (diff)
downloadskiboot-14296103ae8afb7d38a8b24274f29dd0cc89fb4c.zip
skiboot-14296103ae8afb7d38a8b24274f29dd0cc89fb4c.tar.gz
skiboot-14296103ae8afb7d38a8b24274f29dd0cc89fb4c.tar.bz2
ELOG: Make sure we do not cross read buffer size
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw/fsp')
-rw-r--r--hw/fsp/fsp-elog-read.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/fsp/fsp-elog-read.c b/hw/fsp/fsp-elog-read.c
index 571e79a..14babdf 100644
--- a/hw/fsp/fsp-elog-read.c
+++ b/hw/fsp/fsp-elog-read.c
@@ -416,6 +416,13 @@ static bool fsp_elog_msg(uint32_t cmd_sub_mod, struct fsp_msg *msg)
printf("ELOG: Notified of log 0x%08x (size: %d)\n",
log_id, log_size);
+ /* Make sure we don't cross read buffer size */
+ if (log_size > ELOG_READ_BUFFER_SIZE) {
+ log_size = ELOG_READ_BUFFER_SIZE;
+ printf("ELOG: Truncated log (0x%08x) to 0x%x\n",
+ log_id, log_size);
+ }
+
/* take a lock until we take out the node from elog_read_free */
lock(&elog_read_lock);
if (!list_empty(&elog_read_free)) {