Revert "net: mirror skb frag ref/unref helpers"
authorMina Almasry <almasrymina@google.com>
Thu, 2 May 2024 17:54:22 +0000 (10:54 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 3 May 2024 23:05:53 +0000 (16:05 -0700)
commit173e7622ccb3f46834bd4176ed363f435e142942
treefd39a0842d666f9f90ba0740223613d16e1d08fa
parent5bfadc573711a1e68d05d25e10ae747385c4c253
Revert "net: mirror skb frag ref/unref helpers"

This reverts commit a580ea994fd37f4105028f5a85c38ff6508a2b25.

This revert is to resolve Dragos's report of page_pool leak here:
https://lore.kernel.org/lkml/20240424165646.1625690-2-dtatulea@nvidia.com/

The reverted patch interacts very badly with commit 2cc3aeb5eccc ("skbuff:
Fix a potential race while recycling page_pool packets"). The reverted
commit hopes that the pp_recycle + is_pp_page variables do not change
between the skb_frag_ref and skb_frag_unref operation. If such a change
occurs, the skb_frag_ref/unref will not operate on the same reference type.
In the case of Dragos's report, the grabbed ref was a pp ref, but the unref
was a page ref, because the pp_recycle setting on the skb was changed.

Attempting to fix this issue on the fly is risky. Lets revert and I hope
to reland this with better understanding and testing to ensure we don't
regress some edge case while streamlining skb reffing.

Fixes: a580ea994fd3 ("net: mirror skb frag ref/unref helpers")
Reported-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Mina Almasry <almasrymina@google.com>
Link: https://lore.kernel.org/r/20240502175423.2456544-1-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c
drivers/net/ethernet/sun/cassini.c
drivers/net/veth.c
include/linux/skbuff_ref.h
net/core/skbuff.c
net/tls/tls_device_fallback.c