bugGNU GRUB - Bugs: bug #66661, Module at_keyboard is not unloaded...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #66661: Module at_keyboard is not unloaded properly, causing boot hang

Submitter:  eegerferenc <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: 
Open/Closed:  Open Release:  other
Release:  Reproducibility:  Intermittent
Planned Release:  None

Tue 14 Jan 2025 01:07:05 AM UTC, original submission:  

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.

eegerferenc <eegerferenc>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #56773:  at_keyboard.patch added by eegerferenc (914B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eegerferenc (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-01-14 eegerferenc Attached File- Added at_keyboard.patch, #56773

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code