blob: 105263d2b905c3acdf84c3e6fccc267d3f7b0e6b [file] [log] [blame]
From 56fcec2a92dc35608fcdc9c96d3160c9919d15e9 Mon Sep 17 00:00:00 2001
From: Jie Jiang <jiejiang@chromium.org>
Date: Mon, 11 May 2020 15:30:47 +0900
Subject: [PATCH] CHROMIUM: net: Add per-netns dummy tcp_default_init_rwnd
Android P CTS test checks if it can read this tcp_default_init_rwnd,
and this change adds it to make that test able to pass. See the TEST
line below for the affected test.
tcp_default_init_rwnd is introduced into Android's kernel in
https://r.android.com/79299 and is discarded from 4.19 (see
https://r.android.com/804152). But we still need to support Android P
with kernel 5.4 in CrOS. Since the kernel no longer relies on this
value to set initial congestion window, a simple dummy handler is enough
to pass CTS test.
This change replaces the following two changes in our previous kernel:
- I386b2a9d62de0ebe05c1ebe1b4bd91b314af5c54: the ANDROID change that
adds tcp_default_init_rwnd in sysctl;
- I24482a4d4bfd6229293f4ddf457fa924cf0b01a3: the CHROMIUM change that
makes tcp_default_init_rwnd network namespace aware.
This change can be reverted when all CrOS devices running 5.4 have
updated to ARCVM.
BUG=b:154051922
TEST=cts-tradefed run commandAndExit cts -m CtsPermissionTestCases -t
android.permission.cts.FileSystemPermissionTest#testTcpDefaultRwndSane
on a careena with grunt-kernelnext passed.
Signed-off-by: Jie Jiang <jiejiang@chromium.org>
Change-Id: Ifbc056aba0f60845c192d360308f43776261f3f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2192644
Reviewed-by: Hugo Benichi <hugobenichi@google.com>
[rebase510(groeck):
Squashed:
CHROMIUM: net: Fix hang caused by dummy tcp_default_init_rwnd
]
Signed-off-by: Guenter Roeck <groeck@chromium.org>
[rebase515(groeck):
Squashed:
FIXUP: CHROMIUM: net: Add per-netns dummy tcp_default_init_rwnd
]
0-day reports:
Signed-off-by: Guenter Roeck <groeck@chromium.org>
---
include/net/netns/ipv4.h | 1 +
net/ipv4/sysctl_net_ipv4.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 73f43f699199919fdfa1fd99ba17e10cfea40fb1..8db4f7d02bca8e6dda05659c047445f937185cb4 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -116,6 +116,7 @@ struct netns_ipv4 {
#ifdef CONFIG_NET_L3_MASTER_DEV
u8 sysctl_tcp_l3mdev_accept;
#endif
+ int sysctl_tcp_default_init_rwnd;
u8 sysctl_tcp_mtu_probing;
int sysctl_tcp_mtu_probe_floor;
int sysctl_tcp_base_mss;
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index f63a545a73749714a747872457ebe097907e8ea8..44d03aeede692e8f1917b2f6d57659f925f907ab 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -212,6 +212,13 @@ static int ipv4_fwd_update_priority(struct ctl_table *table, int write,
return ret;
}
+/* The current kernel does not rely on this value so we do nothing here */
+static int proc_tcp_default_init_rwnd(struct ctl_table *ctl, int write,
+ void *buffer, size_t *lenp, loff_t *ppos)
+{
+ return proc_dointvec(ctl, write, buffer, lenp, ppos);
+}
+
static int proc_tcp_congestion_control(struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
@@ -1506,6 +1513,13 @@ static struct ctl_table ipv4_net_table[] = {
.proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ONE,
},
+ {
+ .procname = "tcp_default_init_rwnd",
+ .data = &init_net.ipv4.sysctl_tcp_default_init_rwnd,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_tcp_default_init_rwnd
+ },
{ }
};
--
2.43.0.rc2.451.g8631bc7472-goog