diff options
author | Linus Walleij | 2013-04-03 22:18:36 +0200 |
---|---|---|
committer | Linus Walleij | 2013-04-03 22:18:36 +0200 |
commit | 6a7b3e970426f4bc2a8d52f81a4fda6595a9f052 (patch) | |
tree | 055765564c839e456fbe4c65c8cd2c4b00d731b7 /net/sctp/socket.c | |
parent | 661462f4c6d3c9ae0bac193c65936ebfac4c95b4 (diff) | |
parent | 07961ac7c0ee8b546658717034fe692fd12eefa9 (diff) |
Merge tag 'v3.9-rc5' into devel
Linux 3.9-rc5
Conflicts:
drivers/pinctrl/pinconf.c
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index c99458df3f3f..b9070736b8d9 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -5653,6 +5653,9 @@ static int sctp_getsockopt_assoc_stats(struct sock *sk, int len, if (len < sizeof(sctp_assoc_t)) return -EINVAL; + /* Allow the struct to grow and fill in as much as possible */ + len = min_t(size_t, len, sizeof(sas)); + if (copy_from_user(&sas, optval, len)) return -EFAULT; @@ -5686,9 +5689,6 @@ static int sctp_getsockopt_assoc_stats(struct sock *sk, int len, /* Mark beginning of a new observation period */ asoc->stats.max_obs_rto = asoc->rto_min; - /* Allow the struct to grow and fill in as much as possible */ - len = min_t(size_t, len, sizeof(sas)); - if (put_user(len, optlen)) return -EFAULT; |