[PATCH OLK-6.6] kasan: fix the compilation error for memcpy_mcs()

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8MWHA CVE: NA -------------------------------- Fix the compilation error when CONFIG_KASAN=y: error: implicit declaration of function ‘check_memory_region’; Fixes: 23ca830ebbef ("arm64: introduce copy_mc_to_kernel() implementation") Signed-off-by: Tong Tiangen <tongtiangen@huawei.com> --- mm/kasan/shadow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/kasan/shadow.c b/mm/kasan/shadow.c index ffaf2df1ed6e..9372f0c6f7ec 100644 --- a/mm/kasan/shadow.c +++ b/mm/kasan/shadow.c @@ -83,9 +83,9 @@ void *memcpy(void *dest, const void *src, size_t len) #undef memcpy_mcs int 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; + if (!kasan_check_range(src, len, false, _RET_IP_) || + !kasan_check_range(dest, len, true, _RET_IP_)) + return (int)len; return __memcpy_mcs(dest, src, len); } -- 2.25.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/3309 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/Z... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/3309 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/Z...
participants (2)
-
patchwork bot
-
Tong Tiangen