summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2020-11-08 19:49:59 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-18 19:22:32 +0100
commitb288c0456ba2fa75deaf4a08ac9881fba8af9bb9 (patch)
treeceab4f8a0d3e24255456087ded7bae4178a138d2
parent0ed125fd6e041b3ad65702fcd4619b27319cc3fd (diff)
downloadlinux-stable-b288c0456ba2fa75deaf4a08ac9881fba8af9bb9.tar.gz
linux-stable-b288c0456ba2fa75deaf4a08ac9881fba8af9bb9.tar.bz2
linux-stable-b288c0456ba2fa75deaf4a08ac9881fba8af9bb9.zip
mptcp: provide rmem[0] limit
[ Upstream commit 989ef49bdf100cc772b3a8737089df36b1ab1e30 ] The mptcp proto struct currently does not provide the required limit for forward memory scheduling. Under pressure sk_rmem_schedule() will unconditionally try to use such field and will oops. Address the issue inheriting the tcp limit, as we already do for the wmem one. Fixes: 9c3f94e1681b ("mptcp: add missing memory scheduling in the rx path") Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net> Link: https://lore.kernel.org/r/37af798bd46f402fb7c79f57ebbdd00614f5d7fa.1604861097.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/mptcp/protocol.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b295eb6e9580..9adfa8a18579 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2122,6 +2122,7 @@ static struct proto mptcp_prot = {
.memory_pressure = &tcp_memory_pressure,
.stream_memory_free = mptcp_memory_free,
.sysctl_wmem_offset = offsetof(struct net, ipv4.sysctl_tcp_wmem),
+ .sysctl_rmem_offset = offsetof(struct net, ipv4.sysctl_tcp_rmem),
.sysctl_mem = sysctl_tcp_mem,
.obj_size = sizeof(struct mptcp_sock),
.slab_flags = SLAB_TYPESAFE_BY_RCU,