提交 146db387 编写于 作者: T Tong Tiangen 提交者: Zheng Zengkai

uaccess: add generic fallback version of copy_mc_to_user()

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5GB28
CVE: NA

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

x86/powerpc has it's implementation of copy_mc_to_user(), we add generic
fallback in include/linux/uaccess.h prepare for other architechures to
enable CONFIG_ARCH_HAS_COPY_MC.
Signed-off-by: NTong Tiangen <tongtiangen@huawei.com>
上级 3b430dca
......@@ -388,6 +388,7 @@ copy_mc_to_user(void __user *to, const void *from, unsigned long n)
return n;
}
#define copy_mc_to_user copy_mc_to_user
#endif
#ifdef __powerpc64__
......
......@@ -447,6 +447,7 @@ copy_mc_to_kernel(void *to, const void *from, unsigned len);
unsigned long __must_check
copy_mc_to_user(void *to, const void *from, unsigned len);
#define copy_mc_to_user copy_mc_to_user
#endif
/*
......
......@@ -224,6 +224,15 @@ copy_mc_to_kernel(void *dst, const void *src, size_t cnt)
}
#endif
#ifndef copy_mc_to_user
static inline unsigned long __must_check
copy_mc_to_user(void *dst, const void *src, size_t cnt)
{
check_object_size(src, cnt, true);
return raw_copy_to_user(dst, src, cnt);
}
#endif
static __always_inline void pagefault_disabled_inc(void)
{
current->pagefault_disabled++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册