[PPC64] Fix trapstk overflow

In some scenarios, the 4K trapstk may overflow, corrupting tmpstk.

This was observed during remote debugging, with the following steps:

At remote host (R):
- enter kdb during boot
- switch to gdb backend

At local host (L):
- attach gdb to R
- try to read an invalid memory position

At R:
- a DSI trap occurs and kdb restarts (all this occurs on trapstk)
- while printing the stacktrace, trapstk overflows and corrupts tmpstk

Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D22200
This commit is contained in:
Leandro Lupori 2019-10-31 11:59:00 +00:00
parent 459dfa0dd2
commit d7271ace1d

View File

@ -66,7 +66,7 @@ TOC_ENTRY(tmpstk)
TOC_ENTRY(can_wakeup)
#ifdef KDB
#define TRAPSTKSZ 4096 /* 4k trap stack */
#define TRAPSTKSZ 8192 /* 8k trap stack */
GLOBAL(trapstk)
.space TRAPSTKSZ
TOC_ENTRY(trapstk)