public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: paulmck@linux.vnet.ibm.com
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kvm@vger.kernel.org
Subject: Re: [BUG] kvm: dereference srcu-protected pointer without srcu_read_lock() held
Date: Wed, 21 Apr 2010 11:17:22 +0300	[thread overview]
Message-ID: <4BCEB492.1020902@redhat.com> (raw)
In-Reply-To: <20100420222108.GM2628@linux.vnet.ibm.com>

On 04/21/2010 01:21 AM, Paul E. McKenney wrote:
>
>> Subject: [PATCH] kvm: add missing srcu_read_lock()
>>
>> I got this dmesg due to srcu_read_lock() is missing in
>> kvm_mmu_notifier_release().
>>
>> ===================================================
>> [ INFO: suspicious rcu_dereference_check() usage. ]
>> ---------------------------------------------------
>> arch/x86/kvm/x86.h:72 invoked rcu_dereference_check() without protection!
>>
>> other info that might help us debug this:
>>
>>
>> rcu_scheduler_active = 1, debug_locks = 0
>> 2 locks held by qemu-system-x86/3100:
>>   #0:  (rcu_read_lock){.+.+..}, at: [<ffffffff810d73dc>] __mmu_notifier_release+0x38/0xdf
>>   #1:  (&(&kvm->mmu_lock)->rlock){+.+...}, at: [<ffffffffa0130a6a>] kvm_mmu_zap_all+0x21/0x5e [kvm]
>>
>> stack backtrace:
>> Pid: 3100, comm: qemu-system-x86 Not tainted 2.6.34-rc3-22949-gbc8a97a-dirty #2
>> Call Trace:
>>   [<ffffffff8106afd9>] lockdep_rcu_dereference+0xaa/0xb3
>>   [<ffffffffa0123a89>] unalias_gfn+0x56/0xab [kvm]
>>   [<ffffffffa0119600>] gfn_to_memslot+0x16/0x25 [kvm]
>>   [<ffffffffa012ffca>] gfn_to_rmap+0x17/0x6e [kvm]
>>   [<ffffffffa01300c1>] rmap_remove+0xa0/0x19d [kvm]
>>   [<ffffffffa0130649>] kvm_mmu_zap_page+0x109/0x34d [kvm]
>>   [<ffffffffa0130a7e>] kvm_mmu_zap_all+0x35/0x5e [kvm]
>>   [<ffffffffa0122870>] kvm_arch_flush_shadow+0x16/0x22 [kvm]
>>   [<ffffffffa01189e0>] kvm_mmu_notifier_release+0x15/0x17 [kvm]
>>   [<ffffffff810d742c>] __mmu_notifier_release+0x88/0xdf
>>   [<ffffffff810d73dc>] ? __mmu_notifier_release+0x38/0xdf
>>   [<ffffffff81040848>] ? exit_mm+0xe0/0x115
>>   [<ffffffff810c2cb0>] exit_mmap+0x2c/0x17e
>>   [<ffffffff8103c472>] mmput+0x2d/0xd4
>>   [<ffffffff81040870>] exit_mm+0x108/0x115
>> [...]
>>      
> Queued, thank you, Lai!
>    

Paul, I'd like to merge this via the kvm tree.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-04-21  8:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19  9:41 [PATCH] kvm: use the correct RCU API Lai Jiangshan
2010-04-19  9:49 ` Avi Kivity
2010-04-19 23:35   ` Paul E. McKenney
2010-04-20  2:09     ` Lai Jiangshan
2010-04-20 18:42       ` Paul E. McKenney
2010-04-19  9:58 ` [BUG] kvm: dereference srcu-protected pointer without srcu_read_lock() held Lai Jiangshan
2010-04-19 10:08   ` Avi Kivity
2010-04-20  1:45     ` Marcelo Tosatti
2010-04-20  6:29       ` Lai Jiangshan
2010-04-20 22:21         ` Paul E. McKenney
2010-04-21  8:17           ` Avi Kivity [this message]
2010-04-21 14:36             ` Paul E. McKenney
2010-04-20 21:55 ` [PATCH] kvm: use the correct RCU API Paul E. McKenney
2010-04-21  8:22   ` Avi Kivity
2010-04-21  8:22 ` Avi Kivity

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=4BCEB492.1020902@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    /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