The patch titled Subject: mm/highmem: delete memmove_page() has been added to the -mm mm-unstable branch. Its filename is mm-highmem-delete-memmove_page.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-highmem-delete-memmove_page.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Fabio M. De Francesco" <fmdefrancesco@xxxxxxxxx> Subject: mm/highmem: delete memmove_page() Date: Mon, 6 Jun 2022 16:15:33 +0200 Matthew Wilcox reported that, while he was looking at memmove_page(), he realized that it can't actually work. The reasons are hidden in its implementation, which makes use of memmove() on logical addresses provided by kmap_local_page(). memmove() does the wrong thing when it tests "if (dest <= src)". Therefore, delete memmove_page(). No need to change any other code because we have no call sites of memmove_page() across the whole kernel. Link: https://lkml.kernel.org/r/20220606141533.555-1-fmdefrancesco@xxxxxxxxx Signed-off-by: Fabio M. De Francesco <fmdefrancesco@xxxxxxxxx> Reported-by: Matthew Wilcox <willy@xxxxxxxxxxxxx> Reviewed-by: Baoquan He <bhe@xxxxxxxxxx> Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx> Cc: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/highmem.h | 13 ------------- 1 file changed, 13 deletions(-) --- a/include/linux/highmem.h~mm-highmem-delete-memmove_page +++ a/include/linux/highmem.h @@ -347,19 +347,6 @@ static inline void memcpy_page(struct pa kunmap_local(dst); } -static inline void memmove_page(struct page *dst_page, size_t dst_off, - struct page *src_page, size_t src_off, - size_t len) -{ - char *dst = kmap_local_page(dst_page); - char *src = kmap_local_page(src_page); - - VM_BUG_ON(dst_off + len > PAGE_SIZE || src_off + len > PAGE_SIZE); - memmove(dst + dst_off, src + src_off, len); - kunmap_local(src); - kunmap_local(dst); -} - static inline void memset_page(struct page *page, size_t offset, int val, size_t len) { _ Patches currently in -mm which might be from fmdefrancesco@xxxxxxxxx are mm-highmem-delete-memmove_page.patch