fs-use-nth_page-in-place-of-direct-struct-page-manipulation.patch removed from -mm tree
The quilt patch titled
Subject: fs: use nth_page() in place of direct struct page manipulation
has been removed from the -mm tree. Its filename was
fs-use-nth_page-in-place-of-direct-struct-page-manipulation.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Zi Yan <[email protected]>
Subject: fs: use nth_page() in place of direct struct page manipulation
Date: Wed, 13 Sep 2023 16:12:47 -0400
When dealing with hugetlb pages, struct page is not guaranteed to be contiguous on SPARSEMEM without VMEMMAP. Use nth_page() to handle it properly.
Without the fix, a wrong subpage might be checked for HWPoison, causing wrong number of bytes of a page copied to user space. No bug is reported. The fix comes from code inspection.
---
fs/hugetlbfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/hugetlbfs/inode.c renamed from fs/hugetlbfs/inode.c~fs-use-nth_page-in-place-of-direct-struct-page-manipulation +2 -2
@@ -295,7 +295,7 @@ static size_t adjust_range_hwpoison(strusize_t res =0 ;/* First subpage to start the loop. */ - page += offset /PAGE_SIZE ; + page =nth_page (page, offset /PAGE_SIZE ); offset %=PAGE_SIZE ;while (1 ) {if (is_raw_hwpoison_page_in_hugepage (page))
@@ -309,7 +309,7 @@ static size_t adjust_range_hwpoison(strubreak ; offset += n;if (offset ==PAGE_SIZE ) { - page++; + page =nth_page (page,1 ); offset =0 ; } }
_
Patches currently in -mm which might be from [email protected] are