mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-19 08:11:52 +00:00
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: Jason Wang <jasowang@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
1148973617
commit
3b868a4073
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user