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)
Sat, May 16, 4:03 AM
Unknown Object (File)
May 2 2026, 10:12 AM
Unknown Object (File)
Apr 26 2026, 1:58 AM
Unknown Object (File)
Apr 20 2026, 8:53 PM
Unknown Object (File)
Apr 18 2026, 5:34 AM
Unknown Object (File)
Apr 18 2026, 5:32 AM
Unknown Object (File)
Apr 17 2026, 7:39 PM
Unknown Object (File)
Apr 17 2026, 4:42 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 Not Applicable
Unit
Tests Not Applicable