Re: [PATCH v2] hugetlbfs: avoid overflow in hugetlbfs_fallocate

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

 



On 11/23/21 22:24, yangerkun wrote:
> luojiajun report a problem[1] two years ago which seems still exists in
> mainline. vfs_fallocate can avoid 'offset + len' trigger overflow, but
> 'offset + len + hpage_size - 1' may overflow too and will lead to a
> wrong 'end'. luojiajun give a solution which can fix the wrong 'end'
> but leave the overflow still happened. Fix it with DIV_ROUND_UP_ULL.
> 
> [1] https://patchwork.kernel.org/project/linux-mm/patch/1554775226-67213-1-git-send-email-luojiajun3@xxxxxxxxxx/
> 
> Signed-off-by: yangerkun <yangerkun@xxxxxxxxxx>
> ---
>  fs/hugetlbfs/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thank you for fixing!

Matthew, thanks for DIV_ROUND_UP_ULL!  I did not know that existed.

Reviewed-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx>

-- 
Mike Kravetz




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux