Re: efi: be more paranoid about available space when creating variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2013-03-26 at 12:31 +0800, Lingzhu Xiang wrote:
> On 03/26/2013 11:56 AM, Matthew Garrett wrote:
> > Ok, so having thought some more about the actual problem (ie, Samsungs
> > go wrong if there's too much used space marked as being active, not
> > merely too much used space) I think we really want to be looking for the
> > amount of active space rather than the remaining space value that
> > QueryVariableInfo() gives us. Something like this (absolutely untested,
> > provided here for comment) patch? I'll try rigging something up under
> > OVMF to test it. This version certainly seems a little over-naive, since
> > it won't handle the case of a variable that's being overwritten with
> > something of a different size.
> >
> > commit 263c2ee36c67dfa6d869304a3b5aef7a14f1ec4e
> > Author: Matthew Garrett <matthew.garrett@xxxxxxxxxx>
> > Date:   Mon Mar 25 13:40:28 2013 -0400
> >
> >      efi: Distinguish between "remaining space" and actually used space
> >
> >      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().
> >
> >      Combined with commit 68d9298 this can cause problems. Some implementations
> >      don't garbage collect until the remaining space is smaller than the maximum
> >      variable size, and as a result check_var_size() will always fail once more
> >      than 50% of the variable store has been used even if most of that space is
> >      marked as available for garbage collection. The user is unable to create
> >      new variables, and deleting variables doesn't increase the remaining space.
> 
> Do you mean they don't garbage collect across reboots?
[...]

Yes, see <http://article.gmane.org/gmane.linux.kernel.stable/47156>.

Ben.

-- 
Ben Hutchings
I'm not a reverse psychological virus.  Please don't copy me into your sig.

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux