[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1323393883-3759-1-git-send-email-xi.wang@gmail.com>
Date: Thu, 8 Dec 2011 20:24:43 -0500
From: Xi Wang <xi.wang@...il.com>
To: netdev@...r.kernel.org
Cc: linux-sctp@...r.kernel.org, Xi Wang <xi.wang@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrei Pelinescu-Onciul <andrei@...el.org>,
Vlad Yasevich <vladislav.yasevich@...com>,
"David S. Miller" <davem@...emloft.net>
Subject: [PATCH RESEND] sctp: fix incorrect overflow check on autoclose
The commit 8ffd3208 voids the previous patches f6778aab and 810c0719
for limiting the maximum autoclose value. If userspace passes in -1
on 32-bit platform, the overflow check didn't work and autoclose
would be set to 0xffffffff.
Signed-off-by: Xi Wang <xi.wang@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrei Pelinescu-Onciul <andrei@...el.org>
Cc: Vlad Yasevich <vladislav.yasevich@...com>
Cc: David S. Miller <davem@...emloft.net>
---
net/sctp/socket.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 13bf5fc..bb91281 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2201,7 +2201,8 @@ static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval,
if (copy_from_user(&sp->autoclose, optval, optlen))
return -EFAULT;
/* make sure it won't exceed MAX_SCHEDULE_TIMEOUT */
- sp->autoclose = min_t(long, sp->autoclose, MAX_SCHEDULE_TIMEOUT / HZ);
+ sp->autoclose = min_t(unsigned long, sp->autoclose,
+ MAX_SCHEDULE_TIMEOUT / HZ);
return 0;
}
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists