search for: find_port_by_devt

Displaying 12 results from an estimated 12 matches for "find_port_by_devt".

2013 Jul 29
1
[PATCH v3 1/9] virtio: console: fix race with port unplug and open/close
Amit Shah <amit.shah at redhat.com> 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 correct, but what about the other find_port_by_* functions...
2013 Jul 29
1
[PATCH v3 1/9] virtio: console: fix race with port unplug and open/close
Amit Shah <amit.shah at redhat.com> 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 correct, but what about the other find_port_by_* functions...
2013 Jul 25
0
[PATCH v3 1/9] virtio: console: fix race with port unplug and open/close
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: <stable at vger.kernel.org> Reported-by: Mateusz Guzik <mguzik at redhat.com> Sig...
2013 Jul 25
18
[PATCH v3 0/9] virtio: console: fixes for bugs and races with unplug
Hello, This series fixes a few bugs and races with port unplug and the various file operations: read(), write() and close(). I started coding up an alternative locking mechanism based on the discussion earlier in this series, but some of what we already have has to remain, and the new code is sufficiently different, so I'd rather it bakes for a while, and I ensure there are no regressions
2013 Jul 25
18
[PATCH v3 0/9] virtio: console: fixes for bugs and races with unplug
Hello, This series fixes a few bugs and races with port unplug and the various file operations: read(), write() and close(). I started coding up an alternative locking mechanism based on the discussion earlier in this series, but some of what we already have has to remain, and the new code is sufficiently different, so I'd rather it bakes for a while, and I ensure there are no regressions
2010 Sep 02
14
[PATCH 00/14] virtio: console: Hot-unplug fixes
...Make read() return -ENODEV on hot-unplug virtio: console: Make write() return -ENODEV on hot-unplug virtio: console: remove_port() should return void virtio: console: open: Use a common path for error handling virtio: console: Add a list of portdevs that are active virtio: console: Add a find_port_by_devt() function virtio: console: Use cdev_alloc() instead of cdev_init() virtio: console: Add reference counting for port struct virtio: console: Reference counting portdev structs is not needed drivers/char/virtio_console.c | 206 ++++++++++++++++++++++++++++++++++------- 1 files changed, 173...
2010 Sep 02
14
[PATCH 00/14] virtio: console: Hot-unplug fixes
...Make read() return -ENODEV on hot-unplug virtio: console: Make write() return -ENODEV on hot-unplug virtio: console: remove_port() should return void virtio: console: open: Use a common path for error handling virtio: console: Add a list of portdevs that are active virtio: console: Add a find_port_by_devt() function virtio: console: Use cdev_alloc() instead of cdev_init() virtio: console: Add reference counting for port struct virtio: console: Reference counting portdev structs is not needed drivers/char/virtio_console.c | 206 ++++++++++++++++++++++++++++++++++------- 1 files changed, 173...
2013 Jul 19
12
[PATCH v2 00/11] virtio: console: fixes for port unplug
Hello, This series fixes a few bugs and races with port unplug and the various file operations: read(), write(), close() and poll(). There still might be more races lurking, but testing this series looks good to at least solve the easily-triggerable ones. I've run the virtio-serial testsuite and a few open/close/unplug tests, and haven't seen any badness. I've marked these patches
2013 Jul 19
12
[PATCH v2 00/11] virtio: console: fixes for port unplug
Hello, This series fixes a few bugs and races with port unplug and the various file operations: read(), write(), close() and poll(). There still might be more races lurking, but testing this series looks good to at least solve the easily-triggerable ones. I've run the virtio-serial testsuite and a few open/close/unplug tests, and haven't seen any badness. I've marked these patches
2013 Jul 18
16
[PATCH 00/10] virtio: console: fixes for races with port unplug
Hello, This series fixes a few races with port unplug and the various file operations: read(), write(), close() and poll(). There still might be more races lurking, but testing this series looks good to at least solve the easily-triggerable ones. I've run the virtio-serial testsuite and a few open/close/unplug tests, and haven't seen any badness. I've marked these patches for
2013 Jul 18
16
[PATCH 00/10] virtio: console: fixes for races with port unplug
Hello, This series fixes a few races with port unplug and the various file operations: read(), write(), close() and poll(). There still might be more races lurking, but testing this series looks good to at least solve the easily-triggerable ones. I've run the virtio-serial testsuite and a few open/close/unplug tests, and haven't seen any badness. I've marked these patches for
2013 Jul 25
0
[PATCH v3 2/9] virtio: console: fix race in port_fops_open() and port unplug
...rs/char/virtio_console.c b/drivers/char/virtio_console.c index 291f437..b04ec95 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1024,6 +1024,10 @@ static int port_fops_open(struct inode *inode, struct file *filp) /* We get the port with a kref here */ port = find_port_by_devt(cdev->dev); + if (!port) { + /* Port was unplugged before we could proceed */ + return -ENXIO; + } filp->private_data = port; /* -- 1.8.1.4