Page MenuHomeFreeBSD

Add boot_setenv
ClosedPublic

Authored by sjg on Tue, Apr 7, 12:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 20, 2:00 AM
Unknown Object (File)
Mon, Apr 20, 12:00 AM
Unknown Object (File)
Sun, Apr 19, 12:13 AM
Unknown Object (File)
Sat, Apr 18, 1:17 PM
Unknown Object (File)
Sat, Apr 18, 5:38 AM
Unknown Object (File)
Fri, Apr 17, 10:51 AM
Unknown Object (File)
Thu, Apr 16, 9:47 AM
Unknown Object (File)
Wed, Apr 15, 8:04 AM
Subscribers

Details

Summary

Move is_restricted_var() to libsa/environment.c so it can be leveraged
by boot_setenv called from subr_boot with not truted input.

Also, allow for local tuning via ENV_IS_RESTRICTED_ALLOWED_LIST and
ENV_IS_RESTRICTED_LIST

Sponsored by: Hewlett Packard Enterprise Development LP.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sjg requested review of this revision.Tue, Apr 7, 12:01 AM

I think the concept is fine, my main nit is: do we want to call this secure_setenv for symmetry with the secure_getenv name we use in libc, for use in security-sensitive getenv() calls?

I think the concept is fine, my main nit is: do we want to call this secure_setenv for symmetry with the secure_getenv name we use in libc, for use in security-sensitive getenv() calls?

Good question, I chose boot_setenv to as that seemed to fit with what subr_boot.c looked like, but I'm not wedded to any name

I like this, and also @kevans 's suggestion.

This revision is now accepted and ready to land.Tue, Apr 7, 1:54 AM
In D56287#1287811, @imp wrote:

I like this, and also @kevans 's suggestion.

So rename it to secure_setenv ?

In D56287#1287814, @sjg wrote:
In D56287#1287811, @imp wrote:

I like this, and also @kevans 's suggestion.

So rename it to secure_setenv ?

Actually I'm not sure that's a good idea, boot_setenv makes no promise about any care it might take, and if check_restricted is false it just calls setenv.
secure_setenv might be appropriate if it for example forced check_restricted true, but that could easily be a POLA violation.

This revision was automatically updated to reflect the committed changes.