summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_acct.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace.rob2021-01-291-3/+2
|
* Reference unveil(2) in system accounting and daily.8.rob2020-07-261-2/+2
| | | | | | | Reminder that unveil does not kill from brynet and gsoares. Wording tweaks from jmc; feedback from deraadt. ok jmc@, millert@, solene@, "fine with me" deraadt@
* struct proc: change ps_start from utc time to uptimecheloha2019-10-221-6/+8
| | | | | | | | | Allows us to determine how long a process has been running, even if the UTC clock jumps. With help from bluhm@ and millert@, who squashed several bugs. ok bluhm@ millert@
* Fix vn_open to require an op of 0, and 0 or KERNELPATH only as flags.beck2019-10-061-2/+2
| | | | | | | | sweep tree to correct NDIINT op and flags ahead of time. document the requirement. This allows KERNELPATH to be used to bypass unveil for crash dumps with nosuidcoredump=2 or 3 ok visa@ deraadt@ florian@
* Serialize access to the vnode pointers associated with acct(2) systemanton2019-08-151-9/+35
| | | | | | | | | accounting. Prevents a race where the acct thread and the acct(2) syscall both tries to close a vnode. ok visa@ Reported-by: syzbot+bf2ac4d4fa9ee92903b8@syzkaller.appspotmail.com
* Add tsleep_nsec(9), msleep_nsec(9), and rwsleep_nsec(9).cheloha2019-07-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Equivalent to their unsuffixed counterparts except that (a) they take a timeout in terms of nanoseconds, and (b) INFSLP, aka UINT64_MAX (not zero) indicates that a timeout should not be set. For now, zero nanoseconds is not a strictly valid invocation: we log a warning on DIAGNOSTIC kernels if we see such a call. We still sleep until the next tick in such a case, however. In the future this could become some sort of poll... TBD. To facilitate conversions to these interfaces: add inline conversion functions to sys/time.h for turning your timeout into nanoseconds. Also do a few easy conversions for warmup and to demonstrate how further conversions should be done. Lots of input from mpi@ and ratchov@. Additional input from tedu@, deraadt@, mortimer@, millert@, and claudio@. Partly inspired by FreeBSD r247787. positive feedback from deraadt@, ok mpi@
* Revert to using the SCHED_LOCK() to protect time accounting.mpi2019-06-011-3/+1
| | | | | | | | | It currently creates a lock ordering problem because SCHED_LOCK() is taken by hardclock(). That means the "priorities" of a thread should be moved out of the SCHED_LOCK() first in order to make progress. Reported-by: syzbot+8e4863b3dde88eb706dc@syzkaller.appspotmail.com via anton@ as well as by kettenis@
* Use a per-process mutex to protect time accounting instead of SCHED_LOCK().mpi2019-05-311-1/+3
| | | | | | | Note that hardclock(9) still increments p_{u,s,i}ticks without holding a lock. ok visa@, cheloha@
* Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysvisa2018-04-281-2/+2
| | | | | | | curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
* Remove almost unused `flags' argument of suser().mpi2018-02-191-2/+2
| | | | | | | The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
* Don't pull in <sys/file.h> just to get fcntl.hguenther2017-12-301-2/+2
| | | | ok deraadt@ krw@
* p_comm is the process's command and isn't per thread, so move it fromguenther2017-01-211-2/+2
| | | | | | struct proc to struct process. ok deraadt@ kettenis@
* Remove the unused flags argument from VOP_UNLOCK().natano2016-03-191-2/+2
| | | | | | torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
* Change a bunch of (<blah> *)0 to NULL.krw2016-03-141-3/+3
| | | | ok beck@ deraadt@
* remove stale lint annotationstedu2015-12-051-2/+1
|
* convert bcopy to memcpy. ok millerttedu2014-12-101-2/+2
|
* Eliminates struct pcred by moving the real and saved ugids intoguenther2014-03-301-3/+3
| | | | | | | | | struct ucred; struct process then directly links to the ucred Based on a discussion at c2k10 or so before noting that FreeBSD and NetBSD did this too. ok matthew@
* Convert some internal APIs to use timespecs instead of timevalsguenther2013-06-031-12/+12
| | | | ok matthew@ deraadt@
* Use IO_NOLIMIT instead of munging the process's limitsguenther2012-07-081-18/+3
| | | | ok beck@
* move accounting flags to struct process; idea and ok guenthermikeb2012-04-121-2/+2
|
* Make rusage totals, itimers, and profile settings per-process insteadguenther2012-03-231-13/+14
| | | | | | | of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-3/+4
| | | | | | | | | so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
* fix typos in comments, no code changes;schwarze2010-01-141-2/+2
| | | | | from Brad Tilley <brad at 16systems dot com>; ok oga@
* move p_limit and p_cred into struct processtedu2007-04-121-6/+6
| | | | | leave macros behind for now to keep the commit small ok art beck miod pedro
* Retire VOP_LEASE(); It was a bit for NQNFS and hasthib2007-01-161-2/+1
| | | | | | | | | effectively been a no-op for quite some time now, without promise for future usage. ok pedro@ Testing by krw@ (earlier diff) and Johan Mson Lindman (tybollt@solace.miun.se)
* grammar, spelling, and style fixes from bret lambert;jmc2006-11-141-2/+2
| | | | kern_descrip.c change ok deraadt
* if a kthread fails to call kthread_exit() but instead returns,tedu2006-01-051-5/+6
| | | | bad things happen. fix acct thread. from art
* ansi/deregister.jsg2005-11-281-5/+2
| | | | 'go for it' deraadt@
* have vn_close() lock the vnode before calling VOP_CLOSE().marius2005-05-281-4/+7
| | | | | | fix the acct_*() code so that we always have a proc to lock on. ok pedro@
* This moves access to wall and uptime variables in MI code,tholo2004-06-241-5/+4
| | | | | | | | | | | | | | encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
* shutdown accounting before shutting down vfs. should prevent some panics.tedu2004-05-271-1/+13
| | | | ok david@ millert@ (iirc)
* match syscallargs comments with realityhenning2003-09-011-2/+2
| | | | | from Patrick Latifi <patrick.l@hermes.usherb.ca> ok jason@ tedu@
* change arguments to suser. suser now takes the process, and a flagstedu2003-08-151-2/+2
| | | | | | | | | argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Move the accounting disk space watcher into a kernel thread.art2001-11-021-50/+62
| | | | | | Since we do filesystem operations, we need process context. This should fix accounting on nfs.
* Don't set filesize limit to infinity on exit.art2000-05-051-3/+22
| | | | | | | This is only needed in accounting and has to be done carefully because the limit structures are shared between processes. Found by Denis A. Doroshenko, analysed by Hannah Schroeter.
* convert to new timeouts.art2000-03-231-6/+11
|
* Return EINVAL when msg_iovlen or iovcnt <= 0; Make uio_resid unsigned (size_t) and don't return EINVAL if it is < 0 in sys_{read,write}. Remove check for uio_resid < 0 uiomove() now that uio_resid is unsigned and brack remaining panics with #ifdef DIAGNOSTIC. vn_rdwr() must now take a size_t * ↵millert1998-07-281-3/+2
| | | | as its 9th argument so change that and clean up uses of vn_rdwr(). Fixes 549 + more
* for acct(), vn_open() with O_APPEND flag so that append-only files work;deraadt1998-05-171-2/+2
| | | | problem pointed out by andrew@untraceable.net
* Updates for VFS Lite 2 + soft update.csapuntz1997-11-061-2/+2
|
* back out vfs lite2 till after 2.2deraadt1997-10-061-2/+2
|
* VFS Lite2 Changescsapuntz1997-10-061-2/+2
|
* From NetBSD: 960217 mergeniklas1996-03-031-3/+4
|
* initial import of NetBSD treederaadt1995-10-181-0/+304