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

2013-04-10 Thread Lingzhu Xiang
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 -

Re: [PATCH 3/3] efi: Distinguish between remaining space and actually used space

2013-04-10 Thread Lingzhu Xiang
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 -

[PATCH 3/3] efi: Distinguish between "remaining space" and actually used space

2013-04-09 Thread Matthew Garrett
EFI implementations distinguish between space that is actively used by a variable and space that merely hasn't been garbage collected yet. Space that hasn't yet been garbage collected isn't available for use and so isn't counted in the remaining_space field returned by QueryVariableInfo().

[PATCH 3/3] efi: Distinguish between remaining space and actually used space

2013-04-09 Thread Matthew Garrett
EFI implementations distinguish between space that is actively used by a variable and space that merely hasn't been garbage collected yet. Space that hasn't yet been garbage collected isn't available for use and so isn't counted in the remaining_space field returned by QueryVariableInfo().