summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2019-09-09 15:33:29 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-19 09:10:51 +0200
commitf3724b27ca29953434861b5c78e3ec101c4561a3 (patch)
tree5b328411dba210c51a97d49f3bedb3e17e6a86ca /net
parent488eefe22491e9350e2e05d3601235b4d8eec2fb (diff)
downloadlinux-stable-f3724b27ca29953434861b5c78e3ec101c4561a3.tar.gz
linux-stable-f3724b27ca29953434861b5c78e3ec101c4561a3.tar.bz2
linux-stable-f3724b27ca29953434861b5c78e3ec101c4561a3.zip
sctp: fix the missing put_user when dumping transport thresholds
[ Upstream commit f794dc2304d83ab998c2eee5bab0549aff5c53a2 ] This issue causes SCTP_PEER_ADDR_THLDS sockopt not to be able to dump a transport thresholds info. Fix it by adding 'goto' put_user in sctp_getsockopt_paddr_thresholds. Fixes: 8add543e369d ("sctp: add SCTP_FUTURE_ASSOC for SCTP_PEER_ADDR_THLDS sockopt") Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/sctp/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index f33aa9ee9e27..d0324796f0b3 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -7176,7 +7176,7 @@ static int sctp_getsockopt_paddr_thresholds(struct sock *sk,
val.spt_pathmaxrxt = trans->pathmaxrxt;
val.spt_pathpfthld = trans->pf_retrans;
- return 0;
+ goto out;
}
asoc = sctp_id2assoc(sk, val.spt_assoc_id);
@@ -7194,6 +7194,7 @@ static int sctp_getsockopt_paddr_thresholds(struct sock *sk,
val.spt_pathmaxrxt = sp->pathmaxrxt;
}
+out:
if (put_user(len, optlen) || copy_to_user(optval, &val, len))
return -EFAULT;