NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
port-amd64/59122: x86 efiboot can't handle >26 partitions
>Number: 59122
>Category: port-amd64
>Synopsis: x86 efiboot can't handle >26 partitions
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-amd64-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Mar 03 15:35:00 +0000 2025
>Originator: Taylor R Campbell
>Release: current, 10, 9, ...
>Organization:
The EFIv6 (128-partition space) Foundation
>Environment:
>Description:
x86 efiboot (and probably MI efiboot) is currently limited to 26 partitions, even though GPT can support many more than that.
Issues:
1. lib/biosdisk.c only enumerates 26 partitions:
103 #define BIOSDISKNPART 26
104
105 struct biosdisk {
106 struct biosdisk_ll ll;
107 daddr_t boff;
108 daddr_t size;
109 char buf[BIOSDISK_BUFSIZE];
110 #if !defined(NO_DISKLABEL) || !defined(NO_GPT)
111 struct biosdisk_partition part[BIOSDISKNPART];
112 #endif
113 };
https://nxr.netbsd.org/xref/src/sys/arch/i386/stand/lib/biosdisk.c?r=1.61#103
2. Syntax for specifying partitions only handles a-z:
194 #define isvalidpart(c) ((c) >= 'a' && (c) <= 'z')
195 if (i < devlen) {
196 if (!isvalidpart(fname[i]))
197 return EPART;
198 p = fname[i++] - 'a';
199 }
https://nxr.netbsd.org/xref/src/sys/arch/i386/stand/efiboot/boot.c?r=1.23#194
However, this can be circumvented by using `NAME=' syntax instead. So maybe it's not that big a deal.
3. Other issues?
[Originally reported by Vladimir `phcoder' Serbinenko: https://mail-index.netbsd.org/tech-kern/2025/03/02/msg030103.html]
>How-To-Repeat:
try to efiboot NetBSD from a partition past the 26th one
>Fix:
1. bump BIOSDISKNPARTS
2. invent syntax for other partitions
3. ???
4. profit!
Home |
Main Index |
Thread Index |
Old Index