Mikulas Patocka 02a4843618 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>
2017-09-25 08:56:05 -06:00
..
2017-09-25 08:56:05 -06:00
2017-09-07 21:11:05 -07:00
2017-09-01 13:57:35 -06:00
2017-08-24 22:28:57 -04:00
2017-08-28 15:21:27 -06:00
2017-02-20 12:16:15 +01:00
2017-08-18 08:45:29 -06:00