public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ding Tianhong <dingtianhong@huawei•com>
To: Cong Wang <amwang@redhat•com>, <netdev@vger•kernel.org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6•org>,
	"David S. Miller" <davem@davemloft•net>
Subject: Re: [Patch net] ipv6,mcast: always hold idev->lock before mca_lock
Date: Fri, 28 Jun 2013 14:26:07 +0800	[thread overview]
Message-ID: <51CD2C7F.5060200@huawei.com> (raw)
In-Reply-To: <20130627034204.GB18553@order.stressinduktion.org>

On 2013/6/27 11:42, Hannes Frederic Sowa wrote:
> On Thu, Jun 27, 2013 at 11:09:44AM +0800, Cong Wang wrote:
>> On Thu, 2013-06-27 at 00:58 +0200, Hannes Frederic Sowa wrote:
>>> I do confirm that if this last hunk is applied the idev->addr_list
>>> traversal
>>> is safe.
>>>
>>> Please let me know if no one is working on this, I would rebase it
>>> then. 
>>
>> I will rebase my patch on latest net-next. I am assuming this patch
>> looks good to you...
> 
> Yes, I am fine with the apporach you took. Perhaps you could describe
> why the non-idev-locked call to__ipv6_get_lladdr-call is ok in that place.
> 
> Thanks a lot,
> 
>   Hannes
> 
> 
> 
I think the problem is clear:

mld_send_report(...){
	read_lock_bh(&idev->lock);	
	add_grec(...)				
	read_unlock_bh(&idev->lock);
}
	--->add_grec(...){
		add_grhead(...)
	}
		--->add_grhead(...){
			mld_newpack(...)
		}
			--->mld_newpack(...){
				ipv6_get_lladdr(...)
			}
				--__ipv6_get_lladdr(..)		(after the patch, so it is protect by the idev->lock)
			compare
				--->ipv6_get_lladdr(...){	(before the patch)
					read_lock_bh(&idev->lock);
					...
					read_unlock_bh(&idev->lock);
				}

						
so i think it is clear to describe the reason.

  reply	other threads:[~2013-06-28  6:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-08  7:41 [Patch net] ipv6,mcast: always hold idev->lock before mca_lock Cong Wang
2013-05-08  9:47 ` dingtianhong
2013-05-08 20:16 ` David Miller
2013-05-11 23:11 ` David Miller
2013-05-27  6:52   ` dingtianhong
2013-06-06  2:35   ` Cong Wang
2013-05-21  7:01 ` dingtianhong
2013-05-21 10:10 ` Hannes Frederic Sowa
2013-06-26 22:58 ` Hannes Frederic Sowa
2013-06-27  3:09   ` Cong Wang
2013-06-27  3:42     ` Hannes Frederic Sowa
2013-06-28  6:26       ` Ding Tianhong [this message]
2013-06-28 10:46         ` Hannes Frederic Sowa

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=51CD2C7F.5060200@huawei.com \
    --to=dingtianhong@huawei$(echo .)com \
    --cc=amwang@redhat$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=yoshfuji@linux-ipv6$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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