History

kho: kho_restore_vmalloc: fix initialization of pages array

Patch series "kho: fixes for vmalloc restoration". Pratyush reported off-list that when kho_restore_vmalloc() is used to restore a vmalloc_huge() allocation it hits VM_BUG_ON() when we reconstruct the struct pages in kho_restore_pages(). These patches fix the issue. This patch (of 2): In case a preserved vmalloc allocation was using huge pages, all pages in the array of pages added to vm_struct during kho_restore_vmalloc() are wrongly set to the same page. Fix the indexing when assigning pages to that array.

Mike Rapoport (Microsoft) committed 11 months ago

Commit 4bc84cd1 parent c39eab71 file · +1 −1Browse files

Showing the changes to kernel/liveupdate (1 of 1 file). Show all

Unified · Split

kernel/liveupdate/kexec_handover.c+1−1
@@ -1096,7 +1096,7 @@ void *kho_restore_vmalloc(const struct kho_vmalloc *preservation) · 1095 unmodified lines
1096 goto err_free_pages_array;1096 goto err_free_pages_array;
1097 1097
1098 for (int j = 0; j < contig_pages; j++)1098 for (int j = 0; j < contig_pages; j++)
1099 pages[idx++] = page;1099 pages[idx++] = page + j;
1100 1100
1101 phys += contig_pages * PAGE_SIZE;1101 phys += contig_pages * PAGE_SIZE;
1102 }1102 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t