summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_event.c
Commit message (Collapse)AuthorAgeFilesLines
* o Centralize inter-process access control, introducing:rwatson2000-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int p_can(p1, p2, operation, privused) which allows specification of subject process, object process, inter-process operation, and an optional call-by-reference privused flag, allowing the caller to determine if privilege was required for the call to succeed. This allows jail, kern.ps_showallprocs and regular credential-based interaction checks to occur in one block of code. Possible operations are P_CAN_SEE, P_CAN_SCHED, P_CAN_KILL, and P_CAN_DEBUG. p_can currently breaks out as a wrapper to a series of static function checks in kern_prot, which should not be invoked directly. o Commented out capabilities entries are included for some checks. o Update most inter-process authorization to make use of p_can() instead of manual checks, PRISON_CHECK(), P_TRESPASS(), and kern.ps_showallprocs. o Modify suser{,_xxx} to use const arguments, as it no longer modifies process flags due to the disabling of ASU. o Modify some checks/errors in procfs so that ENOENT is returned instead of ESRCH, further improving concealment of processes that should not be visible to other processes. Also introduce new access checks to improve hiding of processes for procfs_lookup(), procfs_getattr(), procfs_readdir(). Correct a bug reported by bp concerning not handling the CREATE case in procfs_lookup(). Remove volatile flag in procfs that caused apparently spurious qualifier warnigns (approved by bde). o Add comment noting that ktrace() has not been updated, as its access control checks are different from ptrace(), whereas they should probably be the same. Further discussion should happen on this topic. Reviewed by: bde, green, phk, freebsd-security, others Approved by: bde Obtained from: TrustedBSD Project
* Fix bug with timeout; previously, when attempting to poll the kqueue byjlemon2000-08-071-14/+22
| | | | | | | | | | | | | | | passing a zero-valued timeout, the code would always sleep for one tick. Change code to avoid calling tsleep if we have no intention of sleeping. Bring in bugfix from sys_select.c, r1.60 which also applies here. Modify error handling slightly; passing in an invalid fd will now result in EBADF returned in the eventlist, while an attempt to change a knote which does not exist will result in ENOENT being returned. Previously such attempts would fail silently without notification. Pointed out by: nicolas.leonard@animaths.com Rick Reed (rr@yahoo-inc.com)
* Back out rev 1.12; its not clear that this is the right thing to do,jlemon2000-08-011-2/+5
| | | | and in any event, it wasn't done correctly in the first place.
* Fix warnings - make kevent args in comment match those in syscalls.master.peter2000-07-281-4/+4
| | | | Deal with consts.
* Have kevent() automatically restart if interrupted by a signal. If thisjlemon2000-07-271-5/+2
| | | | | | | | is not desired, then the user can register an EV_SIGNAL filter to explicitly catch a signal event. Change requested by: jayanth, ps, peter "Why is kevent non-restartable after a signal?"
* Fix a bug which would cause some knotes to get lost when two kqueuesjlemon2000-07-181-1/+2
| | | | | | were being used in a process at the same time. Test case provided by: Chris Peiffer <peifferc@CS.Stanford.EDU>
* Simplify kqueue API slightly.jlemon2000-07-181-20/+16
| | | | Discussed on: -arch
* Report a file type (S_IFIFO) in kqueue_stat().chris2000-06-281-0/+1
|
* Add code so that the udata field is preserved across a TRACK event.jlemon2000-06-221-9/+18
| | | | | | | | | When re-adding an event, do not reset the event state. If the event was pending, it will remain pending. This allows the user to change the udata field after the event was registered, while not losing any events which have already occurred. Reported by: jmg
* malloc(..., M_WAITOK) will not return NULL, so remove the errorjlemon2000-06-101-34/+15
| | | | | | | | handling for this case (which was slightly broken anyway) Fix up some whitespace problems while I'm here too. Submitted by: alfred (in a slightly different form)
* Back out the previous change to the queue(3) interface.jake2000-05-261-3/+3
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-3/+3
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Back out NOTE_EXIT status reporting pending discussion.green2000-05-211-5/+0
|
* Put the wait(2) exit status in "data" for NOTE_EXIT kevents.green2000-05-171-0/+5
|
* Fix one bug where the kn_head list could be manipulated withoutjlemon2000-05-041-2/+8
| | | | | | | | | spl() protection in the case of a copyout error. Add missing spl calls around the intial activation call that is done when when the kevent is added. Add two KASSERT macros to help catch errors in the future.
* Add files that I forgot to `cvs add' on last commit.jlemon2000-04-161-0/+907
OpenPOWER on IntegriCloud