Re: [PATCH 3/3] efi: Distinguish between "remaining space" and actuallyused space

From: Lingzhu Xiang
Date: Wed Apr 10 2013 - 02:03:13 EST


On 04/10/2013 10:41 AM, Matthew Garrett wrote:
+ if (!storage_size || size > remaining_size ||
+ ((active_size + size + VAR_METADATA_SIZE > storage_size / 2) &&
+ (remaining_size - size - VAR_METADATA_SIZE < storage_size / 2)))

This could overflow.

(u64)32768 - (u64)32768 - VAR_METADATA_SIZE < (u64)65536 / 2 == false
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/