virtio_balloon: set DRIVER_OK before using device
Subsystems (2)
Michael S. Tsirkin
maintainerPATCH 1/1 virtio_balloon: set DRIVER_OK before using device
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.
--- drivers/virtio/virtio_balloon.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/virtio/virtio_balloon.c +2 -0
@@ -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);
Signature · 1 line
MST
Quoted 5 lines · Michael S. Tsirkin
virtio spec requires that all drivers set
DRIVER_OKbefore using devices. While balloon isn't yet included in the virtio 1 spec, previous spec versions also required this.
Quoted 7 lines
virtio balloon might violate this rule: probe calls
kthread_runbefore settingDRIVER_OK, which might run immediately and cause balloon to inflate/deflate.To fix, call
virtio_device_readybefore running the kthread.Signed-off-by Michael S. Tsirkin <[email protected]>
Replied, CC'd stable.
Thanks,
Rusty.
Quoted 19 lines
--- drivers/virtio/virtio_balloon.c | 2 ++ 1 file changed, 2 insertions(+)drivers/virtio/virtio_balloon.c +2
-0@@ -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);Signature · 1 line
MST
Michael S. Tsirkin
maintainerQuoted 10 lines · Rusty Russell
Quoted 9 lines · Michael S. Tsirkin
virtio spec requires that all drivers set
DRIVER_OKbefore 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_runbefore settingDRIVER_OK, which might run immediately and cause balloon to inflate/deflate.
Quoted 5 lines
Quoted 3 lines
To fix, call
virtio_device_readybefore running the kthread.Signed-off-by Michael S. Tsirkin <[email protected]>Replied, CC'd stable.
Did you mean applied?
Quoted 23 lines
Thanks,
Rusty.Quoted 19 lines
--- drivers/virtio/virtio_balloon.c | 2 ++ 1 file changed, 2 insertions(+)drivers/virtio/virtio_balloon.c +2
-0@@ -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);Signature · 1 line
MST
Michael S. Tsirkin
maintainerQuoted 10 lines · Rusty Russell
Quoted 9 lines · Michael S. Tsirkin
virtio spec requires that all drivers set
DRIVER_OKbefore 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_runbefore settingDRIVER_OK, which might run immediately and cause balloon to inflate/deflate.
Quoted 5 lines
Quoted 3 lines
To fix, call
virtio_device_readybefore running the kthread.Signed-off-by Michael S. Tsirkin <[email protected]>Replied, CC'd stable.
Did you mean applied?
Quoted 23 lines
Thanks,
Rusty.Quoted 19 lines
--- drivers/virtio/virtio_balloon.c | 2 ++ 1 file changed, 2 insertions(+)drivers/virtio/virtio_balloon.c +2
-0@@ -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);Signature · 1 line
MST
Quoted 11 lines · Michael S. Tsirkin
Quoted 10 lines · Rusty Russell
Quoted 9 lines · Michael S. Tsirkin
virtio spec requires that all drivers set
DRIVER_OKbefore 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_runbefore settingDRIVER_OK, which might run immediately and cause balloon to inflate/deflate.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
To fix, call
virtio_device_readybefore running the kthread.Signed-off-by Michael S. Tsirkin <[email protected]>Replied, CC'd stable.
Did you mean applied?
I stand erected.
Franks,
Rusty.
Quoted 11 lines · Michael S. Tsirkin
Quoted 10 lines · Rusty Russell
Quoted 9 lines · Michael S. Tsirkin
virtio spec requires that all drivers set
DRIVER_OKbefore 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_runbefore settingDRIVER_OK, which might run immediately and cause balloon to inflate/deflate.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
To fix, call
virtio_device_readybefore running the kthread.Signed-off-by Michael S. Tsirkin <[email protected]>Replied, CC'd stable.
Did you mean applied?
I stand erected.
Franks,
Rusty.