Segfault in ACPI table generation if no PCI devices instantiated
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- c
- Domain
- operating-systems
Research direction
Start in src/lib/pci_emul.c, at pci_bus_write_dsdt, and reproduce hyperkit with the -A flag and no PCI devices. Trace the no-device Bus 0 path and verify that ACPI table generation completes without a segmentation fault when the fix is done.
Written by the indexing model from the issue text.
Description
If hyperkit is launched with the -A flag and no PCI devices, it crashes.
In the code below, taken from src/lib/pci_emul.c, bi gets dereferenced even though it's NULL.
static void
pci_bus_write_dsdt(int bus)
{
struct businfo *bi;
/*
* If there are no devices on this 'bus' then just return.
*/
if ((bi = pci_businfo[bus]) == NULL) {
/*
* Bus 0 is special because it decodes the I/O ports used
* for PCI config space access even if there are no devices
* on it.
*/
if (bus != 0)
return;
}
dsdt_fixup(bus, bi->iobase, bi->iolimit, bi->membase32, bi->memlimit32,
bi->membase64, bi->memlimit64);
(void) pci_pirq_prt_entry;
(void) pci_apic_prt_entry;
}
- Dominant language
- C
- Stars
- 3.7k
- Forks
- 336
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from moby/hyperkit
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
Similar issues
-
Status: Waiting triage Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nanoframework/Home#1857 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
libsdl-org/SDL#16372 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
corazawaf/coraza-nginx#140 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100