提交 5eb621fc 编写于 作者: D Doug Goldstein

interface: fix udev backend use after free

udevIfaceListAllInterface() used the udev_device after it had its ref
count decremented which results in a use after free issue.
上级 24cf110e
......@@ -359,7 +359,6 @@ udevIfaceListAllInterfaces(virConnectPtr conn,
name = udev_device_get_sysname(dev);
macaddr = udev_device_get_sysattr_value(dev, "address");
status = STREQ(udev_device_get_sysattr_value(dev, "operstate"), "up");
udev_device_unref(dev);
/* Filter the results */
if (status && (flags & VIR_CONNECT_LIST_INTERFACES_ACTIVE))
......@@ -375,6 +374,7 @@ udevIfaceListAllInterfaces(virConnectPtr conn,
}
count++;
}
udev_device_unref(dev);
}
/* Drop our refcounts */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册