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)
Wed, Nov 5, 4:23 AM
Unknown Object (File)
Mon, Nov 3, 5:54 PM
Unknown Object (File)
Mon, Nov 3, 5:21 PM
Unknown Object (File)
Sun, Nov 2, 6:42 AM
Unknown Object (File)
Wed, Oct 29, 12:04 PM
Unknown Object (File)
Wed, Oct 29, 12:03 PM
Unknown Object (File)
Wed, Oct 29, 12:03 PM
Unknown Object (File)
Wed, Oct 29, 12:03 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

Lint
Lint Skipped
Unit
Tests Skipped

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.