Home | History | Annotate | Download | only in keylock
History log of /src/sys/secmodel/keylock/secmodel_keylock.c
RevisionDateAuthorComments
 1.12  07-Dec-2021  andvar s/dissallow/disallow/
 1.11  05-Dec-2020  thorpej Remove unnecessary inclusion of <sys/timevar.h>.
 1.10  21-Feb-2020  joerg branches: 1.10.6;
Explicitly cast pointers to uintptr_t before casting to enums. They are
not necessarily the same size. Don't cast pointers to bool, check for
NULL instead.
 1.9  15-Jul-2018  maxv branches: 1.9.6;
Retire ipkdb entirely. The option was removed from the config files
yesterday.

ok kamil christos
 1.8  25-Feb-2014  pooka branches: 1.8.28; 1.8.30;
Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
 1.7  08-Dec-2011  jym branches: 1.7.6; 1.7.10;
build fix for keylock secmodel(9).
 1.6  04-Dec-2011  jym Implement the register/deregister/evaluation API for secmodel(9). It
allows registration of callbacks that can be used later for
cross-secmodel "safe" communication.

When a secmodel wishes to know a property maintained by another
secmodel, it has to submit a request to it so the other secmodel can
proceed to evaluating the request. This is done through the
secmodel_eval(9) call; example:

bool isroot;
error = secmodel_eval("org.netbsd.secmodel.suser", "is-root",
cred, &isroot);
if (error == 0 && !isroot)
result = KAUTH_RESULT_DENY;

This one asks the suser module if the credentials are assumed to be root
when evaluated by suser module. If the module is present, it will
respond. If absent, the call will return an error.

Args and command are arbitrarily defined; it's up to the secmodel(9) to
document what it expects.

Typical example is securelevel testing: when someone wants to know
whether securelevel is raised above a certain level or not, the caller
has to request this property to the secmodel_securelevel(9) module.
Given that securelevel module may be absent from system's context (thus
making access to the global "securelevel" variable impossible or
unsafe), this API can cope with this absence and return an error.

We are using secmodel_eval(9) to implement a secmodel_extensions(9)
module, which plugs with the bsd44, suser and securelevel secmodels
to provide the logic behind curtain, usermount and user_set_cpu_affinity
modes, without adding hooks to traditional secmodels. This solves a
real issue with the current secmodel(9) code, as usermount or
user_set_cpu_affinity are not really tied to secmodel_suser(9).

The secmodel_eval(9) is also used to restrict security.models settings
when securelevel is above 0, through the "is-securelevel-above"
evaluation:
- curtain can be enabled any time, but cannot be disabled if
securelevel is above 0.
- usermount/user_set_cpu_affinity can be disabled any time, but cannot
be enabled if securelevel is above 0.

Regarding sysctl(7) entries:
curtain and usermount are now found under security.models.extensions
tree. The security.curtain and vfs.generic.usermount are still
accessible for backwards compat.

Documentation is incoming, I am proof-reading my writings.

Written by elad@, reviewed and tested (anita test + interact for rights
tests) by me. ok elad@.

See also
http://mail-index.netbsd.org/tech-security/2011/11/29/msg000422.html

XXX might consider va0 mapping too.

XXX Having a secmodel(9) specific printf (like aprint_*) for reporting
secmodel(9) errors might be a good idea, but I am not sure on how
to design such a function right now.
 1.5  19-Oct-2009  cegger branches: 1.5.12; 1.5.16;
buildfix: define integer before use. i386 ALL kernel builds again
 1.4  06-Oct-2009  elad Factor out a block of code that appears in three places (Veriexec, keylock,
and securelevel) so that others can use it as well.
 1.3  03-Oct-2009  elad Introduce time_wraps() to check if setting the time will wrap it (or
close to it). Useful for secmodels.

Replace open-coded form with it in secmodel code (securelevel, keylock).

Note: I need to find a way to make secmodel_keylock.c ~<100 lines.
 1.2  15-Aug-2009  mbalmer branches: 1.2.2;
Move the keylock.h header from sys/sys to sys/dev where it really belongs.
Add keylock options to the ALL kernel configuration.
 1.1  14-Aug-2009  mbalmer Add support for multi-position electro-mechanical keylocks. An example
driver, gpiolock(4), is provided as an example how to interface real hardware.
A new securemodel, securemodel_keylock, is provided to show how this can
be used to tie keylocks to overall system security. This is experimental
code. The diff has been on tech-kern for several weeks.

Reviewed by many, kauth(9) integration reviewed by Elad Efrat; approved by
tonnerre@ and tron@. Thanks to everyone who provided feedback.
 1.2.2.3  11-Mar-2010  yamt sync with head
 1.2.2.2  19-Aug-2009  yamt sync with head.
 1.2.2.1  15-Aug-2009  yamt file secmodel_keylock.c was added on branch yamt-nfs-mp on 2009-08-19 18:48:31 +0000
 1.5.16.1  18-Feb-2012  mrg merge to -current.
 1.5.12.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.12.1  17-Apr-2012  yamt sync with head
 1.7.10.1  18-May-2014  rmind sync with head
 1.7.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.30.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.8.30.1  10-Jun-2019  christos Sync with HEAD
 1.8.28.1  28-Jul-2018  pgoyette Sync with HEAD
 1.9.6.1  29-Feb-2020  ad Sync with head.
 1.10.6.1  14-Dec-2020  thorpej Sync w/ HEAD.

RSS XML Feed