⬢ DragonFlyBSD Kernel Audit
DF-2887 / fix.diff
← back to finding ↓ download raw
--- a/sys/kern/kern_subr.c	2026-06-29 12:51:19.000000000 +0000
+++ b/sys/kern/kern_subr.c	2026-10-26 01:17:13.489632892 +0000
@@ -116,6 +116,8 @@
 
 	while (n > 0 && uio->uio_resid) {
 		iov = uio->uio_iov;
+		if (uio->uio_iovcnt < 1)
+			return (EFAULT);
 		cnt = iov->iov_len;
 		if (cnt == 0) {
 			uio->uio_iov++;
@@ -232,6 +234,8 @@
 
 	while (n > 0 && uio->uio_resid) {
 		iov = uio->uio_iov;
+		if (uio->uio_iovcnt < 1)
+			return (EFAULT);
 		cnt = iov->iov_len;
 		if (cnt == 0) {
 			uio->uio_iov++;
@@ -562,6 +566,8 @@
 
 	while (n > 0 && uio->uio_resid) {
 		iov = uio->uio_iov;
+		if (uio->uio_iovcnt < 1)
+			return (EFAULT);
 		cnt = iov->iov_len;
 		if (cnt == 0) {
 			uio->uio_iov++;