summaryrefslogtreecommitdiffstats
path: root/drivers/block/amiflop.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2017-09-13 15:17:57 +0200
committerJens Axboe <axboe@kernel.dk>2017-09-25 16:56:05 +0200
commit02a4843618fb35f847cf8c31cd3893873aa0edde (patch)
tree07a8caec8d3ab5e68f42026f9bea8cad31a968ce /drivers/block/amiflop.c
parentMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/... (diff)
downloadlinux-02a4843618fb35f847cf8c31cd3893873aa0edde.tar.xz
linux-02a4843618fb35f847cf8c31cd3893873aa0edde.zip
brd: fix overflow in __brd_direct_access
The code in __brd_direct_access multiplies the pgoff variable by page size and divides it by 512. It can cause overflow on 32-bit architectures. The overflow happens if we create ramdisk larger than 4G and use it as a sparse device. This patch replaces multiplication and division with multiplication by the number of sectors per page. Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Fixes: 1647b9b959c7 ("brd: add dax_operations support") Cc: stable@vger.kernel.org # 4.12+ Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/amiflop.c')
0 files changed, 0 insertions, 0 deletions