Commit Graph

88 Commits

Author SHA1 Message Date
rmind 92ae34c400 Remove include of sys/pset.h in sys/lwp.h header.
Include it in few appropriate sources.
2008-03-09 15:39:14 +00:00
elad fb57fc51da Forgot this file in the previous commit.
Backend for the newly added KAUTH_NETWORK_NFS action.

Spotted by Paul Goyette on current-users@, thanks!
2008-03-02 16:16:34 +00:00
elad 67470a76a1 Factor out the guts of get/setparam so it can be used from the compat code.
Make the FreeBSD and Linux compat code convert the parameters to their
native representation and call the native routines.

Remove KAUTH_PROCESS_SCHEDULER_GET/SET.

Update documentation and examples.

XXX: For now, only the Linux compat code does the priority conversion
XXX: right.

Linux priority conversion code from yamt@, thanks!

Okay yamt@.
2008-02-28 16:09:18 +00:00
elad 8597bf513b Default defer, not deny.
Idea okay wrstuden@, no objections on tech-kern@ and tech-security@.
2008-02-27 21:59:26 +00:00
elad 2ef031e659 Adapt to secmodel_securelevel. 2008-02-23 23:32:30 +00:00
elad 0bb7f5ccb3 PR/37986: YAMAMOTO Takashi: any user can hog the all cpu with
_sched_setparam.

Pass proper context to kauth(9) for a decision to made based on the
scheduling policy and priority.
2008-02-17 19:22:35 +00:00
elad e99760e7e4 Fold KAUTH_REQ_PROCESS_SCHEDULER_* to KAUTH_PROCESS_SCHEDULER_*. In other
words, don't pass an action and a request, and just use a single action to
indicate what is the operation in question.

This is the first step in fixing PR/37986, which calls for policy/priority
checking in the secmodel code. Right now we're lacking room for another
parameter required to make a decision, and this change makes room for such.
2008-02-16 16:39:34 +00:00
elad 274b48425f Default deny and explicit allow policy in all listeners.
No objections on tech-security@ and tech-kern@.
2008-02-12 12:05:27 +00:00
elad e43f626d03 Add, document, and use KAUTH_REQ_PROCESS_KTRACE_PERSISTENT. 2008-02-02 21:04:40 +00:00
elad 4240d37675 KTRFAC_ROOT -> KTRFAC_PERSISTENT, and update comments.
Discussed with christos@ and yamt@.
2008-02-02 20:42:18 +00:00
elad cd23f36378 Replace a KAUTH_GENERIC_ISSUSER in the cpuctl code with a proper kauth
request.

Reviewed by ad@, tested by me.
2008-02-01 20:01:06 +00:00
elad fb37bad459 Use proper kauth(9) actions/requests for native scheduler stuff and the
recently introduced processor-sets.

Discussed with and okay rmind@, yamt@, and christos@.
2008-01-30 17:54:55 +00:00
elad c27d5f30b6 Tons of process scope changes.
- Add a KAUTH_PROCESS_SCHEDULER action, to handle scheduler related
    requests, and add specific requests for set/get scheduler policy and
    set/get scheduler parameters.

  - Add a KAUTH_PROCESS_KEVENT_FILTER action, to handle kevent(2) related
    requests.

  - Add a KAUTH_DEVICE_TTY_STI action to handle requests to TIOCSTI.

  - Add requests for the KAUTH_PROCESS_CANSEE action, indicating what
    process information is being looked at (entry itself, args, env,
    open files).

  - Add requests for the KAUTH_PROCESS_RLIMIT action indicating set/get.

  - Add requests for the KAUTH_PROCESS_CORENAME action indicating set/get.

  - Make bsd44 secmodel code handle the newly added rqeuests appropriately.

All of the above make it possible to issue finer-grained kauth(9) calls in
many places, removing some KAUTH_GENERIC_ISSUSER requests.

  - Remove the "CAN" from KAUTH_PROCESS_CAN{KTRACE,PROCFS,PTRACE,SIGNAL}.

Discussed with christos@ and yamt@.
2008-01-23 15:04:38 +00:00
ad bbc79e58a6 Pull in my modules code for review/test/hacking. 2008-01-16 12:34:50 +00:00
ad 7f75548e50 vp->v_rdev, not vp->v_un.vu_specinfo->si_rdev. 2008-01-14 17:56:21 +00:00
elad 964f16c2b9 Make fork use kauth.
Been running in my tree for over a month at least.

