]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:41:20 +0000 (19:41 +0200)
commit4c8c9d5149179dc2f0585e4bedcab4897c157bc3
treeaf541953b618f1248b47c20ba9bcf1891619ccd9
parentf2565d0e527794411789f6d3387f81c759cf8d2a
libnvdimm/pmem: fix a possible OOB access when read and write pmem

[ Upstream commit 9dc6488e84b0f64df17672271664752488cd6a25 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvdimm/pmem.c