diff options
author | Xin Long <lucien.xin@gmail.com> | 2019-03-03 16:50:26 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-10 07:08:59 +0100 |
commit | 9dc9563fbb3885826d9786eb5d5000995dc57b75 (patch) | |
tree | c5acd0e46224ae709842ef26daf4bf56def436f7 /net/sctp | |
parent | 43610748b73d309c17276a2042d94e6fa06df27e (diff) | |
download | talos-obmc-linux-9dc9563fbb3885826d9786eb5d5000995dc57b75.tar.gz talos-obmc-linux-9dc9563fbb3885826d9786eb5d5000995dc57b75.zip |
sctp: call iov_iter_revert() after sending ABORT
[ Upstream commit 901efe12318b1ea8d3e2c88a7b75ed6e6d5d7245 ]
The user msg is also copied to the abort packet when doing SCTP_ABORT in
sctp_sendmsg_check_sflags(). When SCTP_SENDALL is set, iov_iter_revert()
should have been called for sending abort on the next asoc with copying
this msg. Otherwise, memcpy_from_msg() in sctp_make_abort_user() will
fail and return error.
Fixes: 4910280503f3 ("sctp: add support for snd flag SCTP_SENDALL process in sendmsg")
Reported-by: Ying Xu <yinxu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@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/sctp')
-rw-r--r-- | net/sctp/socket.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 65d6d04546ae..a2771b3b3c14 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -1866,6 +1866,7 @@ static int sctp_sendmsg_check_sflags(struct sctp_association *asoc, pr_debug("%s: aborting association:%p\n", __func__, asoc); sctp_primitive_ABORT(net, asoc, chunk); + iov_iter_revert(&msg->msg_iter, msg_len); return 0; } |