diff options
author | Andrei Pelinescu-Onciul <andrei@iptel.org> | 2009-11-23 15:54:01 -0500 |
---|---|---|
committer | Vlad Yasevich <vladislav.yasevich@hp.com> | 2009-11-23 15:54:01 -0500 |
commit | da85b7396f3b6cb3fea7d77091498bfa1051ef7c (patch) | |
tree | 692d41265fdff68172ea6cd4e70e9efbd40fe88e /net/sctp | |
parent | f6778aab6ccc4b510b4dcfa770d9949b696b4545 (diff) | |
download | linux-da85b7396f3b6cb3fea7d77091498bfa1051ef7c.tar.gz linux-da85b7396f3b6cb3fea7d77091498bfa1051ef7c.tar.bz2 linux-da85b7396f3b6cb3fea7d77091498bfa1051ef7c.zip |
sctp: fix integer overflow when setting the autoclose timer
When setting the autoclose timeout in jiffies there is a possible
integer overflow if the value in seconds is very large
(e.g. for 2^22 s with HZ=1024). The problem appears even on
64-bit due to the integer promotion rules. The fix is just a cast
to unsigned long.
Signed-off-by: Andrei Pelinescu-Onciul <andrei@iptel.org>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/associola.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 880dae2ca87b..6e96f83570c9 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -167,7 +167,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a asoc->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = 0; asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = asoc->sackdelay; asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] = - sp->autoclose * HZ; + (unsigned long)sp->autoclose * HZ; /* Initilizes the timers */ for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i) |