Print this page
10349 bop_blacklist should cover loader menu

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/fakebop.c
          +++ new/usr/src/uts/i86pc/os/fakebop.c
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   *
  26   26   * Copyright (c) 2010, Intel Corporation.
  27   27   * All rights reserved.
  28   28   *
  29      - * Copyright 2018 Joyent, Inc.  All rights reserved.
       29 + * Copyright (c) 2019, Joyent, Inc.
  30   30   */
  31   31  
  32   32  /*
  33   33   * This file contains the functionality that mimics the boot operations
  34   34   * on SPARC systems or the old boot.bin/multiboot programs on x86 systems.
  35   35   * The x86 kernel now does everything on its own.
  36   36   */
  37   37  
  38   38  #include <sys/types.h>
  39   39  #include <sys/bootconf.h>
↓ open down ↓ 1241 lines elided ↑ open up ↑
1281 1281   * Import boot environment module variables as properties, applying
1282 1282   * blacklist filter for variables we know we will not use.
1283 1283   *
1284 1284   * Since the environment can be relatively large, containing many variables
1285 1285   * used only for boot loader purposes, we will use a blacklist based filter.
1286 1286   * To keep the blacklist from growing too large, we use prefix based filtering.
1287 1287   * This is possible because in many cases, the loader variable names are
1288 1288   * using a structured layout.
1289 1289   *
1290 1290   * We will not overwrite already set properties.
     1291 + *
     1292 + * Note that the menu items in particular can contain characters not
     1293 + * well-handled as bootparams, such as spaces, brackets, and the like, so that's
     1294 + * another reason.
1291 1295   */
1292 1296  static struct bop_blacklist {
1293 1297          const char *bl_name;
1294 1298          int bl_name_len;
1295 1299  } bop_prop_blacklist[] = {
1296 1300          { "ISADIR", sizeof ("ISADIR") },
1297 1301          { "acpi", sizeof ("acpi") },
1298 1302          { "autoboot_delay", sizeof ("autoboot_delay") },
1299      -        { "autoboot_delay", sizeof ("autoboot_delay") },
1300 1303          { "beansi_", sizeof ("beansi_") },
1301 1304          { "beastie", sizeof ("beastie") },
1302 1305          { "bemenu", sizeof ("bemenu") },
1303 1306          { "boot.", sizeof ("boot.") },
1304 1307          { "bootenv", sizeof ("bootenv") },
1305 1308          { "currdev", sizeof ("currdev") },
1306 1309          { "dhcp.", sizeof ("dhcp.") },
1307 1310          { "interpret", sizeof ("interpret") },
1308 1311          { "kernel", sizeof ("kernel") },
1309 1312          { "loaddev", sizeof ("loaddev") },
1310 1313          { "loader_", sizeof ("loader_") },
     1314 +        { "mainansi_", sizeof ("mainansi_") },
     1315 +        { "mainmenu_", sizeof ("mainmenu_") },
     1316 +        { "maintoggled_", sizeof ("maintoggled_") },
     1317 +        { "menu_timeout_command", sizeof ("menu_timeout_command") },
     1318 +        { "menuset_", sizeof ("menuset_") },
1311 1319          { "module_path", sizeof ("module_path") },
1312 1320          { "nfs.", sizeof ("nfs.") },
     1321 +        { "optionsansi_", sizeof ("optionsansi_") },
     1322 +        { "optionsmenu_", sizeof ("optionsmenu_") },
     1323 +        { "optionstoggled_", sizeof ("optionstoggled_") },
1313 1324          { "pcibios", sizeof ("pcibios") },
1314 1325          { "prompt", sizeof ("prompt") },
1315 1326          { "smbios", sizeof ("smbios") },
1316 1327          { "tem", sizeof ("tem") },
1317 1328          { "twiddle_divisor", sizeof ("twiddle_divisor") },
1318 1329          { "zfs_be", sizeof ("zfs_be") },
1319 1330  };
1320 1331  
1321 1332  /*
1322 1333   * Match the name against prefixes in above blacklist. If the match was
↓ open down ↓ 1605 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX