1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

env: Add support for explicit write access list

This option marks any U-Boot variable which does not have explicit 'w'
writeable flag set as read-only. This way the environment can be locked
down and only variables explicitly configured to be writeable can ever
be changed by either 'env import', 'env set' or loading user environment
from environment storage.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Marek Vasut
2020-07-07 20:51:39 +02:00
committed by Tom Rini
parent 47f3b1f243
commit d045cbacf2
4 changed files with 68 additions and 13 deletions

View File

@@ -24,6 +24,9 @@ enum env_flags_varaccess {
env_flags_varaccess_readonly,
env_flags_varaccess_writeonce,
env_flags_varaccess_changedefault,
#ifdef CONFIG_ENV_WRITEABLE_LIST
env_flags_varaccess_writeable,
#endif
env_flags_varaccess_end
};
@@ -173,6 +176,7 @@ int env_flags_validate(const struct env_entry *item, const char *newval,
#define ENV_FLAGS_VARACCESS_PREVENT_CREATE 0x00000010
#define ENV_FLAGS_VARACCESS_PREVENT_OVERWR 0x00000020
#define ENV_FLAGS_VARACCESS_PREVENT_NONDEF_OVERWR 0x00000040
#define ENV_FLAGS_VARACCESS_BIN_MASK 0x00000078
#define ENV_FLAGS_VARACCESS_WRITEABLE 0x00000080
#define ENV_FLAGS_VARACCESS_BIN_MASK 0x000000f8
#endif /* __ENV_FLAGS_H__ */