Bug 178061 - [ukbd] panic at reboot when hitting scroll-lock; race condition with interrupt handler in lower half of kernel
Summary: [ukbd] panic at reboot when hitting scroll-lock; race condition with interrup...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-22 21:10 UTC by Enji Cooper
Modified: 2018-05-20 23:52 UTC (History)
1 user (show)

See Also:


Attachments
giant after ukbd (102.18 KB, image/jpeg)
2015-12-04 15:35 UTC, Steven Hartland
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2013-04-22 21:10:00 UTC
I was installing FreeBSD 10-CURRENT [1] on a machine with IPMI and happened to hit the scroll lock when the syncer was running at reboot over IPMI and it generated an interrupt which caused the ukbd(4) driver to panic. Unfortunately I didn't capture any additional details, but it should be relatively easy to reproduce.

1. ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/amd64/amd64/ISO-IMAGES/10.0/FreeBSD-10.0-CURRENT-amd64-20130413-r249439-release.iso

Fix: 

The solution would be for ukbd to properly mask interrupts when it shouldn't be servicing them at reboot/shutdown. This is tricky though because the kernel could panic at reboot and hence the driver should be functional for service via ddb in "recoverable"/"debuggable" scenarios, BUT it should be easy to call a resume hook for the driver or unmask the interrupts again in ukbd.
How-To-Repeat: Hit scroll lock at reboot. This may require several tries in order to hit the magic race condition
Comment 1 Steven Hartland freebsd_committer freebsd_triage 2015-12-04 15:33:58 UTC
You can also cause LOR (Giant after non-sleepable) due to any kernel printf output while mtx is held.
Comment 2 Steven Hartland freebsd_committer freebsd_triage 2015-12-04 15:35:41 UTC
Created attachment 163847 [details]
giant after ukbd
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:52:34 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"