criu icon indicating copy to clipboard operation
criu copied to clipboard

Support MADV_GUARD_INSTALL

Open mihalicyn opened this issue 8 months ago • 7 comments
trafficstars

https://github.com/checkpoint-restore/criu/pull/2625

  • https://lwn.net/Articles/1011366/
  • https://github.com/torvalds/linux/commit/662df3e5c37666d6ed75c88098699e070a4b35b5
  • https://github.com/bminor/glibc/commit/a6fbe36b7f31292981422692236465ab56670ea9

The following patch set extends the PAGEMAP_SCAN ioctl with PAGE_IS_GUARD flag to expose information about guard regions, allowing CRIU to detect and handle guard regions: https://lkml.org/lkml/2025/3/24/168

mihalicyn avatar Mar 18 '25 21:03 mihalicyn

Let me handle this issue.

minhbq-99 avatar Mar 19 '25 14:03 minhbq-99

Hi @minhbq-99!

Let me handle this issue.

@avagin and I looking into this right now we'll get back to you if any help is needed.

LKML thread: https://lore.kernel.org/criu/zihwmp67m2lpuxbfktmztvjdyap7suzd75dowlw4eamu6bhjf3@6euydiqowc7h/T/#u

mihalicyn avatar Mar 19 '25 14:03 mihalicyn

Okay, that's fine.

minhbq-99 avatar Mar 19 '25 15:03 minhbq-99

LKML thread: https://lore.kernel.org/criu/zihwmp67m2lpuxbfktmztvjdyap7suzd75dowlw4eamu6bhjf3@6euydiqowc7h/T/#u

Oh, at first, I think that there is some information about this region in /proc/pid/smaps like some other madvise region already. So it looks like if the user is using kernel with madvise(MADV_GUARD_INSTALL) but no information in /proc/pid/pagemap, it is quite hard to detect in CRIU.

minhbq-99 avatar Mar 19 '25 15:03 minhbq-99

For reference, the following patch adds a guard region bit to the pagemap that we can use in CRIU: https://lore.kernel.org/all/[email protected]/T/#u

rst0git avatar Mar 20 '25 14:03 rst0git

https://lore.kernel.org/linux-fsdevel/[email protected]/

I'll be working on a CRIU part.

mihalicyn avatar Mar 21 '25 10:03 mihalicyn

Thanks @mihalicyn! Please feel free to open a draft pull request!

rst0git avatar Mar 21 '25 13:03 rst0git