Skip to content

Commit 9cc3d0c

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: vdso: don't free unallocated pages
The aarch32_vdso_pages[] array never has entries allocated in the C_VVAR or C_VDSO slots, and as the array is zero initialized these contain NULL. However in __aarch32_alloc_vdso_pages() when aarch32_alloc_kuser_vdso_page() fails we attempt to free the page whose struct page is at NULL, which is obviously nonsensical. This patch removes the erroneous page freeing. Fixes: 7c1deee ("arm64: compat: VDSO setup for compat layer") Cc: <[email protected]> # 5.3.x- Cc: Vincenzo Frascino <[email protected]> Acked-by: Will Deacon <[email protected]> Signed-off-by: Mark Rutland <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent 8f3d9f3 commit 9cc3d0c

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

arch/arm64/kernel/vdso.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,7 @@ static int __aarch32_alloc_vdso_pages(void)
260260
if (ret)
261261
return ret;
262262

263-
ret = aarch32_alloc_kuser_vdso_page();
264-
if (ret) {
265-
unsigned long c_vvar =
266-
(unsigned long)page_to_virt(aarch32_vdso_pages[C_VVAR]);
267-
unsigned long c_vdso =
268-
(unsigned long)page_to_virt(aarch32_vdso_pages[C_VDSO]);
269-
270-
free_page(c_vvar);
271-
free_page(c_vdso);
272-
}
273-
274-
return ret;
263+
return aarch32_alloc_kuser_vdso_page();
275264
}
276265
#else
277266
static int __aarch32_alloc_vdso_pages(void)

0 commit comments

Comments
 (0)