[syslinux] [PATCH] EFI booting may hang indefinitely when no keyboard is present

Gene Cumm gene.cumm at gmail.com
Wed Sep 2 11:32:31 PDT 2015


On Sat, Aug 15, 2015 at 7:03 AM, Oliver Wagner via Syslinux
<syslinux at zytor.com> wrote:
> EFI booting may hang indefinitely when no keyboard is present on a machine
> (or when UEFI has chosen to not init USB due to fast boot). Reproducible at
> least with "EFI v2.31 by American Megatrends" on an Asrock H81M-ITX board.
>
> Reason is the input draining loop near the end in efi/main.c; it calls
> ReadKeyStroke() as long as EFI_NOT_READY is not returned. On machines
> without keyboard, EFI_DEVICE_ERROR may be returned instead, causing infinite
> looping. Positively checking for EFI_SUCCESS keeps the intent while avoiding
> this behavior.
>
> Patch is against 6.03; the issue is still present in 6.04 as per
> e466d2498604c8eea055a8e98284d65311073b39
>
> Best Regards,
> Olli
>
> --- syslinux-6.03/efi/main.c.orig       2015-08-15 12:31:33.987766223 +0200
> +++ syslinux-6.03/efi/main.c    2015-08-15 12:31:44.427993051 +0200
> @@ -1324,7 +1324,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EF
>         in = ST->ConIn;
>         do {
>                 status = uefi_call_wrapper(in->ReadKeyStroke, 2, in, &key);
> -       } while (status != EFI_NOT_READY);
> +       } while (status == EFI_SUCCESS);
>
>         if (!setjmp(load_error_buf))
>                 load_env32(NULL);

Applied.  Thanks!

-- 
-Gene


More information about the Syslinux mailing list