Revert "gtp: annotate PDP lookups under RTNL"
Subsystems (3)
Simon Horman
reviewerPATCH 1/1 Revert "gtp: annotate PDP lookups under RTNL"
This reverts commit 0be5c3f0fbef3679f50f345b9237b8f9ea5de4e9.
Commit 0be5c3f0fbef ("gtp: annotate PDP lookups under RTNL") added a lockdep_rtnl_is_held condition to hlist_for_each_rcu() loops to help insure that RTNL is held.
Unfortunately, as pointed out by Pablo Neira Ayuso, the PDP context list is actually protected by the genetlink mutex. And so the condition is incorrect.
Compile tested only.
--- drivers/net/gtp.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/net/gtp.c +4 -8
@@ -151,8 +151,7 @@ static struct pdp_ctx *gtp0_pdp_find(struct gtp_dev *gtp, u64 tid, u16 family) head = >p->tid_hash[gtp0_hashfn (tid) % gtp->hash_size]; -hlist_for_each_entry_rcu (pdp, head, hlist_tid, -lockdep_rtnl_is_held ()) { +hlist_for_each_entry_rcu (pdp, head, hlist_tid) {if (pdp->af == family && pdp->gtp_version ==GTP_V0 && pdp->u.v0.tid == tid)
@@ -169,8 +168,7 @@ static struct pdp_ctx *gtp1_pdp_find(struct gtp_dev *gtp, u32 tid, u16 family) head = >p->tid_hash[gtp1u_hashfn (tid) % gtp->hash_size]; -hlist_for_each_entry_rcu (pdp, head, hlist_tid, -lockdep_rtnl_is_held ()) { +hlist_for_each_entry_rcu (pdp, head, hlist_tid) {if (pdp->af == family && pdp->gtp_version ==GTP_V1 && pdp->u.v1.i_tei == tid)
@@ -187,8 +185,7 @@ static struct pdp_ctx *ipv4_pdp_find(struct gtp_dev *gtp, __be32 ms_addr) head = >p->addr_hash[ipv4_hashfn (ms_addr) % gtp->hash_size]; -hlist_for_each_entry_rcu (pdp, head, hlist_addr, -lockdep_rtnl_is_held ()) { +hlist_for_each_entry_rcu (pdp, head, hlist_addr) {if (pdp->af ==AF_INET && pdp->ms.addr.s_addr == ms_addr)return pdp;
@@ -223,8 +220,7 @@ static struct pdp_ctx *ipv6_pdp_find(struct gtp_dev *gtp, head = >p->addr_hash[ipv6_hashfn (ms_addr) % gtp->hash_size]; -hlist_for_each_entry_rcu (pdp, head, hlist_addr, -lockdep_rtnl_is_held ()) { +hlist_for_each_entry_rcu (pdp, head, hlist_addr) {if (pdp->af ==AF_INET6 &&ipv6_pdp_addr_equal (&pdp->ms.addr6, ms_addr))return pdp;
Jakub Kicinski
maintainerQuoted 9 lines · On Wed, 08 Jul 2026 20:02:05 +0100 Simon Horman wrote:
This reverts commit
0be5c3f0fbef3679f50f345b9237b8f9ea5de4e9.Commit
0be5c3f0fbef("gtp: annotate PDP lookups under RTNL") added alockdep_rtnl_is_heldcondition tohlist_for_each_rcu()loops to help insure that RTNL is held.Unfortunately, as pointed out by Pablo Neira Ayuso, the PDP context list is actually protected by the genetlink mutex. And so the condition is incorrect.
In the future please remember to add a Link: to the message being referenced.
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Wed, 08 Jul 2026 20:02:05 +0100 you wrote:
This reverts commit
0be5c3f0fbef3679f50f345b9237b8f9ea5de4e9.Commit
0be5c3f0fbef("gtp: annotate PDP lookups under RTNL") added alockdep_rtnl_is_heldcondition tohlist_for_each_rcu()loops to help insure that RTNL is held.Unfortunately, as pointed out by Pablo Neira Ayuso, the PDP context list is actually protected by the genetlink mutex. And so the condition is incorrect.
[...]
Here is the summary with links:
- [net-next] Revert "gtp: annotate PDP lookups under RTNL"
https://git.kernel.org/netdev/net-next/c/860b693bca59
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html