criu icon indicating copy to clipboard operation
criu copied to clipboard

restorer: allocate a stack guard page

Open avagin opened this issue 5 years ago • 3 comments

An accidental overflow could corrupt the area located below a stack, so let's map an extra page there without read-write permissions.

avagin avatar Nov 10 '19 07:11 avagin

I guess, there are still two issues I see:

  1. bootstrap_len is a continuous block so we might fail to find this large amount for restorer - may be worth to split it on multiple vmas (though, it may be not a problem on 64-bit systems).
  2. Now the redzone is one page, but in the original failure, it was an array that has a couple of kilobytes size, which means 4Kb maybe not enough for structures used on restorer's stack.

Anyway, the patch seems good to me and is a nice start that may catch new issues. With a minor nit, you can add my Reviewed-by: Dmitry Safonov <[email protected]> or which way is now preferred :) (I don't have a button that would mark PR as reviewed)

0x7f454c46 avatar Nov 11 '19 16:11 0x7f454c46

@avagin ping? :)

0x7f454c46 avatar Jan 22 '20 11:01 0x7f454c46

A friendly reminder that this PR had no activity for 30 days.

github-actions[bot] avatar Jan 11 '21 00:01 github-actions[bot]