Re: [PATCH] hugetlbfs: avoid overflow in hugetlbfs_fallocate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2021/11/24 12:24, Matthew Wilcox wrote:
On Wed, Nov 24, 2021 at 12:08:18PM +0800, yangerkun wrote:
  	start = offset >> hpage_shift;
-	end = (offset + len + hpage_size - 1) >> hpage_shift;
+	end = ((unsigned long long)offset + len + hpage_size - 1)
+		>> hpage_shift;

+	end = DIV_ROUND_UP_ULL(offset + len, hpage_size);

Thanks, will do it in v2!

.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux