[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] efi: strip off final NULL from File Path in grub_efi_get_fil
Re: [PATCH] efi: strip off final NULL from File Path in grub_efi_get_filename
Sat, 25 Feb 2017 08:44:47 +0300
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
25.02.2017 02:21, Vladimir 'phcoder' Serbinenko пишет:
> On Fri, Feb 24, 2017, 09:47 Andrei Borzenkov <address@hidden> wrote:
>> UEFI 2.6 220.127.116.11 File Path Media Device Path says that Path Name is
>> "A NULL-terminated Path string including directory and file names".
>> Strip final NULL from Path Name in each File Path node when constructing
>> full path. To be on safe side, strip all of them.
>> Fixes failure chainloading grub from grub, when loaded grub truncates
>> image path and does not find its grub.cfg.
>> This was triggered by commit ce95549cc54b5d6f494608a7c390dba3aab4fba7;
>> before it we built Path Name without trailing NULL, and apparently all
>> other bootloaders use single File Path node, thus not exposing this bug.
>> @Vladimir, @Daniel - this fixes regression in rc1 and is real fix for
>> the mentioned problem (previous patch only fixed the case of grub - grub
>> chainloading, this patch should properly parse image path also when called
>> from other EFI application).
> I'm OK with this patch. Especially that it's unlikely to break anything. Is
> the other patch still needed? If other loaders do it with a single path
> element we should probably too, to avoid this kind of bugs. Question is
> mostly whether it's rc1 material.
It is not needed. I would still consider it long term - it makes code
less confusing and avoids probably less-utilized code paths elsewhere.
It also demonstrates that we desperately need EFI boot tests. Much
thanks to SUSE for setting up comprehensive test suite!