ACK: [PATCH 6/8] bios: pnp: add safe memory read check on mmap'd memory region

ivanhu ivan.hu at canonical.com
Mon Jul 17 09:49:02 UTC 2017



On 07/14/2017 05:52 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> Skip unreadable mmap'd PNP memory spaces.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/bios/pnp/pnp.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/src/bios/pnp/pnp.c b/src/bios/pnp/pnp.c
> index ebbba34a..ca0751b1 100644
> --- a/src/bios/pnp/pnp.c
> +++ b/src/bios/pnp/pnp.c
> @@ -94,6 +94,10 @@ static int pnp_test1(fwts_framework *fw)
>   
>   	for (i = 0; i < PNP_REGION_SIZE; i+= 16) {
>   		pnp_header *pnp = (pnp_header*)(mem+i);
> +
> +		/* Skip regions that are not readable */
> +		if (fwts_safe_memread(pnp, sizeof(pnp_header)) != FWTS_OK)
> +			continue;
>   		if ((memcmp(pnp->signature, PNP_SIGNATURE, 4) == 0) &&
>   		    (fwts_checksum(mem+i, sizeof(pnp_header)) == 0)) {
>   			fwts_log_info(fw, "Found PnP Installation Check structure at 0x%8.8x", PNP_REGION_START+i);
> 

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list