libnvdimm/pmem: fix a possible OOB access when read and write pmem
authorLi RongQing <lirongqing@baidu.com>
Thu, 4 Apr 2019 02:58:01 +0000 (10:58 +0800)
committerDan Williams <dan.j.williams@intel.com>
Sun, 7 Apr 2019 21:36:04 +0000 (14:36 -0700)
commit9dc6488e84b0f64df17672271664752488cd6a25
treeb72072d511728753fabada8b2b7cce287072b288
parentd2e5b6436c28e7ee4988497d31122e06217876fb
libnvdimm/pmem: fix a possible OOB access when read and write pmem

If offset is not zero and length is bigger than PAGE_SIZE,
this will cause to out of boundary access to a page memory

Fixes: 98cc093cba1e ("block, THP: make block_device_operations.rw_page support THP")
Co-developed-by: Liang ZhiCheng <liangzhicheng@baidu.com>
Signed-off-by: Liang ZhiCheng <liangzhicheng@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/pmem.c