summaryrefslogtreecommitdiffstats
path: root/lib/test_bitmap.c
diff options
context:
space:
mode:
authorMike Kravetz2018-04-06 01:18:21 +0200
committerLinus Torvalds2018-04-06 06:36:21 +0200
commit5df63c2a149ae65a9ec239e7c2af44efa6f79beb (patch)
tree5d2d3541de5ae08a28a208c069669f75cf160b07 /lib/test_bitmap.c
parentzboot: fix stack protector in compressed boot phase (diff)
downloadkernel-qcow2-linux-5df63c2a149ae65a9ec239e7c2af44efa6f79beb.tar.gz
kernel-qcow2-linux-5df63c2a149ae65a9ec239e7c2af44efa6f79beb.tar.xz
kernel-qcow2-linux-5df63c2a149ae65a9ec239e7c2af44efa6f79beb.zip
hugetlbfs: fix bug in pgoff overflow checking
This is a fix for a regression in 32 bit kernels caused by an invalid check for pgoff overflow in hugetlbfs mmap setup. The check incorrectly specified that the size of a loff_t was the same as the size of a long. The regression prevents mapping hugetlbfs files at offsets greater than 4GB on 32 bit kernels. On 32 bit kernels conversion from a page based unsigned long can not overflow a loff_t byte offset. Therefore, skip this check if sizeof(unsigned long) != sizeof(loff_t). Link: http://lkml.kernel.org/r/20180330145402.5053-1-mike.kravetz@oracle.com Fixes: 63489f8e8211 ("hugetlbfs: check for pgoff value overflow") Reported-by: Dan Rue <dan.rue@linaro.org> Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com> Tested-by: Anders Roxell <anders.roxell@linaro.org> Cc: Michal Hocko <mhocko@kernel.org> Cc: Yisheng Xie <xieyisheng1@huawei.com> Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com> Cc: Nic Losby <blurbdust@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/test_bitmap.c')
0 files changed, 0 insertions, 0 deletions