[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen: Add EFI_LOAD_OPTION support
>>> On 03.01.18 at 17:04, <tamas@xxxxxxxxxxxxx> wrote: > On Wed, Jan 3, 2018 at 4:20 AM, Jan Beulich <JBeulich@xxxxxxxx> wrote: >>>>> On 02.01.18 at 16:56, <tamas@xxxxxxxxxxxxx> wrote: >>> + if ( elo->Attributes & LOAD_OPTION_ACTIVE ) >> >> Without any other (earlier) check, how can you reliably tell this >> being a pointer to EFI_LOAD_OPTION from it being the >> currently used one to CHAR16? Is the distinction perhaps UEFI >> version dependent? In the 2.3 spec I can't find any information >> on the layout of what ->LoadOptions points to. > > AFAICT there is no clear cut way to distinguish what is being passed > here. When launched via UEFI Xen receives the EFI_LOAD_OPTION buffer > here already, which it tries to parse as a string and fails. Take a > look at the same problem in the shim: > https://github.com/rhboot/shim/blob/master/shim.c#L2501. If there is a > clearer way to distinguish what is being passed here or more checks > that can be done I would be open for suggestions. Well, first of all the code you point to tells me that this situation is indeed as bad as it can be. However, the code also shows you some heuristics you could re-use. What they don't seem to utilize is the fact that as long as there are few enough bits defined for the Attributes field, checking that one for being a printable character (and the upper 16 bits to be non-null) might give a good indication what form we're dealing with. In fact it might be that when it's a string, the first character is always '\', but I'm afraid that's not written down anywhere. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |