提交 ed1fe57a 编写于 作者: T Tong Tiangen 提交者: Yang Yingliang

uce: pagecache reading scenario add shmem support

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I44REB
CVE: NA

---------------------------

The call trace is as follows:
  __arch_copy_to_user+0x1bc/0x21c
  copy_page_to_iter+0xdc/0x328
  shmem_file_read_iter+0x124/0x350
  __vfs_read+0x11c/0x188
  vfs_read+0x94/0x150
  ksys_read+0x6c/0xd8
  __arm64_sys_read+0x24/0x30
  el0_svc_common+0x78/0x130
  el0_svc_handler+0x38/0x78
  el0_svc+0x8/0xc

This patch add uce kernel recovery path support in shmem_file_read_iter().
Signed-off-by: NTong Tiangen <tongtiangen@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 93ff5b49
...@@ -2661,7 +2661,14 @@ static ssize_t shmem_file_read_iter(struct kiocb *iocb, struct iov_iter *to) ...@@ -2661,7 +2661,14 @@ static ssize_t shmem_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
* Ok, we have the page, and it's up-to-date, so * Ok, we have the page, and it's up-to-date, so
* now we can copy it to user space... * now we can copy it to user space...
*/ */
#ifdef CONFIG_UCE_KERNEL_RECOVERY
if (is_pagecache_reading_kernel_recovery_enable())
ret = copy_page_to_iter_generic_read(page, offset, nr, to);
else
ret = copy_page_to_iter(page, offset, nr, to);
#else
ret = copy_page_to_iter(page, offset, nr, to); ret = copy_page_to_iter(page, offset, nr, to);
#endif
retval += ret; retval += ret;
offset += ret; offset += ret;
index += offset >> PAGE_SHIFT; index += offset >> PAGE_SHIFT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册