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
F145720879: D32075.id96257.diff
Mon, Feb 23, 1:38 PM
Unknown Object (File)
Sun, Feb 22, 6:14 AM
Unknown Object (File)
Tue, Feb 10, 11:07 PM
Unknown Object (File)
Jan 6 2026, 12:38 AM
Unknown Object (File)
Jan 1 2026, 5:59 PM
Unknown Object (File)
Dec 30 2025, 2:16 PM
Unknown Object (File)
Dec 30 2025, 6:54 AM
Unknown Object (File)
Dec 24 2025, 6:40 AM

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.