]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 19:13:31 +0000 (21:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 19:13:31 +0000 (21:13 +0200)
added patches:
ipv6-remove-one-read_lock-read_unlock-pair-in-rt6_check_neigh.patch

queue-6.1/ipv6-remove-one-read_lock-read_unlock-pair-in-rt6_check_neigh.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/ipv6-remove-one-read_lock-read_unlock-pair-in-rt6_check_neigh.patch b/queue-6.1/ipv6-remove-one-read_lock-read_unlock-pair-in-rt6_check_neigh.patch
new file mode 100644 (file)
index 0000000..896f42d
--- /dev/null
@@ -0,0 +1,45 @@
+From c486640aa710ddd06c13a7f7162126e1552e8842 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet@google.com>
+Date: Mon, 13 Mar 2023 20:17:32 +0000
+Subject: ipv6: remove one read_lock()/read_unlock() pair in rt6_check_neigh()
+
+From: Eric Dumazet <edumazet@google.com>
+
+commit c486640aa710ddd06c13a7f7162126e1552e8842 upstream.
+
+rt6_check_neigh() uses read_lock() to protect n->nud_state reading.
+
+This seems overkill and causes false sharing.
+
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Reviewed-by: David Ahern <dsahern@kernel.org>
+Reviewed-by: Martin KaFai Lau <martin.lau@kernel.org>
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv6/route.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/net/ipv6/route.c
++++ b/net/ipv6/route.c
+@@ -690,16 +690,16 @@ static enum rt6_nud_state rt6_check_neig
+       neigh = __ipv6_neigh_lookup_noref(fib6_nh->fib_nh_dev,
+                                         &fib6_nh->fib_nh_gw6);
+       if (neigh) {
+-              read_lock(&neigh->lock);
+-              if (neigh->nud_state & NUD_VALID)
++              u8 nud_state = READ_ONCE(neigh->nud_state);
++
++              if (nud_state & NUD_VALID)
+                       ret = RT6_NUD_SUCCEED;
+ #ifdef CONFIG_IPV6_ROUTER_PREF
+-              else if (!(neigh->nud_state & NUD_FAILED))
++              else if (!(nud_state & NUD_FAILED))
+                       ret = RT6_NUD_SUCCEED;
+               else
+                       ret = RT6_NUD_FAIL_PROBE;
+ #endif
+-              read_unlock(&neigh->lock);
+       } else {
+               ret = IS_ENABLED(CONFIG_IPV6_ROUTER_PREF) ?
+                     RT6_NUD_SUCCEED : RT6_NUD_FAIL_DO_RR;
index bd999669daec0351febf6e33786e54f4b518e7a7..4b90a016fac71f27eb925f29a030882c96759bc5 100644 (file)
@@ -152,3 +152,4 @@ btrfs-fix-an-error-handling-path-in-btrfs_rename.patch
 btrfs-fix-fscrypt-name-leak-after-failure-to-join-log-transaction.patch
 netlink-remove-the-flex-array-from-struct-nlmsghdr.patch
 btrfs-file_remove_privs-needs-an-exclusive-lock-in-direct-io-write.patch
+ipv6-remove-one-read_lock-read_unlock-pair-in-rt6_check_neigh.patch