The following reply was made to PR port-i386/47566; it has been noted by GNATS.
Date: Thu, 14 Feb 2013 22:55:49 -0600
--HzaOE8X7KzPzAQEl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Does this patch help?
change 1:
Use the sizeof() the right thing to compute the length of the
btinfo_userconfcommands. This prevents an anonymous (4-bytes long,
only long enough for the 'len' member) bootinfo_common from being sent
to the kernel.
change 2:
Don't track in add_biosdisk_bootinfo() whether the BTINFO_BOOTWEDGE and
BTINFO_BOOTDISK bootinfo has been BI_ADD()'d, because the bootloader
might need to re-BI_ADD() if the bootloader have to try to boot a few
kernels (netbsd, ..., netbsd.gz) before finding one.
A better place to protect against BI_ADD()'ing the same BTINFO_* twice
is in bi_add().
Dave
--
David Young
dyo...@pobox.com Urbana, IL
(217) 721-9981
--HzaOE8X7KzPzAQEl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="i386-stand.patch"
--- sys/arch/i386/stand/lib/biosdisk.c 2012-09-20 01:03:41.000000000 0000
+++ sys/arch/i386/stand/lib/biosdisk.c 2012-10-02 23:55:45.000000000 0000
@@ -694,22 +694,8 @@
static void
add_biosdisk_bootinfo(void)
{
- static bool done;
-
- if (bootinfo == NULL) {
- done = false;
- return;
- }
-
- if (done)
- return;
-
BI_ADD(&bi_disk, BTINFO_BOOTDISK, sizeof(bi_disk));
BI_ADD(&bi_wedge, BTINFO_BOOTWEDGE, sizeof(bi_wedge));
-
- done = true;
-
- return;
}
#endif
--- sys/arch/i386/stand/lib/exec.c 2012-09-20 01:03:41.000000000 0000
+++ sys/arch/i386/stand/lib/exec.c 2012-10-02 23:57:41.000000000 0000
@@ -627,7 +627,7 @@
count = 0;
for (uc = userconf_commands; uc != NULL; uc = uc->uc_next)
count++;
- len = sizeof(btinfo_userconfcommands) +
+ len = sizeof(*btinfo_userconfcommands) +
count * sizeof(struct bi_userconfcommand);
/* Allocate the userconf commands list */
--HzaOE8X7KzPzAQEl--