Re: [syzbot] [can?] WARNING: refcount bug in j1939_session_put
From: Edward Adam Davis
Date: Tue Aug 06 2024 - 21:04:21 EST
because enabled CONFIG_DEBUG_NET, make refcount wrong dec?
#syz test: net-next 743ff02152bc
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index cf8f6ce06742..29c3ea5b6e93 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1225,7 +1225,7 @@ static inline bool skb_unref(struct sk_buff *skb)
{
if (unlikely(!skb))
return false;
- if (!IS_ENABLED(CONFIG_DEBUG_NET) && likely(refcount_read(&skb->users) == 1))
+ if (likely(refcount_read(&skb->users) == 1))
smp_rmb();
else if (likely(!refcount_dec_and_test(&skb->users)))
return false;