]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Mar 2022 07:47:53 +0000 (08:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Mar 2022 07:47:53 +0000 (08:47 +0100)
added patches:
proc-fix-documentation-and-description-of-pagemap.patch
revert-xfrm-xfrm_state_mtu-should-return-at-least-1280-for-ipv6.patch

queue-5.15/proc-fix-documentation-and-description-of-pagemap.patch [new file with mode: 0644]
queue-5.15/revert-xfrm-xfrm_state_mtu-should-return-at-least-1280-for-ipv6.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/proc-fix-documentation-and-description-of-pagemap.patch b/queue-5.15/proc-fix-documentation-and-description-of-pagemap.patch
new file mode 100644 (file)
index 0000000..e6dfdf8
--- /dev/null
@@ -0,0 +1,60 @@
+From dd21bfa425c098b95ca86845f8e7d1ec1ddf6e4a Mon Sep 17 00:00:00 2001
+From: Yun Zhou <yun.zhou@windriver.com>
+Date: Fri, 4 Mar 2022 20:29:07 -0800
+Subject: proc: fix documentation and description of pagemap
+
+From: Yun Zhou <yun.zhou@windriver.com>
+
+commit dd21bfa425c098b95ca86845f8e7d1ec1ddf6e4a upstream.
+
+Since bit 57 was exported for uffd-wp write-protected (commit
+fb8e37f35a2f: "mm/pagemap: export uffd-wp protection information"),
+fixing it can reduce some unnecessary confusion.
+
+Link: https://lkml.kernel.org/r/20220301044538.3042713-1-yun.zhou@windriver.com
+Fixes: fb8e37f35a2fe1 ("mm/pagemap: export uffd-wp protection information")
+Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
+Reviewed-by: Peter Xu <peterx@redhat.com>
+Cc: Jonathan Corbet <corbet@lwn.net>
+Cc: Tiberiu A Georgescu <tiberiu.georgescu@nutanix.com>
+Cc: Florian Schmidt <florian.schmidt@nutanix.com>
+Cc: Ivan Teterevkov <ivan.teterevkov@nutanix.com>
+Cc: SeongJae Park <sj@kernel.org>
+Cc: Yang Shi <shy828301@gmail.com>
+Cc: David Hildenbrand <david@redhat.com>
+Cc: Axel Rasmussen <axelrasmussen@google.com>
+Cc: Miaohe Lin <linmiaohe@huawei.com>
+Cc: Andrea Arcangeli <aarcange@redhat.com>
+Cc: Colin Cross <ccross@google.com>
+Cc: Alistair Popple <apopple@nvidia.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/admin-guide/mm/pagemap.rst |    2 +-
+ fs/proc/task_mmu.c                       |    3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+--- a/Documentation/admin-guide/mm/pagemap.rst
++++ b/Documentation/admin-guide/mm/pagemap.rst
+@@ -23,7 +23,7 @@ There are four components to pagemap:
+     * Bit  56    page exclusively mapped (since 4.2)
+     * Bit  57    pte is uffd-wp write-protected (since 5.13) (see
+       :ref:`Documentation/admin-guide/mm/userfaultfd.rst <userfaultfd>`)
+-    * Bits 57-60 zero
++    * Bits 58-60 zero
+     * Bit  61    page is file-page or shared-anon (since 3.5)
+     * Bit  62    page swapped
+     * Bit  63    page present
+--- a/fs/proc/task_mmu.c
++++ b/fs/proc/task_mmu.c
+@@ -1582,7 +1582,8 @@ static const struct mm_walk_ops pagemap_
+  * Bits 5-54  swap offset if swapped
+  * Bit  55    pte is soft-dirty (see Documentation/admin-guide/mm/soft-dirty.rst)
+  * Bit  56    page exclusively mapped
+- * Bits 57-60 zero
++ * Bit  57    pte is uffd-wp write-protected
++ * Bits 58-60 zero
+  * Bit  61    page is file-page or shared-anon
+  * Bit  62    page swapped
+  * Bit  63    page present
diff --git a/queue-5.15/revert-xfrm-xfrm_state_mtu-should-return-at-least-1280-for-ipv6.patch b/queue-5.15/revert-xfrm-xfrm_state_mtu-should-return-at-least-1280-for-ipv6.patch
new file mode 100644 (file)
index 0000000..3245332
--- /dev/null
@@ -0,0 +1,107 @@
+From a6d95c5a628a09be129f25d5663a7e9db8261f51 Mon Sep 17 00:00:00 2001
+From: Jiri Bohac <jbohac@suse.cz>
+Date: Wed, 26 Jan 2022 16:00:18 +0100
+Subject: Revert "xfrm: xfrm_state_mtu should return at least 1280 for ipv6"
+
+From: Jiri Bohac <jbohac@suse.cz>
+
+commit a6d95c5a628a09be129f25d5663a7e9db8261f51 upstream.
+
+This reverts commit b515d2637276a3810d6595e10ab02c13bfd0b63a.
+
+Commit b515d2637276a3810d6595e10ab02c13bfd0b63a ("xfrm: xfrm_state_mtu
+should return at least 1280 for ipv6") in v5.14 breaks the TCP MSS
+calculation in ipsec transport mode, resulting complete stalls of TCP
+connections. This happens when the (P)MTU is 1280 or slighly larger.
+
+The desired formula for the MSS is:
+MSS = (MTU - ESP_overhead) - IP header - TCP header
+
+However, the above commit clamps the (MTU - ESP_overhead) to a
+minimum of 1280, turning the formula into
+MSS = max(MTU - ESP overhead, 1280) -  IP header - TCP header
+
+With the (P)MTU near 1280, the calculated MSS is too large and the
+resulting TCP packets never make it to the destination because they
+are over the actual PMTU.
+
+The above commit also causes suboptimal double fragmentation in
+xfrm tunnel mode, as described in
+https://lore.kernel.org/netdev/20210429202529.codhwpc7w6kbudug@dwarf.suse.cz/
+
+The original problem the above commit was trying to fix is now fixed
+by commit 6596a0229541270fb8d38d989f91b78838e5e9da ("xfrm: fix MTU
+regression").
+
+Signed-off-by: Jiri Bohac <jbohac@suse.cz>
+Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/net/xfrm.h    |    1 -
+ net/ipv4/esp4.c       |    2 +-
+ net/ipv6/esp6.c       |    2 +-
+ net/xfrm/xfrm_state.c |   14 ++------------
+ 4 files changed, 4 insertions(+), 15 deletions(-)
+
+--- a/include/net/xfrm.h
++++ b/include/net/xfrm.h
+@@ -1567,7 +1567,6 @@ void xfrm_sad_getinfo(struct net *net, s
+ void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si);
+ u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq);
+ int xfrm_init_replay(struct xfrm_state *x);
+-u32 __xfrm_state_mtu(struct xfrm_state *x, int mtu);
+ u32 xfrm_state_mtu(struct xfrm_state *x, int mtu);
+ int __xfrm_init_state(struct xfrm_state *x, bool init_replay, bool offload);
+ int xfrm_init_state(struct xfrm_state *x);
+--- a/net/ipv4/esp4.c
++++ b/net/ipv4/esp4.c
+@@ -671,7 +671,7 @@ static int esp_output(struct xfrm_state
+               struct xfrm_dst *dst = (struct xfrm_dst *)skb_dst(skb);
+               u32 padto;
+-              padto = min(x->tfcpad, __xfrm_state_mtu(x, dst->child_mtu_cached));
++              padto = min(x->tfcpad, xfrm_state_mtu(x, dst->child_mtu_cached));
+               if (skb->len < padto)
+                       esp.tfclen = padto - skb->len;
+       }
+--- a/net/ipv6/esp6.c
++++ b/net/ipv6/esp6.c
+@@ -708,7 +708,7 @@ static int esp6_output(struct xfrm_state
+               struct xfrm_dst *dst = (struct xfrm_dst *)skb_dst(skb);
+               u32 padto;
+-              padto = min(x->tfcpad, __xfrm_state_mtu(x, dst->child_mtu_cached));
++              padto = min(x->tfcpad, xfrm_state_mtu(x, dst->child_mtu_cached));
+               if (skb->len < padto)
+                       esp.tfclen = padto - skb->len;
+       }
+--- a/net/xfrm/xfrm_state.c
++++ b/net/xfrm/xfrm_state.c
+@@ -2571,7 +2571,7 @@ void xfrm_state_delete_tunnel(struct xfr
+ }
+ EXPORT_SYMBOL(xfrm_state_delete_tunnel);
+-u32 __xfrm_state_mtu(struct xfrm_state *x, int mtu)
++u32 xfrm_state_mtu(struct xfrm_state *x, int mtu)
+ {
+       const struct xfrm_type *type = READ_ONCE(x->type);
+       struct crypto_aead *aead;
+@@ -2602,17 +2602,7 @@ u32 __xfrm_state_mtu(struct xfrm_state *
+       return ((mtu - x->props.header_len - crypto_aead_authsize(aead) -
+                net_adj) & ~(blksize - 1)) + net_adj - 2;
+ }
+-EXPORT_SYMBOL_GPL(__xfrm_state_mtu);
+-
+-u32 xfrm_state_mtu(struct xfrm_state *x, int mtu)
+-{
+-      mtu = __xfrm_state_mtu(x, mtu);
+-
+-      if (x->props.family == AF_INET6 && mtu < IPV6_MIN_MTU)
+-              return IPV6_MIN_MTU;
+-
+-      return mtu;
+-}
++EXPORT_SYMBOL_GPL(xfrm_state_mtu);
+ int __xfrm_init_state(struct xfrm_state *x, bool init_replay, bool offload)
+ {
index f70ad123e12758f5a1eec41f71d02e807a81f4a1..e1e3a9c8b52f80cee683a5a379bb1b067ef677e9 100644 (file)
@@ -257,3 +257,5 @@ btrfs-do-not-warn_on-if-we-have-pageerror-set.patch
 btrfs-qgroup-fix-deadlock-between-rescan-worker-and-remove-qgroup.patch
 btrfs-add-missing-run-of-delayed-items-after-unlink-during-log-replay.patch
 btrfs-do-not-start-relocation-until-in-progress-drops-are-done.patch
+revert-xfrm-xfrm_state_mtu-should-return-at-least-1280-for-ipv6.patch
+proc-fix-documentation-and-description-of-pagemap.patch