From: Xi Wang <xi.wang@gmail.com>
To: netdev@vger.kernel.org
Cc: linux-sctp@vger.kernel.org, Xi Wang <xi.wang@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Andrei Pelinescu-Onciul <andrei@iptel.org>,
Vlad Yasevich <vladislav.yasevich@hp.com>,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH RESEND] sctp: fix incorrect overflow check on autoclose
Date: Thu, 8 Dec 2011 20:24:43 -0500 [thread overview]
Message-ID: <1323393883-3759-1-git-send-email-xi.wang@gmail.com> (raw)
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@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrei Pelinescu-Onciul <andrei@iptel.org>
Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
Cc: David S. Miller <davem@davemloft.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
next reply other threads:[~2011-12-09 1:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-09 1:24 Xi Wang [this message]
2011-12-09 17:38 ` [PATCH RESEND] sctp: fix incorrect overflow check on autoclose Vladislav Yasevich
2011-12-09 18:04 ` Xi Wang
2011-12-12 22:18 ` Vladislav Yasevich
2011-12-13 22:00 ` Xi Wang
2011-12-13 22:15 ` Vladislav Yasevich
2011-12-14 21:35 ` Xi Wang
2011-12-14 21:48 ` [PATCH v2] " Xi Wang
2011-12-15 21:07 ` Vlad Yasevich
2011-12-15 22:13 ` Xi Wang
2011-12-16 13:00 ` Vlad Yasevich
2011-12-16 22:25 ` Xi Wang
2011-12-16 22:44 ` [PATCH v3] " Xi Wang
2012-01-03 15:52 ` Vladislav Yasevich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323393883-3759-1-git-send-email-xi.wang@gmail.com \
--to=xi.wang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andrei@iptel.org \
--cc=davem@davemloft.net \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vladislav.yasevich@hp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).