提交 3b868a40 编写于 作者: A Amit Shah 提交者: Rusty Russell

virtio: console: prevent use-after-free of port name in port unplug

Remove the debugfs path before freeing port->name, to prevent a possible
use-after-free.
Reported-by: NJason Wang <jasowang@redhat.com>
Signed-off-by: NAmit Shah <amit.shah@redhat.com>
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
上级 11489736
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册