diff --git a/Kernel/Syscalls/read.cpp b/Kernel/Syscalls/read.cpp index b9c1256270..801e84d250 100644 --- a/Kernel/Syscalls/read.cpp +++ b/Kernel/Syscalls/read.cpp @@ -36,12 +36,9 @@ ssize_t Process::sys$readv(int fd, Userspace iov, int iov_c if (iov_count < 0) return -EINVAL; - { - Checked checked_iov_count = sizeof(iovec); - checked_iov_count *= iov_count; - if (checked_iov_count.has_overflow()) - return -EFAULT; - } + // Arbitrary pain threshold. + if (iov_count > (int)MiB) + return -EFAULT; u64 total_length = 0; Vector vecs;