linux-stable/net/sctp
Xin Long 8a7952ec41 sctp: fix the processing for INIT_ACK chunk
commit 438b95a7c9 upstream.

Currently INIT_ACK chunk in non-cookie_echoed state is processed in
sctp_sf_discard_chunk() to send an abort with the existent asoc's
vtag if the chunk length is not valid. But the vtag in the chunk's
sctphdr is not verified, which may be exploited by one to cook a
malicious chunk to terminal a SCTP asoc.

sctp_sf_discard_chunk() also is called in many other places to send
an abort, and most of those have this problem. This patch is to fix
it by sending abort with the existent asoc's vtag only if the vtag
from the chunk's sctphdr is verified in sctp_sf_discard_chunk().

Note on sctp_sf_do_9_1_abort() and sctp_sf_shutdown_pending_abort(),
the chunk length has been verified before sctp_sf_discard_chunk(),
so replace it with sctp_sf_discard(). On sctp_sf_do_asconf_ack() and
sctp_sf_do_asconf(), move the sctp_chunk_length_valid check ahead of
sctp_sf_discard_chunk(), then replace it with sctp_sf_discard().

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-23 09:01:34 +01:00
..
associola.c sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket 2020-06-30 15:37:59 -04:00
auth.c sctp: fix sctp_auth_init_hmacs() error path 2020-10-14 09:51:12 +02:00
bind_addr.c sctp: validate from_addr_param return 2021-07-20 16:17:45 +02:00
chunk.c sctp: fix erroneous inc of snmp SctpFragUsrMsgs 2018-08-24 13:09:03 +02:00
debug.c sctp: remove the typedef sctp_subtype_t 2017-08-06 21:33:42 -07:00
endpointola.c sctp: use call_rcu to free endpoint 2022-01-05 12:33:49 +01:00
input.c sctp: break out if skb_header_pointer returns NULL in sctp_rcv_ootb 2021-10-06 15:05:08 +02:00
inqueue.c sctp: fix the issue that the cookie-ack with auth can't get processed 2018-05-19 10:20:25 +02:00
ipv6.c sctp: validate from_addr_param return 2021-07-20 16:17:45 +02:00
Kconfig
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
objcnt.c sctp: remove the typedef sctp_dbg_objcnt_entry_t 2017-08-11 10:02:43 -07:00
offload.c sctp: call gso_reset_checksum when computing checksum in sctp_gso_segment 2019-02-27 10:08:06 +01:00
output.c sctp: remove the typedef sctp_xmit_t 2017-08-06 21:33:42 -07:00
outqueue.c sctp: only update outstanding_bytes for transmitted queue when doing prsctp_prune 2018-02-25 11:07:57 +01:00
primitive.c sctp: remove the typedef sctp_subtype_t 2017-08-06 21:33:42 -07:00
probe.c sctp: remove the typedef sctp_disposition_t 2017-08-11 10:02:44 -07:00
proc.c sctp: hold transport before accessing its asoc in sctp_transport_get_next 2018-09-15 09:45:25 +02:00
protocol.c sctp: move 198 addresses from unusable to private scope 2021-08-04 12:22:15 +02:00
sctp_diag.c sctp: fix kernel-infoleak for SCTP sockets 2022-03-16 12:57:07 +01:00
sm_make_chunk.c sctp: account stream padding length for reconf chunk 2021-10-20 10:42:05 +02:00
sm_sideeffect.c sctp: change to hold/put transport for proto_unreach_timer 2020-11-24 13:05:41 +01:00
sm_statefuns.c sctp: fix the processing for INIT_ACK chunk 2022-03-23 09:01:34 +01:00
sm_statetable.c sctp: remove the typedef sctp_sm_table_entry_t 2017-08-11 10:02:44 -07:00
socket.c sctp: use call_rcu to free endpoint 2022-01-05 12:33:49 +01:00
stream.c sctp: improve the events for sctp stream reset 2019-02-06 17:31:33 +01:00
sysctl.c sctp: remove the typedef sctp_scope_policy_t 2017-08-06 21:33:41 -07:00
transport.c sctp: change to hold/put transport for proto_unreach_timer 2020-11-24 13:05:41 +01:00
tsnmap.c
ulpevent.c sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_make_rcvmsg 2018-05-19 10:20:25 +02:00
ulpqueue.c sctp: fix the issue that a __u16 variable may overflow in sctp_ulpq_renege 2018-03-03 10:24:24 +01:00