]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: implement validate_data for sctp_stream_interleave
authorXin Long <lucien.xin@gmail.com>
Fri, 8 Dec 2017 13:04:03 +0000 (21:04 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Dec 2017 16:23:04 +0000 (11:23 -0500)
commit5c6de20ac7561dc6ff944ca0cb74c24ab9776933
treecafd57b388beae222ead30af268636082af7e237
parentf1ab92932f1fde532fa6213dd9306f9189eda930
sctp: implement validate_data for sctp_stream_interleave

validate_data is added as a member of sctp_stream_interleave, used
to validate ssn/chunk type for data or mid (message id)/chunk type
for idata, called in sctp_eat_data.

If this check fails, an abort packet will be sent, as said in
section 2.2.3 of RFC8260.

It also adds the process for idata in rx path. As Marcelo pointed
out, there's no need to add event table for idata, but just share
chunk_event_table with data's. It would drop data chunk for idata
and drop idata chunk for data by calling validate_data in
sctp_eat_data.

As last patch did, it also replaces sizeof(struct sctp_data_chunk)
with sctp_datachk_len for rx path.

After this patch, the idata can be accepted and delivered to ulp
layer.

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>
include/net/sctp/sm.h
include/net/sctp/stream_interleave.h
include/net/sctp/structs.h
net/sctp/sm_statefuns.c
net/sctp/sm_statetable.c
net/sctp/stream_interleave.c