Page MenuHomeFreeBSD

sdhci: Fix crash caused by M_WAITOK in sdhci dumps
ClosedPublic

Authored by bag_semihalf.com on Sep 23 2021, 8:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 19, 2:46 PM
Unknown Object (File)
Sat, May 9, 10:00 PM
Unknown Object (File)
Sat, May 2, 10:34 PM
Unknown Object (File)
Mon, Apr 27, 3:43 PM
Unknown Object (File)
Apr 20 2026, 4:46 PM
Unknown Object (File)
Apr 20 2026, 4:46 PM
Unknown Object (File)
Apr 20 2026, 2:55 AM
Unknown Object (File)
Apr 13 2026, 8:16 PM

Details

Summary

In some contexts it is illegal to wait for memory allocation, causing
kernel panic. By default sbuf_new passes M_WAITOK to malloc,
which caused crashes when sdhci_dumpcaps or sdhci_dumpregs was callend in
non sutiable context.

Add SBUF_NOWAIT flag to sbuf_new to fix this.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bag_semihalf.com created this revision.
This revision was not accepted when it landed; it landed in state Needs Review.Oct 5 2021, 4:24 AM
This revision was automatically updated to reflect the committed changes.