3 ms·
You're assuming the next page is mapped. If it's pointing into unmapped memory, then you'll segfault.
by vlovich123 4y ago
You're assuming the next page is mapped. If it's pointing into unmapped memory, then you'll segfault.
- Dylan16807 4y agoI'm not assuming. When I say "guarantee", I mean the code is designed so the first 8 bytes are always mapped. When I say "runtime length check", I mean the code only runs if the first 8 bytes are in fact mapped. No assumptions. No possible way to segfault. The read is valid. If buffer[6] is not mapped, then you don't "legitimately have the buffer length".
- vlovich123 4y agoOk then I just misunderstood / some kind of language preciseness confusion. We’re on the same page now. AFAIK this is what the article is saying to do.
- Dylan16807 4y ago> AFAIK this is what the article is saying to do. Yeah, that's why I quoted the article.