[Skiboot] [PATCH 1/6] xive: Check for valid PIR index when decoding

Andrew Donnellan andrew.donnellan at au1.ibm.com
Thu Aug 10 18:13:36 AEST 2017


On 10/08/17 16:58, Russell Currey wrote:
> This fixes an unlikely but possible assert() fail on kdump.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Signed-off-by: Russell Currey <ruscur at russell.cc>

Where does the assert() happen?

Regardless this looks like a pretty reasonable thing to check, so...

Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>


> ---
>   hw/xive.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/hw/xive.c b/hw/xive.c
> index 03b9478e..18636723 100644
> --- a/hw/xive.c
> +++ b/hw/xive.c
> @@ -601,6 +601,8 @@ static bool xive_decode_vp(uint32_t vp, uint32_t *blk, uint32_t *idx,
>   
>   	/* PIR case */
>   	if (((vp >> 30) & 1) == 0) {
> +		if (find_cpu_by_pir(index) == NULL)
> +			return false;
>   		if (blk)
>   			*blk = PIR2VP_BLK(index);
>   		if (idx)
> @@ -656,6 +658,8 @@ static bool xive_decode_vp(uint32_t vp, uint32_t *blk, uint32_t *idx,
>   
>   	/* PIR case */
>   	if (((vp >> 30) & 1) == 0) {
> +		if (find_cpu_by_pir(index) == NULL)
> +			return false;
>   		if (blk)
>   			*blk = PIR2VP_BLK(index);
>   		if (idx)
> 

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the Skiboot mailing list