Re: kvm: use-after-free in process_srcu

2017-01-19 Thread Paul McKenney
(Trouble with VPN, so replying from gmail.) On Thu, Jan 19, 2017 at 1:27 AM, Paolo Bonzini wrote: > > > On 18/01/2017 23:15, Paul E. McKenney wrote: >> On Wed, Jan 18, 2017 at 09:53:19AM +0100, Paolo Bonzini wrote: >>> >>> >>> On 17/01/2017 21:34, Paul E. McKenney wrote: Do any of your callb

Re: kvm: use-after-free in process_srcu

2017-01-19 Thread Paolo Bonzini
On 18/01/2017 23:15, Paul E. McKenney wrote: > On Wed, Jan 18, 2017 at 09:53:19AM +0100, Paolo Bonzini wrote: >> >> >> On 17/01/2017 21:34, Paul E. McKenney wrote: >>> Do any of your callback functions invoke call_srcu()? (Hey, I have to ask!) >> >> No, we only use synchronize_srcu and synchroni

Re: kvm: use-after-free in process_srcu

2017-01-18 Thread Paul E. McKenney
On Wed, Jan 18, 2017 at 09:53:19AM +0100, Paolo Bonzini wrote: > > > On 17/01/2017 21:34, Paul E. McKenney wrote: > > Do any of your callback functions invoke call_srcu()? (Hey, I have to ask!) > > No, we only use synchronize_srcu and synchronize_srcu_expedited, so our > only callback comes fro

Re: kvm: use-after-free in process_srcu

2017-01-18 Thread Paolo Bonzini
On 17/01/2017 21:34, Paul E. McKenney wrote: > Do any of your callback functions invoke call_srcu()? (Hey, I have to ask!) No, we only use synchronize_srcu and synchronize_srcu_expedited, so our only callback comes from there. From: Paolo Bonzini Subject: [PATCH] srcu: wait for all

Re: kvm: use-after-free in process_srcu

2017-01-17 Thread Paul E. McKenney
On Tue, Jan 17, 2017 at 01:03:28PM +0100, Paolo Bonzini wrote: > > > On 17/01/2017 12:13, Dmitry Vyukov wrote: > > On Tue, Jan 17, 2017 at 12:08 PM, Paolo Bonzini wrote: > >> > >> > >> On 17/01/2017 10:56, Dmitry Vyukov wrote: > I am seeing use-after-frees in process_srcu as struct srcu_str

Re: kvm: use-after-free in process_srcu

2017-01-17 Thread Paolo Bonzini
On 17/01/2017 12:13, Dmitry Vyukov wrote: > On Tue, Jan 17, 2017 at 12:08 PM, Paolo Bonzini wrote: >> >> >> On 17/01/2017 10:56, Dmitry Vyukov wrote: I am seeing use-after-frees in process_srcu as struct srcu_struct is already freed. Before freeing struct srcu_struct, code does cl

Re: kvm: use-after-free in process_srcu

2017-01-17 Thread Dmitry Vyukov
On Tue, Jan 17, 2017 at 12:08 PM, Paolo Bonzini wrote: > > > On 17/01/2017 10:56, Dmitry Vyukov wrote: >>> I am seeing use-after-frees in process_srcu as struct srcu_struct is >>> already freed. Before freeing struct srcu_struct, code does >>> cleanup_srcu_struct(&kvm->irq_srcu). We also tried to

Re: kvm: use-after-free in process_srcu

2017-01-17 Thread Paolo Bonzini
On 17/01/2017 10:56, Dmitry Vyukov wrote: >> I am seeing use-after-frees in process_srcu as struct srcu_struct is >> already freed. Before freeing struct srcu_struct, code does >> cleanup_srcu_struct(&kvm->irq_srcu). We also tried to do: >> >> + srcu_barrier(&kvm->irq_srcu); >> cle

Re: kvm: use-after-free in process_srcu

