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)
Tue, Jan 6, 8:12 PM
Unknown Object (File)
Thu, Jan 1, 1:44 PM
Unknown Object (File)
Nov 25 2025, 9:14 PM
Unknown Object (File)
Nov 15 2025, 11:07 PM
Unknown Object (File)
Nov 8 2025, 8:59 AM
Unknown Object (File)
Nov 7 2025, 3:41 PM
Unknown Object (File)
Nov 5 2025, 4:42 AM
Unknown Object (File)
Nov 2 2025, 8:37 PM
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 Not Applicable
Unit
Tests Not Applicable