ipv6: icmp: Add protection from concurrent users in the function icmpv6_echo_reply
Subsystems (3)
PATCH 1/1 ipv6: icmp: Add protection from concurrent users in the function icmpv6_echo_reply
This adds protection from concurrenct users in the function icmpv6_echo_reply around the call to the function __in6_dev_get by locking/unlocking around this call with calls to the functions rtnl_lock and rtnl_unlock to protect against concurrent users when calling this function in icmpv6_echo_reply as stated in the comments for locking requirements for the function, __in6_dev_get.
--- net/ipv6/icmp.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv6/icmp.c +2 -0
@@ -607,7 +607,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb) hlimit =ip6_sk_dst_hoplimit (np, &fl6, dst); +rtnl_lock (); idev =__in6_dev_get (skb->dev); +rtnl_unlock (); msg.skb = skb; msg.offset =0 ;
Signature · 1 line
2.5.0
Quoted 18 lines · Bastien Philbert
This adds protection from concurrenct users in the function
icmpv6_echo_replyaround the call to the function__in6_dev_getby locking/unlocking around this call with calls to the functionsrtnl_lockandrtnl_unlockto protect against concurrent users when calling this function inicmpv6_echo_replyas stated in the comments for locking requirements for the function,__in6_dev_get.Signed-off-by Bastien Philbert <[email protected]>--- net/ipv6/icmp.c | 2 ++ 1 file changed, 2 insertions(+)net/ipv6/icmp.c +0
-0
net/ipv6/icmp.c static void icmpv6_echo_reply(struct sk_buff *skb) · line 615
Quoted 9 lines
net/ipv6/icmp.c +2
-0@@ -607,7 +607,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb) hlimit =ip6_sk_dst_hoplimit (np, &fl6, dst); +rtnl_lock (); idev =__in6_dev_get (skb->dev); +rtnl_unlock (); msg.skb = skb; msg.offset =0 ;
We can't hold rtnl_lock in bh context. Have you seen a rcu verifier report? I am sure we hold rcu read lock at this point.
Bye,
Hannes