Commit 809fd1fa authored by Jon Grimm's avatar Jon Grimm

[SCTP] Use put_user() in get_peer_addr_params (reported by yjf@standford.edu)

Standford Checker reported direct touch of user space. 
parent 0c336e6d
...@@ -693,7 +693,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk, ...@@ -693,7 +693,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
* *
* struct linger { * struct linger {
* int l_onoff; // option on/off * int l_onoff; // option on/off
* int l_linger; // linger time * int l_linger; // linger time
* }; * };
* *
* To enable the option, set l_onoff to 1. If the l_linger value is set * To enable the option, set l_onoff to 1. If the l_linger value is set
...@@ -2279,7 +2279,9 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len, ...@@ -2279,7 +2279,9 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len,
if (copy_to_user(optval, &params, len)) if (copy_to_user(optval, &params, len))
return -EFAULT; return -EFAULT;
*optlen = len;
if (put_user(len, optlen))
return -EFAULT;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment