Skip to content

Commit 921d161

Browse files
Tong Tiangenctmarinas
authored andcommitted
arm64: fix types in copy_highpage()
In copy_highpage() the `kto` and `kfrom` local variables are pointers to struct page, but these are used to hold arbitrary pointers to kernel memory . Each call to page_address() returns a void pointer to memory associated with the relevant page, and copy_page() expects void pointers to this memory. This inconsistency was introduced in commit 2563776 ("arm64: mte: Tags-aware copy_{user_,}highpage() implementations") and while this doesn't appear to be harmful in practice it is clearly wrong. Correct this by making `kto` and `kfrom` void pointers. Fixes: 2563776 ("arm64: mte: Tags-aware copy_{user_,}highpage() implementations") Signed-off-by: Tong Tiangen <[email protected]> Acked-by: Mark Rutland <[email protected]> Reviewed-by: Kefeng Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 5028fba commit 921d161

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/mm/copypage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
void copy_highpage(struct page *to, struct page *from)
1818
{
19-
struct page *kto = page_address(to);
20-
struct page *kfrom = page_address(from);
19+
void *kto = page_address(to);
20+
void *kfrom = page_address(from);
2121

2222
copy_page(kto, kfrom);
2323

0 commit comments

Comments
 (0)