提交 35eb2715 编写于 作者: T Tong Tiangen

kasan: add kasan support for memcpy_mcs()

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

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

The function memcpy_mcs() is designed to copy in memory and should be
supported by kasan.
Signed-off-by: NTong Tiangen <tongtiangen@huawei.com>
上级 67a4d725
......@@ -109,6 +109,18 @@ void *memcpy(void *dest, const void *src, size_t len)
return __memcpy(dest, src, len);
}
#ifdef __HAVE_ARCH_MEMCPY_MC
#undef memcpy_mcs
unsigned long memcpy_mcs(void *dest, const void *src, size_t len)
{
if (!check_memory_region((unsigned long)src, len, false, _RET_IP_) ||
!check_memory_region((unsigned long)dest, len, true, _RET_IP_))
return (unsigned long)len;
return __memcpy_mcs(dest, src, len);
}
#endif
/*
* Poisons the shadow memory for 'size' bytes starting from 'addr'.
* Memory addresses should be aligned to KASAN_SHADOW_SCALE_SIZE.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册