[PATCH] acpi: gtdt: fix buffer overrun comparison

Vikas Sajjan sajjan.linux at gmail.com
Thu Mar 31 06:17:33 UTC 2016


On Wed, Mar 30, 2016 at 3:57 PM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The check to see if we overrun the data buffer is incorrect, the
> comparison is currently the wrong way around. Thanks to Vikas C Sajjan
> for finding and reporting this bug.
>

Thank you, Colin.


> Reported-by: Vikas C Sajjan <vikas.cha.sajjan at hpe.com>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/acpi/gtdt/gtdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/acpi/gtdt/gtdt.c b/src/acpi/gtdt/gtdt.c
> index 421f17f..1c98185 100644
> --- a/src/acpi/gtdt/gtdt.c
> +++ b/src/acpi/gtdt/gtdt.c
> @@ -75,7 +75,7 @@ static int gtdt_test1(fwts_framework *fw)
>                 case 0x00:
>                         /* GT Block Structure */
>                         block = (fwts_acpi_table_gtdt_block *)ptr;
> -                       if (ptr + 20 < end_ptr) {
> +                       if (ptr + 20 > end_ptr) {
>                                 passed = false;
>                                 fwts_failed(fw, LOG_LEVEL_HIGH,
>                                         "GTDTShortBlock",
> --
> 2.7.4
>
>
> --
> fwts-devel mailing list
> fwts-devel at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel



More information about the fwts-devel mailing list