Page MenuHomeFreeBSD

Add boot_setenv
ClosedPublic

Authored by sjg on Tue, Apr 7, 12:01 AM.
Tags
None
Referenced Files
F152036503: D56287.diff
Sun, Apr 12, 6:45 AM
F151995572: D56287.diff
Sun, Apr 12, 12:06 AM
Unknown Object (File)
Fri, Apr 10, 1:01 PM
Unknown Object (File)
Thu, Apr 9, 5:35 PM
Unknown Object (File)
Tue, Apr 7, 6:19 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.