On Tue, Jun 06, 2023 at 07:09:26PM +0200, Daniel Kiper wrote: > On Tue, Jun 06, 2023 at 06:15:27PM +0200, Julian Andres Klode wrote: > > On Tue, Jun 06, 2023 at 06:10:21PM +0200, Julian Andres Klode wrote: > > > From: Kees Cook <keesc...@google.com> > > > > > > GET_ARRAY_INFO's info.nr_disks does not map to GET_DISK_INFO's > > > disk.number, which is an internal kernel index. If an array has had drives > > > added, removed, etc, there may be gaps in GET_DISK_INFO's results. But > > > since the consumer of devicelist cannot tolerate gaps (it expects to walk > > > a NULL-terminated list of device name strings), the devicelist index (j) > > > must be tracked separately from the disk.number index (i). But grub > > > wants to only examine active (i.e. present and non-failed) disks, so how > > > many disks are left to be queried must be also separately tracked > > > (remaining). > > > > > > Fixes: 49de079bbe1c ("... (grub_util_raid_getmembers): Handle "removed" > > > disks") > > > Fixes: 2b00217369ac ("... Added support for RAID and LVM") > > > Fixes: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1912043 > > > Fixes: https://savannah.gnu.org/bugs/index.php?59887 > > > Signed-off-by: Kees Cook <k...@ubuntu.com> > > > > I did not add a cover letter, I just found this patch in a merge request > > on Debian's GitLab, and it still applies, but I haven't tested it > > further than Kees did, and don't know what the test case is quite > > honestly. > > This patch is in upstream as commit c39f27cd6 (osdep/linux: Fix md array > device enumeration).
Huh sorry, I must have been looking at a wrong branch and applied to a wrong branch before forwarding. > > I realized right now that MD_MAX_DISKS defined in commit c39f27cd6 > (osdep/linux: Fix md array device enumeration) is not in sync with > commit 2a5e3c1f2 (disk/diskfilter: Don't make a RAID array with more > than 1024 disks). I think we should sync both numbers down to 1024... +1 -- debian developer - deb.li/jak | jak-linux.org - free software dev ubuntu core developer i speak de, en _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel