Skip to content

Commit

Permalink
fix(lazy-pages-fuzzer): remove host address check
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteNacked committed Aug 28, 2024
1 parent 9296293 commit c94e191
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions scripts/check-lazy-pages-fuzzer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ main() {
if echo $OUTPUT | grep -q 'SIG: Unprotect WASM memory at address' && \
! echo $OUTPUT | grep -iq "ERROR"
then
echo -e "\nSuccess"
echo "Success"
exit 0
else
cat $OUTPUT_FILE
echo -e "\nFailure"
echo "Failure"
print_seed
exit 1
fi
}

print_seed() {
echo -e "\n Seed start: \""
echo "Seed start: \""
xxd -p $FUZZER_INPUT_FILE | tr --delete '\n'
echo -e "\n\" seed end."
echo "\" seed end."
}

main
13 changes: 7 additions & 6 deletions utils/lazy-pages-fuzzer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,21 @@ impl RunResult {
assert_eq!(wasmer_res.pages.len(), wasmi_res.pages.len());

for (
(wasmer_addr, (wasmer_page_info, wasmer_page_mem)),
(wasmer_addr, (wasmer_page_info, mut wasmer_page_mem)),
(wasmi_addr, (wasmi_page_info, wasmi_page_mem)),
) in wasmer_res
.pages
.into_iter()
.zip(wasmi_res.pages.into_iter())
{
let lower_bytes_page_mask = ((INITIAL_PAGES as usize) * WASM_PAGE_SIZE) - 1;
assert_eq!(wasmer_page_info, wasmi_page_info,
"wasmer page mem 0x{wasmer_addr:X?} wasmi page mem 0x{wasmi_addr:X?}",
);
assert_eq!(
lower_bytes_page_mask & wasmer_addr,
lower_bytes_page_mask & wasmi_addr
wasmer_page_mem, wasmi_page_mem,
"wasmer page mem 0x{wasmer_addr:X?} wasmi page mem 0x{wasmi_addr:X?} \
with content: 0x{wasmer_page_mem:X?} 0x{wasmi_page_mem:X?}",
);
assert_eq!(wasmer_page_info, wasmi_page_info);
assert_eq!(wasmer_page_mem, wasmi_page_mem);
}

assert_eq!(wasmer_res.globals, wasmi_res.globals);
Expand Down

0 comments on commit c94e191

Please sign in to comment.