summaryrefslogtreecommitdiffstats
path: root/net/mptcp/mib.c
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2021-07-10 02:20:51 +0200
committerDavid S. Miller <davem@davemloft.net>2021-07-10 03:38:53 +0200
commitce599c516386f09ca30848a1a4eb93d3fffbe187 (patch)
tree25e8811ed4d7a8fbfea62409158434e5e27ac77b /net/mptcp/mib.c
parentselftests: mptcp: fix case multiple subflows limited by server (diff)
downloadlinux-ce599c516386f09ca30848a1a4eb93d3fffbe187.tar.xz
linux-ce599c516386f09ca30848a1a4eb93d3fffbe187.zip
mptcp: properly account bulk freed memory
After commit 879526030c8b ("mptcp: protect the rx path with the msk socket spinlock") the rmem currently used by a given msk is really sk_rmem_alloc - rmem_released. The safety check in mptcp_data_ready() does not take the above in due account, as a result legit incoming data is kept in subflow receive queue with no reason, delaying or blocking MPTCP-level ack generation. This change addresses the issue introducing a new helper to fetch the rmem memory and using it as needed. Additionally add a MIB counter for the exceptional event described above - the peer is misbehaving. Finally, introduce the required annotation when rmem_released is updated. Fixes: 879526030c8b ("mptcp: protect the rx path with the msk socket spinlock") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/211 Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/mib.c')
-rw-r--r--net/mptcp/mib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mptcp/mib.c b/net/mptcp/mib.c
index 52ea2517e856..ff2cc0e3273d 100644
--- a/net/mptcp/mib.c
+++ b/net/mptcp/mib.c
@@ -44,6 +44,7 @@ static const struct snmp_mib mptcp_snmp_list[] = {
SNMP_MIB_ITEM("RmSubflow", MPTCP_MIB_RMSUBFLOW),
SNMP_MIB_ITEM("MPPrioTx", MPTCP_MIB_MPPRIOTX),
SNMP_MIB_ITEM("MPPrioRx", MPTCP_MIB_MPPRIORX),
+ SNMP_MIB_ITEM("RcvPruned", MPTCP_MIB_RCVPRUNED),
SNMP_MIB_SENTINEL
};