Re: [PATCH v3 1/9] virtio: console: fix race with port unplug and open/close

2013-07-30 Thread Amit Shah
On (Mon) 29 Jul 2013 [14:18:52], Rusty Russell wrote: > Amit Shah writes: > > There's a window between find_port_by_devt() returning a port and us > > taking a kref on the port, where the port could get unplugged. Fix it > > by taking the reference in find_port_by_devt() itself. > > > > Problem r

Re: [PATCH v3 1/9] virtio: console: fix race with port unplug and open/close

2013-07-29 Thread Rusty Russell
Amit Shah writes: > There's a window between find_port_by_devt() returning a port and us > taking a kref on the port, where the port could get unplugged. Fix it > by taking the reference in find_port_by_devt() itself. > > Problem reported and analyzed by Mateusz Guzik. This fix is clearly correc

[PATCH v3 1/9] virtio: console: fix race with port unplug and open/close

2013-07-25 Thread Amit Shah
There's a window between find_port_by_devt() returning a port and us taking a kref on the port, where the port could get unplugged. Fix it by taking the reference in find_port_by_devt() itself. Problem reported and analyzed by Mateusz Guzik. CC: Reported-by: Mateusz Guzik Signed-off-by: Amit S