Skip to content

Commit 965797d

Browse files
committed
ppc/spapr: Fix possible pa_features memory overflow
Coverity reports a possible memory overflow in spapr_dt_pa_features(). This should not be a true bug since DAWR1 cap is only be true for CPU_POWERPC_LOGICAL_3_10. Add an assertion to ensure any bug there is caught. Resolves: Coverity CID 1593722 Fixes: 5f361ea ("ppc: spapr: Enable 2nd DAWR on Power10 pSeries machine") Reviewed-By: Shivaprasad G Bhat <[email protected]> Reviewed-by: Cédric Le Goater <[email protected]> Signed-off-by: Nicholas Piggin <[email protected]>
1 parent e0b9357 commit 965797d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

hw/ppc/spapr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ static void spapr_dt_pa_features(SpaprMachineState *spapr,
296296
pa_features[40 + 2] &= ~0x80; /* Radix MMU */
297297
}
298298
if (spapr_get_cap(spapr, SPAPR_CAP_DAWR1)) {
299+
g_assert(pa_size > 66);
299300
pa_features[66] |= 0x80;
300301
}
301302

0 commit comments

Comments
 (0)