ACK: [PATCH 2/8] acpi: hpet: add safe memory read check on mmap'd memory

ivanhu ivan.hu at canonical.com
Mon Jul 17 09:47:51 UTC 2017



On 07/14/2017 05:52 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> Ensure we can read the mmap'd memory.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/acpi/hpet/hpet.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/src/acpi/hpet/hpet.c b/src/acpi/hpet/hpet.c
> index e6a3d4c3..15917d40 100644
> --- a/src/acpi/hpet/hpet.c
> +++ b/src/acpi/hpet/hpet.c
> @@ -428,6 +428,12 @@ static int hpet_check_test4(fwts_framework *fw)
>   		return FWTS_ERROR;
>   	}
>   
> +	if (fwts_safe_memread(hpet_base_v, HPET_REG_SIZE) != FWTS_OK) {
> +		fwts_log_info(fw, "Test skipped because HPET region cannot be read.");
> +		(void)fwts_munmap(hpet_base_v, HPET_REG_SIZE);
> +		return FWTS_SKIP;
> +	}
> +
>   	hpet_id = *(uint64_t*) hpet_base_v;
>   	vendor_id = (hpet_id & 0xffff0000) >> 16;
>   
> 

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



More information about the fwts-devel mailing list