[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201004180428.14494-3-willy@infradead.org>
Date: Sun, 4 Oct 2020 19:04:23 +0100
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
To: linux-fsdevel@...r.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>, ericvh@...il.com,
lucho@...kov.net, viro@...iv.linux.org.uk, jlayton@...nel.org,
idryomov@...il.com, mark@...heh.com, jlbec@...lplan.org,
joseph.qi@...ux.alibaba.com, v9fs-developer@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, ceph-devel@...r.kernel.org,
ocfs2-devel@....oracle.com, linux-btrfs@...r.kernel.org,
clm@...com, josef@...icpanda.com, dsterba@...e.com,
stable@...r.kernel.org
Subject: [PATCH 2/7] buffer: Promote to unsigned long long before shifting
On 32-bit systems, this shift will overflow for files larger than 4GB.
Cc: stable@...r.kernel.org
Fixes: 5417169026c3 ("[FS] Implement block_page_mkwrite.")
Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
fs/buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index 50bbc99e3d96..66f4765e60ee 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2515,7 +2515,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
}
/* page is wholly or partially inside EOF */
- if (((page->index + 1) << PAGE_SHIFT) > size)
+ if (((page->index + 1ULL) << PAGE_SHIFT) > size)
end = size & ~PAGE_MASK;
else
end = PAGE_SIZE;
--
2.28.0
Powered by blists - more mailing lists