[Skiboot] [PATCH V2] [paca] Fix NULL pointer dereference
Ananth N Mavinakayanahalli
ananth at in.ibm.com
Thu Jun 18 18:12:54 AEST 2015
Fix NULL pointer dereference in paca.c
Signed-off-by: Ananth N Mavinakayanahalli <ananth at in.ibm.com>
V2: Use CHECK_SPPTR instead of NULL
---
hdata/paca.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hdata/paca.c b/hdata/paca.c
index d4360e7..b0e6426 100644
--- a/hdata/paca.c
+++ b/hdata/paca.c
@@ -158,6 +158,9 @@ static void add_icps(void)
const struct sppaca_cpu_id *id;
id = HDIF_get_idata(paca, SPPACA_IDATA_CPU_ID, &size);
+ if (!CHECK_SPPTR(id))
+ continue;
+
if (pir != be32_to_cpu(id->pir))
continue;
ibase = cleanup_addr(be64_to_cpu(id->ibase));
@@ -268,6 +271,9 @@ static bool __paca_parse(void)
__be32 *new_prop;
id = HDIF_get_idata(paca, 2, &size);
+ if (!CHECK_SPPTR(id))
+ continue;
+
ve_flags = be32_to_cpu(id->verify_exists_flags);
state = (ve_flags & CPU_ID_VERIFY_MASK) >> CPU_ID_VERIFY_SHIFT;
switch (state) {
More information about the Skiboot
mailing list