URL:
  <https://savannah.gnu.org/bugs/?66661>

                 Summary: Module at_keyboard is not unloaded properly, causing
boot hang
                   Group: GNU GRUB
               Submitter: eegerferenc
               Submitted: Tue 14 Jan 2025 01:07:05 AM UTC
                Category: Booting
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any
                 Release: other
                 Release:
         Reproducibility: Intermittent
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 14 Jan 2025 01:07:05 AM UTC By: eegerferenc <eegerferenc>
Short description: module at_keyboard is registering a preboot hook, that does
not gets de-registered on unload, resulting in a call to a dangling function
pointer during boot and subsequent hang.

Detailed case:

- Motherboard: Asus P8Z77-M
- Coreboot, with GRUB2 built as payload
- GRUB version: 2.12 (default in coreboot 24.05)

The coreboot port of the specific motherboard has a defect, rendering PS/2
keyboard controller inoperable. Due to the specificity to this board and the
board's age and rarity, it is unlikely that this issue will be rectified soon.
(This is a CB-related issue, not part of this report.)

As a work-around, USB keyboard is used instead (GRUB supports both).

On coreboot platforms, (here unneeded) at_keyboard is being compiled and
loaded on start by default. However, it too has a defect: at_keyboard tries to
init the PS/2 keyboard at start, and since none is plugged in (since an USB
one is used instead), at_keyboard keeps retrying the init infinitely, blocking
and slowing down GRUB beyond useablity. However, this is also a separate issue
not covered here. (It is not known if this is the "standard" behavior or it is
CB- and MB-specific.)

As a work-around, the flashed-in grub.cfg does "rmmod at_keyboard" right away.
This brings in the bug described in this report: the GRUB_MOD_INIT() of
at_keyboard registers a preboot hook on load, which is not deregistered by
GRUB_MOD_FINI() on unload by rmmod. As a result, when the "boot" command is
executed, a call to the remaining dangling pointer is made, resulting in
random hangs.

It was verified that deregistering the hook solves the problem. The relevant
patch is included. The patch is against 2.12, but current head is essentially
the same.







    _______________________________________________________
File Attachments:


-------------------------------------------------------
Name: at_keyboard.patch  Size: 914B
<https://file.savannah.gnu.org/file/at_keyboard.patch?file_id=56773>

    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-04e1be7c5875649835636cff39891da2b16ab95a.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66661>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to