[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110812210553.507379033@clark.kroah.org>
Date: Fri, 12 Aug 2011 14:04:01 -0700
From: Greg KH <gregkh@...e.de>
To: linux-kernel@...r.kernel.org, stable@...nel.org
Cc: stable-review@...nel.org, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, alan@...rguk.ukuu.org.uk,
Anton Blanchard <anton@...ba.org>,
"David S. Miller" <davem@...emloft.net>
Subject: [16/90] net: Cap number of elements for sendmmsg
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Anton Blanchard <anton@...ba.org>
commit 98382f419f32d2c12d021943b87dea555677144b upstream.
To limit the amount of time we can spend in sendmmsg, cap the
number of elements to UIO_MAXIOV (currently 1024).
For error handling an application using sendmmsg needs to retry at
the first unsent message, so capping is simpler and requires less
application logic than returning EINVAL.
Signed-off-by: Anton Blanchard <anton@...ba.org>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
net/socket.c | 3 +++
1 file changed, 3 insertions(+)
--- a/net/socket.c
+++ b/net/socket.c
@@ -1999,6 +1999,9 @@ int __sys_sendmmsg(int fd, struct mmsghd
struct compat_mmsghdr __user *compat_entry;
struct msghdr msg_sys;
+ if (vlen > UIO_MAXIOV)
+ vlen = UIO_MAXIOV;
+
datagrams = 0;
sock = sockfd_lookup_light(fd, &err, &fput_needed);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists