提交 b27ae990 编写于 作者: S Sven Van Asbroeck 提交者: Xie XiuQi

PCI/PME: Fix possible use-after-free on remove

mainline inclusion
from mainline-5.0
commit 7cf58b79
category: bugfix
bugzilla: 12120
CVE: NA

-------------------------------------------------

In remove(), ensure that the PME work cannot run after kfree() is called.
Otherwise, this could result in a use-after-free.

This issue was detected with the help of Coccinelle.
Signed-off-by: NSven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Cc: Sinan Kaya <okaya@kernel.org>
Cc: Frederick Lawler <fred@fredlawl.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NYao Hongbo <yaohongbo@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ea2c8823
...@@ -437,6 +437,7 @@ static void pcie_pme_remove(struct pcie_device *srv) ...@@ -437,6 +437,7 @@ static void pcie_pme_remove(struct pcie_device *srv)
pcie_pme_disable_interrupt(srv->port, data); pcie_pme_disable_interrupt(srv->port, data);
free_irq(srv->irq, srv); free_irq(srv->irq, srv);
cancel_work_sync(&data->work);
kfree(data); kfree(data);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册