From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 00/10] boot: revert boot related globalvars after booting
Date: Fri, 30 Oct 2026 11:53:58 +0100 [thread overview]
Message-ID: <20261030-boot-globalvar-stack-v1-0-a03803e1100c@pengutronix.de> (raw)
Boot entries configure booting through globalvars like global.bootm.*,
global.linux.bootargs.* or global.of.overlay.*. So far only some of these
were restored after a boot entry returned, by saving a fixed set of
variables and by clearing the global.linux.bootargs.dyn.* namespace.
This series adds globalvar scopes, which snapshot all globalvars with
given prefixes and restore them later, and uses them around each boot
entry, bootm and bootchooser boot attempts. With that the .dyn infix is
no longer needed, so it is dropped from the boot entries barebox ships.
The series is based on the "boot: UAF and double free fixes" series.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Sascha Hauer (10):
globalvar: add scopes to snapshot and restore globalvars
bootm: revert globalvar changes in bootm_boot_cleanup()
boot: revert globalvar changes after each boot entry
bootchooser: use a globalvar scope for its bootargs
test: py: add test for reverting globalvars after boot
bootargs: remove unused linux_bootargs_overwrite()
of: add watchdog bootarg directly instead of via a globalvar
boot: drop the dyn infix from the bootentries bootargs variable
defaultenv: don't use global.linux.bootargs.dyn.* in boot entries
Documentation: migration-guides: describe reverting boot globalvars
.../migration-master/boot-globalvar-scope.rst | 13 ++
Documentation/user/booting-linux.rst | 27 ++--
Documentation/user/devboot.rst | 4 +-
common/Kconfig | 6 +-
common/blspec.c | 2 +-
common/boot.c | 35 ++---
common/bootargs.c | 17 ---
common/bootchooser.c | 6 +-
common/bootm.c | 27 +---
common/extlinux.c | 2 +-
common/globalvar.c | 142 +++++++++++++++++++++
common/oftree.c | 41 +++---
defaultenv/defaultenv-2-base/boot/net | 5 +-
defaultenv/defaultenv-2-base/data/boot-template | 2 +-
defaultenv/defaultenv-2-dfu/boot/dfu | 4 +-
include/boot.h | 16 +++
include/bootargs.h | 5 -
include/bootm.h | 9 +-
include/globalvar.h | 29 +++++
test/py/test_boot_globalvar_scope.py | 117 +++++++++++++++++
20 files changed, 396 insertions(+), 113 deletions(-)
---
base-commit: 9ae453b11d9e222b33247c95405f6a74ee845fa0
change-id: 20261030-boot-globalvar-stack-9c65609b5801
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
next reply other threads:[~2026-10-30 10:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 10:53 Sascha Hauer [this message]
2026-10-30 10:53 ` [PATCH 01/10] globalvar: add scopes to snapshot and restore globalvars Sascha Hauer
2026-10-30 10:54 ` [PATCH 02/10] bootm: revert globalvar changes in bootm_boot_cleanup() Sascha Hauer
2026-10-30 10:54 ` [PATCH 03/10] boot: revert globalvar changes after each boot entry Sascha Hauer
2026-10-30 10:54 ` [PATCH 04/10] bootchooser: use a globalvar scope for its bootargs Sascha Hauer
2026-10-30 10:54 ` [PATCH 05/10] test: py: add test for reverting globalvars after boot Sascha Hauer
2026-10-30 10:54 ` [PATCH 06/10] bootargs: remove unused linux_bootargs_overwrite() Sascha Hauer
2026-10-30 10:54 ` [PATCH 07/10] of: add watchdog bootarg directly instead of via a globalvar Sascha Hauer
2026-10-30 10:54 ` [PATCH 08/10] boot: drop the dyn infix from the bootentries bootargs variable Sascha Hauer
2026-10-30 10:54 ` [PATCH 09/10] defaultenv: don't use global.linux.bootargs.dyn.* in boot entries Sascha Hauer
2026-10-30 10:54 ` [PATCH 10/10] Documentation: migration-guides: describe reverting boot globalvars Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261030-boot-globalvar-stack-v1-0-a03803e1100c@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox