lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150305083905.GA11474@redhat.com>
Date:	Thu, 5 Mar 2015 09:39:05 +0100
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	Rusty Russell <rusty@...tcorp.com.au>
Cc:	linux-kernel@...r.kernel.org,
	virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH] virtio_balloon: set DRIVER_OK before using device

On Thu, Mar 05, 2015 at 01:24:47PM +1030, Rusty Russell wrote:
> "Michael S. Tsirkin" <mst@...hat.com> writes:
> > virtio spec requires that all drivers set DRIVER_OK
> > before using devices. While balloon isn't yet
> > included in the virtio 1 spec, previous spec versions
> > also required this.
> >
> > virtio balloon might violate this rule: probe calls
> > kthread_run before setting DRIVER_OK, which might run
> > immediately and cause balloon to inflate/deflate.
> >
> > To fix, call virtio_device_ready before running the kthread.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
> 
> Replied, CC'd stable.

Did you mean applied?

> Thanks,
> Rusty.
> 
> 
> > ---
> >  drivers/virtio/virtio_balloon.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> > index 5a6ad6d..6a356e3 100644
> > --- a/drivers/virtio/virtio_balloon.c
> > +++ b/drivers/virtio/virtio_balloon.c
> > @@ -508,6 +508,8 @@ static int virtballoon_probe(struct virtio_device *vdev)
> >  	if (err < 0)
> >  		goto out_oom_notify;
> >  
> > +	virtio_device_ready(vdev);
> > +
> >  	vb->thread = kthread_run(balloon, vb, "vballoon");
> >  	if (IS_ERR(vb->thread)) {
> >  		err = PTR_ERR(vb->thread);
> > -- 
> > MST
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