diff mbox

Panic with demuxed ipv4 multicast udp sockets on 4.0.4

Message ID 0054031415584f58aeba627a5ca5aefc@svr-chch-ex1.atlnz.lc
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Gregory Hoggarth Aug. 2, 2015, 9:28 p.m. UTC
Hi Eric,

The previous fix, which included the change to __udp4_lib_rcv did not fix the issue. The reproduction rate may perhaps have been slightly lower with that fix in place, hard to tell as our automated tests unfortunately failed after 600 runs due to another issue and didn't automatically resume themselves (3 kernel crash observed, so 1/200 instead of previous 1/100).

I will apply the new suggested patch, reverting previous patch, and test overnight and update tomorrow.

Thanks,
Greg

Comments

Alex Gartrell Aug. 12, 2015, 4:13 p.m. UTC | #1
Hey Gregory,

On Sun, Aug 2, 2015 at 2:28 PM, Gregory Hoggarth
<Gregory.Hoggarth@alliedtelesis.co.nz> wrote:
> I will apply the new suggested patch, reverting previous patch, and test overnight and update tomorrow.

Did this solve your problem?  If not, would you mind sharing a repro?
Eric Dumazet Aug. 12, 2015, 6:05 p.m. UTC | #2
On Wed, 2015-08-12 at 09:13 -0700, Alex Gartrell wrote:
> Hey Gregory,
> 
> On Sun, Aug 2, 2015 at 2:28 PM, Gregory Hoggarth
> <Gregory.Hoggarth@alliedtelesis.co.nz> wrote:
> > I will apply the new suggested patch, reverting previous patch, and test overnight and update tomorrow.
> 
> Did this solve your problem?  If not, would you mind sharing a repro?
> 

https://www.mail-archive.com/netdev@vger.kernel.org/msg72736.html



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 83aa604f9273..1b8c5ba7d5f7 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1995,12 +1995,19 @@  void udp_v4_early_demux(struct sk_buff *skb)

        skb->sk = sk;
        skb->destructor = sock_efree;
-       dst = sk->sk_rx_dst;
+       dst = READ_ONCE(sk->sk_rx_dst);

        if (dst)
                dst = dst_check(dst, 0);
-       if (dst)
-               skb_dst_set_noref(skb, dst);
+       if (dst) {
+               /* DST_NOCACHE can not be used without taking a reference */
+               if (dst->flags & DST_NOCACHE) {
+                       if (likely(atomic_inc_not_zero(&dst->__refcnt)))
+                               skb_dst_set(skb, dst);
+               } else {
+                       skb_dst_set_noref(skb, dst);
+               }
+       }
 }

 int udp_rcv(struct sk_buff *skb)