Page MenuHomeFreeBSD

arm/unwind: Check stack pointer boundaries before dereferencing
ClosedPublic

Authored by markj on Jul 27 2023, 3:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 3 2024, 2:45 AM
Unknown Object (File)
Oct 3 2024, 12:43 AM
Unknown Object (File)
Sep 21 2024, 3:10 PM
Unknown Object (File)
Sep 18 2024, 9:50 AM
Unknown Object (File)
Sep 17 2024, 11:15 PM
Unknown Object (File)
Sep 15 2024, 8:48 PM
Unknown Object (File)
Sep 10 2024, 3:23 AM
Unknown Object (File)
Sep 8 2024, 3:07 AM
Subscribers

Details

Summary

If the unwinder somehow ends up with a stack pointer that lies outside
the stack, then an attempt to dereference can lead to a fault, which
causes the kernel to panic again and unwind the stack, which leads to a
fault...

Add kstack_contains() checks at points where we dereference the stack
pointer. This avoids the aforementioned infinite loop in one case I
have where some openssl assembly code apparently confuses the unwinder.

Sponsored by: Klara, Inc.
Sponsored by: Stormshield

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 52867
Build 49758: arc lint + arc unit