Re: [PATCH] brd: fix overflow in __brd_direct_access

From: Jens Axboe
Date: Wed Sep 13 2017 - 13:18:28 EST


On 09/13/2017 07:17 AM, Mikulas Patocka wrote:
> 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.

Thanks, applied with Dan's ack.

--
Jens Axboe