This patch validates that the "how" argument to shutdown()
is SHUT_RDWR, since this is the only form that TIPC supports.
Signed-off-by: Allan Stephens <[EMAIL PROTECTED]>
---
net/tipc/socket.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 2290903..e5a6983 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1419,20 +1419,25 @@ exit:
/**
* shutdown - shutdown socket connection
* @sock: socket structure
- * @how: direction to close (unused; always treated as read + write)
+ * @how: direction to close (must be SHUT_RDWR)
*
* Terminates connection (if necessary), then purges socket's receive
queue.
*
* Returns 0 on success, errno otherwise
*/
+#ifndef SHUT_RDWR
+#define SHUT_RDWR 2
+#endif
+
static int shutdown(struct socket *sock, int how)
{
struct tipc_sock* tsock = tipc_sk(sock->sk);
struct sk_buff *buf;
int res;
- /* Could return -EINVAL for an invalid "how", but why bother? */
+ if (how != SHUT_RDWR)
+ return -EINVAL;
if (down_interruptible(&tsock->sem))
return -ERESTARTSYS;
--
1.5.3.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html