Page MenuHomePhabricator

[safestack] Remove pageSize
ClosedPublic

Authored by vitalybuka on Feb 7 2019, 1:24 PM.

Details

Summary

3rd party sysconf interceptor may crash if it's called before unsafe_stack_setup

However pageSize is not useful here. mmap should round up on it's own, SFS_CHECK can be removed.

Diff Detail

Repository
rL LLVM

Event Timeline

vitalybuka created this revision.Feb 7 2019, 1:24 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 7 2019, 1:24 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

Alternatively, we could have a static buffer we use as a 'temporary' safe stack while initialization runs. I'm not really set on that idea, but it seems cleaner and like it may be more future proof in case another syscall we use (like getrlimit() right now) is intercepted. What do you think?

Alternatively, we could have a static buffer we use as a 'temporary' safe stack while initialization runs. I'm not really set on that idea, but it seems cleaner and like it may be more future proof in case another syscall we use (like getrlimit() right now) is intercepted. What do you think?

Hm, but buffer needs to be large, we don't know RLIMIT_STACK

vitalybuka updated this revision to Diff 185874.Feb 7 2019, 2:59 PM

remove pageSize

vitalybuka retitled this revision from [safestack] Move sysconf(_SC_PAGESIZE) back where it was before r351506 to [safestack] Remove pageSize.Feb 7 2019, 3:02 PM
vitalybuka edited the summary of this revision. (Show Details)
vlad.tsyrklevich accepted this revision.Feb 7 2019, 3:14 PM

LGTM as long as https://reviews.llvm.org/D57863 doesn't land (to ensure that struct tinfo *tinfo = reinterpret_cast<struct tinfo *>(addr); is a valid pointer to writable memory as the guard is no longer rounded up to page size.)

This revision is now accepted and ready to land.Feb 7 2019, 3:14 PM
Closed by commit rL353481: [safestack] Remove pageSize (authored by vitalybuka, committed by ). · Explain WhyFeb 7 2019, 3:22 PM
This revision was automatically updated to reflect the committed changes.