OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1148973
)
virtio: console: prevent use-after-free of port name in port unplug
author
Amit Shah
<amit.shah@redhat.com>
Wed, 7 Aug 2013 06:24:17 +0000
(15:54 +0930)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Fri, 9 Aug 2013 03:32:16 +0000
(13:02 +0930)
Remove the debugfs path before freeing port->name, to prevent a possible
use-after-free.
Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c
patch
|
blob
|
history
diff --git
a/drivers/char/virtio_console.c
b/drivers/char/virtio_console.c
index
d0e75aa
..
b79cf3e
100644
(file)
--- a/
drivers/char/virtio_console.c
+++ b/
drivers/char/virtio_console.c
@@
-1591,9
+1591,8
@@
static void unplug_port(struct port *port)
device_destroy(pdrvdata.class, port->dev->devt);
cdev_del(port->cdev);
- kfree(port->name);
-
debugfs_remove(port->debugfs_file);
+ kfree(port->name);
/*
* Locks around here are not necessary - a port can't be