NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-xen/59451: XEN3_DOM0 kernel finds the wrong root device
The following reply was made to PR port-xen/59451; it has been noted by GNATS.
From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: port-xen/59451: XEN3_DOM0 kernel finds the wrong root device
Date: Sun, 1 Jun 2025 05:52:25 -0000 (UTC)
frchuckz%gmail.com@localhost writes:
>--- sys/arch/xen/xen/xen_machdep.c.orig 2023-10-18 12:53:03.000000000 -0400
>+++ sys/arch/xen/xen/xen_machdep.c 2025-05-30 20:42:39.936253878 -0400
>@@ -553,7 +553,10 @@
> /* XXX check device_cfdata as in x86_autoconf.c? */
> booted_partition = toupper(
> xcp.xcp_bootdev[strlen(devname)]) - 'A';
>+ /* Check that the value of booted_partition is sane */
>+ if (booted_partition & 0xfffffff0)
>+ continue;
> DPRINTF(("%s: booted_partition: %d\n", __func__, booted_partition));
> }
> booted_device = dv;
The code should check that the partition is between 0 and MAXPARTITIONS-1
instead of using some bitmask and it shouldn't touch booted_partition
before the value is validated.
It should also parse xcp_bootdev better (this was bad before and the
x86 version of that code isn't really better).
However, nothing of that really helps to use wedges ("dkXX") as
wedge unit numbers are a bit volatile.
The better alternative is to not set "bootdev" but to pass the
"root" command line option. The value is a string and interpreted
by the MI part of the kernel as a device name (with partition
for a disk) or as NAME=wedgename (or for compatiblity wedge:wedgename).
E.g.:
menu=Boot Xen Dom0:load /netbsd_xen console=pc root=NAME=my-root;multiboot /xen.gz
Home |
Main Index |
Thread Index |
Old Index