Fix kernel bug reported in Q&A forum

https://moodle-app2.let.ethz.ch/mod/forum/discuss.php?d=100366
This commit is contained in:
Sparchatus 2022-03-31 10:53:05 +00:00
parent da6dbaaff7
commit 84d16648d8

View File

@ -534,7 +534,7 @@ caps_map_l3(struct capability* dest,
} }
// check offset within frame // check offset within frame
if ((offset + BASE_PAGE_SIZE > get_size(src)) || if ((offset + pte_count * BASE_PAGE_SIZE > get_size(src)) ||
((offset % BASE_PAGE_SIZE) != 0)) { ((offset % BASE_PAGE_SIZE) != 0)) {
return SYS_ERR_FRAME_OFFSET_INVALID; return SYS_ERR_FRAME_OFFSET_INVALID;
} }