OSDN Git Service

dax: Check the end of the block-device capacity with dax_direct_access()
authorDan Williams <dan.j.williams@intel.com>
Thu, 21 Feb 2019 05:12:50 +0000 (21:12 -0800)
committerDan Williams <dan.j.williams@intel.com>
Thu, 21 Feb 2019 05:12:50 +0000 (21:12 -0800)
commitad428cdb525a97d15c0349fdc80f3d58befb50df
tree31bebae17f60a5e5a214e135e216fab74e840966
parentfa7d2e639cd90442d868dfc6ca1d4cc9d8bf206e
dax: Check the end of the block-device capacity with dax_direct_access()

The checks in __bdev_dax_supported() helped mitigate a potential data
corruption bug in the pmem driver's handling of section alignment
padding. Strengthen the checks, including checking the end of the range,
to validate the dev_pagemap, Xarray entries, and sector-to-pfn
translation established for pmem namespaces.

Acked-by: Jan Kara <jack@suse.cz>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dax/super.c