sctp: fix incorrect overflow check on autoclose
Subsystems (2)
PATCH 1/1 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.
--- net/sctp/socket.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
net/sctp/socket.c +2 -1
@@ -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 ; }
Signature · 1 line
1.7.5.4
David Miller
maintainerFrom: Xi Wang <[email protected]>
Date: Thu, 8 Dec 2011 04:09:10 -0500
Quoted 10 lines
The commit
8ffd3208voids the previous patchesf6778aaband810c0719for 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 to0xffffffff.CC Andrew Morton <[email protected]>Cc Andrei Pelinescu-Onciul <[email protected]>Cc Vlad Yasevich <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Xi Wang <[email protected]>
If you actually want me to apply this you absolutely must post it, in it's entirety, to netdev.
Quoted 2 lines · David Miller
If you actually want me to apply this you absolutely must post it, in it's entirety, to netdev.
okay will do that. thanks. ;-)
- xi