2017-01-17 Thread Dmitry Vyukov
zkaller" , "Paolo Bonzini" >>> , "Radim Krčmář" >>> , "KVM list" , "LKML" >>> >>> Sent: Monday, January 16, 2017 10:34:26 PM >>> Subject: Re: kvm: use-after-free in process_srcu >>> >>>

Re: kvm: use-after-free in process_srcu

2017-01-17 Thread Dmitry Vyukov
quot;KVM list" , "LKML" >> >> Sent: Monday, January 16, 2017 10:34:26 PM >> Subject: Re: kvm: use-after-free in process_srcu >> >> On Sun, Jan 15, 2017 at 6:11 PM, Dmitry Vyukov wrote: >> > On Fri, Jan 13, 2017 at 10:19 AM, Dmitry Vyukov wr

Re: kvm: use-after-free in process_srcu

2017-01-16 Thread Paolo Bonzini
- Original Message - > From: "Dmitry Vyukov" > To: "Steve Rutherford" > Cc: "syzkaller" , "Paolo Bonzini" > , "Radim Krčmář" > , "KVM list" , "LKML" > > Sent: Monday, January 16, 2017 10:34:26

Re: kvm: use-after-free in process_srcu

2017-01-16 Thread Dmitry Vyukov
On Sun, Jan 15, 2017 at 6:11 PM, Dmitry Vyukov wrote: > On Fri, Jan 13, 2017 at 10:19 AM, Dmitry Vyukov wrote: >> On Fri, Jan 13, 2017 at 4:30 AM, Steve Rutherford >> wrote: >>> I'm not that familiar with the kernel's workqueues, but this seems >>> like the classic "callback outlives the memory

Re: kvm: use-after-free in process_srcu

2017-01-15 Thread Dmitry Vyukov
On Fri, Jan 13, 2017 at 10:19 AM, Dmitry Vyukov wrote: > On Fri, Jan 13, 2017 at 4:30 AM, Steve Rutherford > wrote: >> I'm not that familiar with the kernel's workqueues, but this seems >> like the classic "callback outlives the memory it references" >> use-after-free, where the process_srcu call

Re: kvm: use-after-free in process_srcu

2017-01-13 Thread Dmitry Vyukov
On Fri, Jan 13, 2017 at 4:30 AM, Steve Rutherford wrote: > I'm not that familiar with the kernel's workqueues, but this seems > like the classic "callback outlives the memory it references" > use-after-free, where the process_srcu callback is outliving struct > kvm (which contains the srcu_struct)

Re: kvm: use-after-free in process_srcu

2017-01-12 Thread Steve Rutherford
I'm not that familiar with the kernel's workqueues, but this seems like the classic "callback outlives the memory it references" use-after-free, where the process_srcu callback is outliving struct kvm (which contains the srcu_struct). If that's right, then calling srcu_barrier (which should wait fo

Re: kvm: use-after-free in process_srcu

2016-12-11 Thread Dmitry Vyukov
On Sun, Dec 11, 2016 at 9:40 AM, Vegard Nossum wrote: > On 11 December 2016 at 07:46, Dmitry Vyukov wrote: >> Hello, >> >> I am getting the following use-after-free reports while running >> syzkaller fuzzer. >> On commit 318c8932ddec5c1c26a4af0f3c053784841c598e (Dec 7). >> Unfortunately it is not

Re: kvm: use-after-free in process_srcu

2016-12-11 Thread Vegard Nossum
On 11 December 2016 at 07:46, Dmitry Vyukov wrote: > Hello, > > I am getting the following use-after-free reports while running > syzkaller fuzzer. > On commit 318c8932ddec5c1c26a4af0f3c053784841c598e (Dec 7). > Unfortunately it is not reproducible, but all reports look sane and > very similar, so

kvm: use-after-free in process_srcu

2016-12-10 Thread Dmitry Vyukov
Hello, I am getting the following use-after-free reports while running syzkaller fuzzer. On commit 318c8932ddec5c1c26a4af0f3c053784841c598e (Dec 7). Unfortunately it is not reproducible, but all reports look sane and very similar, so I would assume that it is some hard to trigger race. In all case