git: 97fd69b0b884 - main - libsa add boot_serial to is_restricted_var allow list

From: Simon J. Gerraty <sjg_at_FreeBSD.org>
Date: Tue, 24 Nov 2026 00:09:43 UTC
The branch main has been updated by sjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=97fd69b0b88405e08c0b23d0a9a3a64e5b47fc84

commit 97fd69b0b88405e08c0b23d0a9a3a64e5b47fc84
Author:     Simon J. Gerraty <sjg@FreeBSD.org>
AuthorDate: 2026-11-24 00:09:12 +0000
Commit:     Simon J. Gerraty <sjg@FreeBSD.org>
CommitDate: 2026-11-24 00:09:12 +0000

    libsa add boot_serial to is_restricted_var allow list
    
    NOTE: variables that get passed by boot_setenv() will not have '='
    so for these we need to leave that out.
    It doesn't matter much unless the variable we want to allow is
    also a prefix for something we do not.
    
    Sponsored by:   Hewlett Packard Enterprise Development LP
    
    Reviewed by:    kevans, imp
    Differential Revision:  https://reviews.freebsd.org/D61856
---
 stand/libsa/environment.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/stand/libsa/environment.c b/stand/libsa/environment.c
index 3882db6ee9e1..1e62b92d7160 100644
--- a/stand/libsa/environment.c
+++ b/stand/libsa/environment.c
@@ -229,16 +229,15 @@ is_restricted_var(const char *name)
 	 * We impose restrictions if input is not verified/trusted
 	 * allowing for exceptions.
 	 * These entries should probably include the '='
+	 * except if they need to be checked for boot_setenv()
 	 */
 	const char *allowed[] = {
-		"boot_function=",
-		"boot_phase=",
-		"boot_recover_cli=",
-		"boot_recover_volume=",
-		"boot_safe=",
-		"boot_set=",
-		"boot_single=",
-		"boot_verbose=",
+		"boot_multicons",
+		"boot_mutemsgs",
+		"boot_safe",
+		"boot_serial",
+		"boot_single",
+		"boot_verbose",
 #ifdef ENV_IS_RESTRICTED_ALLOWED_LIST
 		ENV_IS_RESTRICTED_ALLOWED_LIST,
 #endif