]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: fix data_fin handing in RX path
authorPaolo Abeni <pabeni@redhat.com>
Wed, 22 Apr 2020 16:24:56 +0000 (18:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Apr 2020 02:46:01 +0000 (19:46 -0700)
commitafd42354a2ed7e06fe46b6818f0a74e41d6e77c6
tree20d71875e6cca8f3add442d99011d507719ed40a
parent9d26438be54f5d9b179384be8870a62504d20e25
mptcp: fix data_fin handing in RX path

The data fin flag is set only via a DSS option, but
mptcp_incoming_options() copies it unconditionally from the
provided RX options.

Since we do not clear all the mptcp sock RX options in a
socket free/alloc cycle, we can end-up with a stray data_fin
value while parsing e.g. MPC packets.

That would lead to mapping data corruption and will trigger
a few WARN_ON() in the RX path.

Instead of adding a costly memset(), fetch the data_fin flag
only for DSS packets - when we always explicitly initialize
such bit at option parsing time.

Fixes: 8af026c2830e ("mptcp: Implement MPTCP receive path")
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/options.c