mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-08 16:21:32 +00:00
rtn fix
This commit is contained in:
parent
4e567d3f5d
commit
f5420e737a
@ -9,7 +9,7 @@ Want to stay in the loop on major new features? Join our mailing list by
|
|||||||
sending a mail to <afl-users+subscribe@googlegroups.com>.
|
sending a mail to <afl-users+subscribe@googlegroups.com>.
|
||||||
|
|
||||||
### Version ++3.12a (dev)
|
### Version ++3.12a (dev)
|
||||||
- ...
|
- fix cmplog rtn (rare crash and not being able to gather ptr data)
|
||||||
|
|
||||||
|
|
||||||
### Version ++3.11c (release)
|
### Version ++3.11c (release)
|
||||||
|
@ -1734,25 +1734,26 @@ static int area_is_valid(void *ptr, size_t len) {
|
|||||||
|
|
||||||
long r = syscall(SYS_write, __afl_dummy_fd[1], ptr, len);
|
long r = syscall(SYS_write, __afl_dummy_fd[1], ptr, len);
|
||||||
|
|
||||||
if (unlikely(r <= 0 || r > len)) { // fail - maybe hitting asan boundary?
|
if (r <= 0 || r > len) return 0;
|
||||||
|
|
||||||
char *p = (char *)ptr;
|
// even if the write succeed this can be a false positive if we cross
|
||||||
long page_size = sysconf(_SC_PAGE_SIZE);
|
// a page boundary. who knows why.
|
||||||
char *page = (char *)((uintptr_t)p & ~(page_size - 1)) + page_size;
|
|
||||||
if (page >= p + len) { return 0; } // no isnt, return fail
|
|
||||||
len = page - p - len;
|
|
||||||
r = syscall(SYS_write, __afl_dummy_fd[1], page, len);
|
|
||||||
|
|
||||||
}
|
char *p = (char *)ptr;
|
||||||
|
long page_size = sysconf(_SC_PAGE_SIZE);
|
||||||
|
char *page = (char *)((uintptr_t)p & ~(page_size - 1)) + page_size;
|
||||||
|
|
||||||
// partial writes - we return what was written.
|
if (page > p + len) {
|
||||||
if (likely(r >= 0 && r <= len)) {
|
|
||||||
|
|
||||||
|
// no, not crossing a page boundary
|
||||||
return (int)r;
|
return (int)r;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
return 0;
|
// yes it crosses a boundary, hence we can only return the length of
|
||||||
|
// rest of the first page, we cannot detect if the next page is valid
|
||||||
|
// or not, neither by SYS_write nor msync() :-(
|
||||||
|
return (int)(page - p);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 0fb212daab492411b3e323bc18a3074c1aecfd37
|
Subproject commit d1ca56b84e78f821406eef28d836918edfc8d610
|
Loading…
x
Reference in New Issue
Block a user