[Skiboot] [PATCH skiboot] phb3: Deprecate reading the PHB status

Alexey Kardashevskiy aik at ozlabs.ru
Thu Jan 10 11:50:01 AEDT 2019


The OPAL_PCI_EEH_FREEZE_STATUS call takes a bunch of parameters, one of
them is @phb_status. It is defined as __be64* and always NULL in
the current Linux upstream but if anyone ever decides to read that status,
then the PHB3's handler will assume it is struct OpalIoPhb3ErrorData*
(which is a lot bigger than 8 bytes) and zero it causing the stack
corruption.

This makes @phb_status deprecated by copying the error message from PHB4.

Signed-off-by: Alexey Kardashevskiy <aik at ozlabs.ru>
---
 hw/phb3.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/phb3.c b/hw/phb3.c
index 771ccfc..38b8f46 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -2772,8 +2772,7 @@ static int64_t phb3_eeh_freeze_status(struct phb *phb, uint64_t pe_number,
 
 bail:
 	if (phb_status)
-		phb3_read_phb_status(p,
-			(struct OpalIoPhb3ErrorData *)phb_status);
+		PHBERR(p, "%s: deprecated PHB status\n", __func__);
 
 	return OPAL_SUCCESS;
 }
-- 
2.17.1



More information about the Skiboot mailing list