Re: [PATCH net V2] vhost-vsock: fix use after free

2018-09-27 Thread Michael S. Tsirkin
On Fri, Sep 28, 2018 at 07:37:37AM +0800, Jason Wang wrote: > > > On 2018年09月28日 01:04, Michael S. Tsirkin wrote: > > On Thu, Sep 27, 2018 at 08:22:04PM +0800, Jason Wang wrote: > > > The access of vsock is not protected by vhost_vsock_lock. This may > > > lead to use after free since

Re: [PATCH net V2] vhost-vsock: fix use after free

2018-09-27 Thread Jason Wang
On 2018年09月28日 01:04, Michael S. Tsirkin wrote: On Thu, Sep 27, 2018 at 08:22:04PM +0800, Jason Wang wrote: The access of vsock is not protected by vhost_vsock_lock. This may lead to use after free since vhost_vsock_dev_release() may free the pointer at the same time. Fix this by holding the

Re: [PATCH net V2] vhost-vsock: fix use after free

2018-09-27 Thread Michael S. Tsirkin
On Thu, Sep 27, 2018 at 08:22:04PM +0800, Jason Wang wrote: > The access of vsock is not protected by vhost_vsock_lock. This may > lead to use after free since vhost_vsock_dev_release() may free the > pointer at the same time. > > Fix this by holding the lock during the access. > > Reported-by:

Re: [PATCH net V2] vhost-vsock: fix use after free

2018-09-27 Thread Stefan Hajnoczi
On Thu, Sep 27, 2018 at 08:22:04PM +0800, Jason Wang wrote: > The access of vsock is not protected by vhost_vsock_lock. This may > lead to use after free since vhost_vsock_dev_release() may free the > pointer at the same time. > > Fix this by holding the lock during the access. > > Reported-by:

Re: [patch 09/11] x86/vdso: Simplify the invalid vclock case

2018-09-27 Thread Thomas Gleixner
On Tue, 18 Sep 2018, Thomas Gleixner wrote: > On Tue, 18 Sep 2018, Thomas Gleixner wrote: > > So if the TSC on CPU1 is slightly behind the TSC on CPU0 then now1 can be > > smaller than cycle_last. The TSC sync stuff does not catch the small delta > > for unknown raisins. I'll go and find that

Re: [patch 09/11] x86/vdso: Simplify the invalid vclock case

2018-09-27 Thread Andy Lutomirski
> On Sep 27, 2018, at 7:36 AM, Thomas Gleixner wrote: > >> On Wed, 19 Sep 2018, Thomas Gleixner wrote: >> On Tue, 18 Sep 2018, Andy Lutomirski wrote: On Sep 18, 2018, at 3:46 PM, Thomas Gleixner wrote: > On Tue, 18 Sep 2018, Andy Lutomirski wrote: > Do we do better if we use

Re: [patch 09/11] x86/vdso: Simplify the invalid vclock case

2018-09-27 Thread Thomas Gleixner
On Wed, 19 Sep 2018, Thomas Gleixner wrote: > On Tue, 18 Sep 2018, Andy Lutomirski wrote: > > > On Sep 18, 2018, at 3:46 PM, Thomas Gleixner wrote: > > > On Tue, 18 Sep 2018, Andy Lutomirski wrote: > > >> Do we do better if we use signed arithmetic for the whole calculation? > > >> Then a small

Re: [PATCH net] vhost-vsock: fix use after free

2018-09-27 Thread Jason Wang
On 2018年09月27日 17:52, Sergei Shtylyov wrote: Hello! On 9/27/2018 11:43 AM, Jason Wang wrote:    Just a couple of typos... The access of vsock is not protected by vhost_vsock_lock. This may lead use after free since vhost_vsock_dev_release() may free the   Lead to use. pointer at the

[PATCH net V2] vhost-vsock: fix use after free

2018-09-27 Thread Jason Wang
The access of vsock is not protected by vhost_vsock_lock. This may lead to use after free since vhost_vsock_dev_release() may free the pointer at the same time. Fix this by holding the lock during the access. Reported-by: syzbot+e3e074963495f92a8...@syzkaller.appspotmail.com Fixes: 16320f363ae1

Re: [PATCH net] vhost-vsock: fix use after free

2018-09-27 Thread Sergei Shtylyov
Hello! On 9/27/2018 11:43 AM, Jason Wang wrote: Just a couple of typos... The access of vsock is not protected by vhost_vsock_lock. This may lead use after free since vhost_vsock_dev_release() may free the Lead to use. pointer at the same time. Fix this by holding the lock during

[PATCH net] vhost-vsock: fix use after free

2018-09-27 Thread Jason Wang
The access of vsock is not protected by vhost_vsock_lock. This may lead use after free since vhost_vsock_dev_release() may free the pointer at the same time. Fix this by holding the lock during the acess. Reported-by: syzbot+e3e074963495f92a8...@syzkaller.appspotmail.com Fixes: 16320f363ae1