summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io_uring/net.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index 616d5f04cc74..6b7d5f33e642 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -327,14 +327,14 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags)
static bool io_recvmsg_multishot_overflow(struct io_async_msghdr *iomsg)
{
- unsigned long hdr;
+ int hdr;
- if (check_add_overflow(sizeof(struct io_uring_recvmsg_out),
- (unsigned long)iomsg->namelen, &hdr))
+ if (iomsg->namelen < 0)
return true;
- if (check_add_overflow(hdr, iomsg->controllen, &hdr))
+ if (check_add_overflow((int)sizeof(struct io_uring_recvmsg_out),
+ iomsg->namelen, &hdr))
return true;
- if (hdr > INT_MAX)
+ if (check_add_overflow(hdr, (int)iomsg->controllen, &hdr))
return true;
return false;