netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH net] 6lowpan: add missing fragment list spinlock
Date: Wed, 5 Feb 2014 08:47:30 +0100	[thread overview]
Message-ID: <20140205074729.GA27973@omega> (raw)
In-Reply-To: <20140204.203203.1380460749447396879.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

Hi David,

thanks for your reply.

On Tue, Feb 04, 2014 at 08:32:03PM -0800, David Miller wrote:
> From: Alexander Aring <alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Date: Tue,  4 Feb 2014 11:57:53 +0100
> 
> > @@ -197,7 +197,9 @@ static void lowpan_fragment_timer_expired(unsigned long entry_addr)
> >  
> >  	pr_debug("timer expired for frame with tag %d\n", entry->tag);
> >  
> > +	spin_lock_bh(&flist_lock);
> >  	list_del(&entry->list);
> > +	spin_unlock_bh(&flist_lock);
> >  	dev_kfree_skb(entry->skb);
> >  	kfree(entry);
> >  }
> 
> This will deadlock, because the other code path holding flist_lock calls
> del_timer_sync() to wait for this timer to return.
> 
ok. I detected this some months ago and I talked with Werner Almesberger
about that. He talked something about del_timer_sync too and other
issues, but I didn't understand that I open a new deadlock case. Now I
learned something new things, thanks. :-)

> The synchornization in this code is really a big mess.

That is one thing which I also detected so I decide to make a new
implementation based on net/ipv6/reassembly.c which also used the
inet_frag api.

I will bring these patches mainline and I hope it will remove the most
of the race condigition. But then it's only solved in net-next branch.

- Alex

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk

      parent reply	other threads:[~2014-02-05  7:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 10:57 [PATCH net] 6lowpan: add missing fragment list spinlock Alexander Aring
2014-02-05  4:32 ` David Miller
     [not found]   ` <20140204.203203.1380460749447396879.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2014-02-05  7:47     ` Alexander Aring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140205074729.GA27973@omega \
    --to=alex.aring-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).