Patch "ipv6: remove one read_lock()/read_unlock() pair in rt6_check_neigh()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ipv6: remove one read_lock()/read_unlock() pair in rt6_check_neigh()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ipv6-remove-one-read_lock-read_unlock-pair-in-rt6_check_neigh.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From c486640aa710ddd06c13a7f7162126e1552e8842 Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@xxxxxxxxxx>
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@xxxxxxxxxx>

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@xxxxxxxxxx>
Reviewed-by: David Ahern <dsahern@xxxxxxxxxx>
Reviewed-by: Martin KaFai Lau <martin.lau@xxxxxxxxxx>
Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 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;


Patches currently in stable-queue which might be from edumazet@xxxxxxxxxx are

queue-6.1/neighbour-annotate-lockless-accesses-to-n-nud_state.patch
queue-6.1/mptcp-annotate-lockless-accesses-to-sk-sk_err.patch
queue-6.1/tcp-fix-delayed-acks-for-mss-boundary-condition.patch
queue-6.1/neighbour-fix-data-races-around-n-output.patch
queue-6.1/netlink-annotate-data-races-around-sk-sk_err.patch
queue-6.1/ipv4-ipv6-fix-handling-of-transhdrlen-in-__ip-6-_app.patch
queue-6.1/ipv6-remove-one-read_lock-read_unlock-pair-in-rt6_check_neigh.patch
queue-6.1/tcp-fix-quick-ack-counting-to-count-actual-acks-of-n.patch
queue-6.1/ipv6-tcp-add-a-missing-nf_reset_ct-in-3whs-handling.patch
queue-6.1/ipv6-remove-nexthop_fib6_nh_bh.patch
queue-6.1/net-fix-possible-store-tearing-in-neigh_periodic_wor.patch
queue-6.1/vrf-fix-lockdep-splat-in-output-path.patch
queue-6.1/neighbour-switch-to-standard-rcu-instead-of-rcu_bh.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux