Thread (67 messages) flat view 67 messages, 5 authors, 2021-02-08

Re: [PATCH v19 16/25] mm: Add guard pages around a shadow stack.

From: Kees Cook <hidden>
Date: 2021-02-04 20:25:02
Also in: linux-arch, linux-doc, linux-mm, lkml

On Wed, Feb 03, 2021 at 02:55:38PM -0800, Yu-cheng Yu wrote:
INCSSP(Q/D) increments shadow stack pointer and 'pops and discards' the
first and the last elements in the range, effectively touches those memory
areas.

The maximum moving distance by INCSSPQ is 255 * 8 = 2040 bytes and
255 * 4 = 1020 bytes by INCSSPD.  Both ranges are far from PAGE_SIZE.
Thus, putting a gap page on both ends of a shadow stack prevents INCSSP,
CALL, and RET from going beyond.

Signed-off-by: Yu-cheng Yu <redacted>
Yay guard pages! :)

Reviewed-by: Kees Cook <redacted>

-- 
Kees Cook
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help