Blob Blame History Raw
From f5fd56c2ddbff8f29d7dbe9f2bc6f8d881e79554 Mon Sep 17 00:00:00 2001
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Fri, 28 Aug 2020 15:30:55 +0200
Subject: [PATCH 1/7] gtp: remove useless rcu_read_lock()
References: git-fixes
Patch-mainline: v5.10-rc1
Git-commit: e2d1baca2b3396371db0a6e1643e487519122069

The rtnl lock is taken just the line above, no need to take the rcu also.

Fixes: 1788b8569f5d ("gtp: fix use-after-free in gtp_encap_destroy()")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Denis Kirjanov <denis.kirjanov@suse.com>
---
 drivers/net/gtp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index 922fba970894..6dda5fd733df 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -1071,7 +1071,6 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info)
 	}
 
 	rtnl_lock();
-	rcu_read_lock();
 
 	gtp = gtp_find_dev(sock_net(skb->sk), info->attrs);
 	if (!gtp) {
@@ -1094,7 +1093,6 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info)
 	err = gtp_pdp_add(gtp, sk, info);
 
 out_unlock:
-	rcu_read_unlock();
 	rtnl_unlock();
 	return err;
 }
-- 
2.16.4