diff options
author | 2020-06-29 18:25:26 +0000 | |
---|---|---|
committer | 2020-06-29 18:25:26 +0000 | |
commit | 1f4256da96ed075585e4adad998c594d4898f197 (patch) | |
tree | abe7c85696214aa93d2c12c772738c00630cac82 | |
parent | Bring back revision 1.122 with a fix preventing a use-after-free by (diff) | |
download | wireguard-openbsd-1f4256da96ed075585e4adad998c594d4898f197.tar.xz wireguard-openbsd-1f4256da96ed075585e4adad998c594d4898f197.zip |
Fix "init-system" with multiple PCIe root complexes
Contrary to other (single CPU) machines, the Oracle SPARC T4-2 machines
come with two CPUs/two PCIe root complexes instead of one.
ldomctl already accounts for this and interates over them but lacked a skip
condition when iterating over subdevices to avoid linking devices in one
complex to those in another.
This fixes a NULL dereference in "init-system" on T4-2 machines and makes
it produce working machine descriptions (.md files).
Testing and confirmation on a T4-1 that single PCIe root complex machines
still produce identical MDs with this from tracey, thanks!
Reminded by a report on bugs@ from Kokuma who also confirmed this fix on
their T4-2.
-rw-r--r-- | usr.sbin/ldomctl/config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ldomctl/config.c b/usr.sbin/ldomctl/config.c index da289f0da51..acd8ae6e8b7 100644 --- a/usr.sbin/ldomctl/config.c +++ b/usr.sbin/ldomctl/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.40 2020/05/24 22:08:54 kn Exp $ */ +/* $OpenBSD: config.c,v 1.41 2020/06/29 18:25:26 kn Exp $ */ /* * Copyright (c) 2012, 2018 Mark Kettenis @@ -1142,6 +1142,8 @@ hvmd_finalize_pcie_device(struct md *md, struct device *device) md_link_node(md, node, parent); TAILQ_FOREACH(subdevice, &device->guest->subdevice_list, link) { + if (strncmp(path, subdevice->path, strlen(path)) != 0) + continue; TAILQ_FOREACH(component, &components, link) { if (strcmp(subdevice->path, component->path) == 0) md_link_node(md, parent, component->hv_node); |