Re: [PATCH] erofs: fix offset truncation when shifting pgoff on 32-bit platforms

Chao Yu <[email protected]>
Newsgroups org.ozlabs.lists.linux-erofs,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 4/20/2026 11:46 AM, Gao Xiang wrote:
> On 32-bit platforms, pgoff_t is 32 bits wide, so left-shifting
> large arbitrary pgoff_t values by PAGE_SHIFT performs 32-bit arithmetic
> and silently truncates the result for pages beyond the 4 GiB boundary.
> 
> Cast the page index to loff_t before shifting to produce a correct
> 64-bit byte offset.
> 
> Fixes: 386292919c25 ("erofs: introduce readmore decompression strategy")
> Fixes: 307210c262a2 ("erofs: verify metadata accesses for file-backed mounts")
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.