From da45d3f539c2fa4380862057036576675417bee8 Mon Sep 17 00:00:00 2001 From: hw_llm Date: Fri, 12 Jul 2024 15:03:23 +0800 Subject: [PATCH] Description: fix CVE-817641412102197248 IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IACJLK Feature Or Bugfix: Bugfix Binary Source: No Signed-off-by: hw_llm --- syscall/net_syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syscall/net_syscall.c b/syscall/net_syscall.c index b8b6aed2..22685107 100644 --- a/syscall/net_syscall.c +++ b/syscall/net_syscall.c @@ -401,7 +401,7 @@ ssize_t SysSendMsg(int s, const struct msghdr *message, int flags) CHECK_ASPACE(message, sizeof(struct msghdr)); CPY_FROM_CONST_USER(struct msghdr, message); - if (message && message->msg_iovlen > IOV_MAX) { + if (message && (size_t)message->msg_iovlen > IOV_MAX) { set_errno(EMSGSIZE); return -get_errno(); } @@ -449,7 +449,7 @@ ssize_t SysRecvMsg(int s, struct msghdr *message, int flags) CHECK_ASPACE(message, sizeof(struct msghdr)); CPY_FROM_NONCONST_USER(message); - if (message && message->msg_iovlen > IOV_MAX) { + if (message && (size_t)message->msg_iovlen > IOV_MAX) { set_errno(EMSGSIZE); return -get_errno(); }