Reviewed and okay yamt@, and special thanks to him as well as rittera@
for making this possible through fixing NDIS to not call fork1() with
l1 != curlwp.
2008-01-07 23:51:06 +00:00
ad 2ecdf58c2c Remove systrace. Ok core@. 2007-12-31 15:31:24 +00:00
elad adc8fdec92 Add PT_TRACE_ME to switch statement.
This caused trouble with ptrace, and noted just now thanks to a strict
policy design. Noted (and fix verified by) mjf@, thanks.
2007-12-01 21:59:49 +00:00
elad 41b84354cb Deprecate KAUTH_REQ_SYSTEM_TIME_BACKWARDS, as it was merged into
KAUTH_REQ_SYSTEM_TIME_SYSTEM.
2007-11-25 09:39:26 +00:00
elad abb7851f4d Refactor time modification checks and place them in the secmodel code.
okay christos@
2007-11-25 00:35:26 +00:00
elad b242e18ba4 Fix a long time issue where the securelevel secmodel would explicitly
allow certain operations.

The suser module of the bsd44 secmodel code was made aware of the missing
operations that were explicitly allowed in the securelevel module, and
the logic in the latter was modified to a default defer, deny where not
allowed.

This concept, which is the correct way to write secmodel code, was first
brought up by pavel@ a long time ago.

okay christos@.
2007-11-24 20:47:14 +00:00
elad 18558073a1 Kill another instance of KAUTH_GENERIC_ISSUSER. 2007-11-23 16:03:47 +00:00
elad 6887492c26 Make securelevel a "secmodel" of its own.
While it's true that it's part of the traditional 4.4BSD security model,
there may come a time where a different "primary" security model used for
fine-grained privileges (ie., splitting root's responsibilities to various
privileges that can be assigned) may want to still have a securelevel
setting.

Idea from Daniel Carosone:

  http://mail-index.netbsd.org/tech-security/2006/08/25/0001.html

The location of the removed files, for reference, was:

  src/secmodel/bsd44/secmodel_bsd44_securelevel.c
  src/secmodel/bsd44/securelevel.h
2007-11-21 22:49:05 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
thorpej 712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
pavel 934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
plunky e9dd2c35eb Add another hardwired exception to the SOCK_RAW / superuser rule, because
(PF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI) sockets need to be accessable for
normal users.
2007-02-01 08:49:05 +00:00
elad a78693aa19 Kill KAUTH_PROCESS_RESOURCE and just replace it with two actions for
nice and rlimit.
2007-01-20 16:47:38 +00:00
elad f266f9a5db Use secmodel_register() and secmodel_deregister(). 2007-01-16 11:53:00 +00:00
elad 2b3921e3e7 Implement secmodel_bsd44_start(), secmodel_bsd44_stop(), and
secmodel_overlay_start().
2007-01-16 00:11:39 +00:00
elad 0ac991a582 Avoid proc_uidmatch() for rlimits if p is curproc. 2007-01-15 17:47:06 +00:00
elad d4e427ef80 '&securelevel' -> 'NULL', pointed out by cube@, thanks! 2007-01-15 11:58:00 +00:00
elad a37f8a3813 Make 'securelevel' internal to the secmodel. 2007-01-10 11:20:20 +00:00
elad de8fa4821d Make readable. 2007-01-09 16:19:27 +00:00
elad 76f1c03beb Remove advertising clause from all of my stuff. 2007-01-09 12:57:56 +00:00
elad 0ff4d47ce3 Fallthrough. 2007-01-05 13:21:53 +00:00
elad faf71534b5 Add 'stop' routines to do the exact opposite of the 'start' routines for
'securelevel' and 'suser' parts of secmodel_bsd44.
2007-01-02 23:58:20 +00:00
elad 81fe5ba5fc Don't compile secmodel_start() if built as an LKM. 2007-01-02 23:47:09 +00:00
elad 5ef5c7c8ab Add prototypes for the sysctl(9) setup routines for LKMs only. 2007-01-02 23:35:37 +00:00
elad 9f1a7cc74f Don't leak listeners. 2007-01-02 23:30:29 +00:00
elad 89b1051729 Consistent naming in sysctl(9) setup routines. 2007-01-02 13:01:46 +00:00
elad 004947a094 Add missing break... 2007-01-02 12:15:52 +00:00
elad 9fc29b4efc Make the securelevel contained by not exposing the variable that keeps
it outside secmodel_bsd44_securelevel.c.
2007-01-02 11:46:44 +00:00
elad d4e1860d1a Add KAUTH_SYSTEM_CHSYSFLAGS so we can get rid of the last three
securelevel references (ufs, ext2fs, tmpfs).

Intentionally undocumented.
2007-01-02 11:18:56 +00:00
elad 40894ca786 Need vnode.h here. 2007-01-02 11:06:29 +00:00
elad a13160f423 Make mount(2) and unmount(2) use kauth(9) for security policy.
Okay yamt@.
2007-01-02 10:47:28 +00:00
elad 1e2869f580 Remove XXX comment about making 'securelevel' a static. 2006-12-31 10:38:18 +00:00
elad 92c473da20 Explicitly 'extern int securelevel;' in the sysctl(9) setup routine. 2006-12-31 10:36:44 +00:00
elad 4798cd2cab Support device scope. 2006-12-29 18:34:28 +00:00