summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_descrip.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* pool_setipldlg2016-08-251-1/+3
| | | | ok kettenis@
* rename nfiles to numfiles to avoid shadowing and stretch out the name.tedu2016-08-231-5/+5
| | | | ok deraadt
* Fix sizes passed to free() in fdfree(). This prevents a panic reportednatano2016-05-291-3/+3
| | | | | by sthen. ok semarie
* add sizes to free() calls for descrip tablestedu2016-05-281-7/+11
|
* remove systrace remnantstedu2016-04-251-4/+3
|
* 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
* remove unnecessary casts where the incoming type is void *.tedu2016-01-061-8/+8
|
* no need to check null before freetedu2015-12-171-5/+3
|
* add size to free. from Mathieutedu2015-12-171-2/+2
|
* remove stale lint annotationstedu2015-12-051-7/+1
|
* refactor pledge_*_check and pledge_fail functionssemarie2015-11-011-6/+6
| | | | | | | | | | | | | | - rename _check function without suffix: a "pledge" function called from anywhere is a "check" function. - makes pledge_fail call the responsability to the _check function. remove it from caller. - make proper use of (potential) returned error of _check() functions. - adds pledge_kill() and pledge_protexec() with and OK deraadt@
* Prevent F_SETOWN, unless a "proc" pledge was made.deraadt2015-10-281-1/+5
|
* Setting fcntl(F_SETOWN) for a pipe failed with inappropriate ioctlbluhm2015-10-211-1/+11
| | | | | | | for device. In sys_fcntl() the ioctl(TIOCSPGRP) is called, but the pipe expects SIOCSPGRP. Sockets have a specal case for the same reason, so adapt the special code for pipes. OK millert@
* Implement real "flock" request and add it to userland programs thatmillert2015-10-161-1/+10
| | | | use pledge and file locking. OK deraadt@
* isatty() is used by stdio to determine the buffering mode. Add a F_ISATTYderaadt2015-05-171-1/+11
| | | | | | | option to fcntl(), so that isatty() can use this rather than than the bloated ioctl() interface. Reducing uses of ioctl() by libc makes it easier to constrain programs with various kinds of systrace sandboxes. ok guenther, previously discussed as a concept with nicm
* Avoid NULL deref in fd_getfile_mode(); OK deraadt@millert2015-04-301-2/+2
|
* Indroduce fd_getfile_mode() and use it were fd_getfile() is directlympi2015-04-301-1/+16
| | | | | | | followed by a mode check. This will simplify the ref/unref dance as soon as fd_getfile() will increment fp's reference counter. Idea from and ok guenther@, ok millert@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* unneccessary cmask variable; ok guentherderaadt2015-01-191-3/+2
|
* start retiring the nointr allocator. specify PR_WAITOK as a flag as atedu2014-12-191-5/+5
| | | | marker for which pools are not interrupt safe. ok dlg
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-1/+2
| | | | | | objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
* Add additional kernel interfaces for setting close-on-exec on fdsguenther2014-08-311-3/+28
| | | | | | | when creating them: pipe2(), dup3(), accept4(), MSG_CMSG_CLOEXEC, SOCK_CLOEXEC. Includes SOCK_NONBLOCK support. ok matthew@
* use mallocarray where arguments are multipled. ok deraadttedu2014-07-131-7/+7
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-9/+9
| | | | after discussions with beck deraadt kettenis.
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-3/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* Use sizeof(struct file *) consistently for memcpy()'ing fd_ofiles.matthew2014-06-151-2/+2
| | | | Pointed out by Jean-Philippe Ouellet.
* Move from struct proc to process the reference-count-holding pointersguenther2014-05-151-16/+7
| | | | | | | | | | to the process's vmspace and filedescs. struct proc continues to keep copies of the pointers, copying them on fork, clearing them on exit, and (for vmspace) refreshing on exec. Also, make uvm_swapout_threads() thread aware, eliminating p_swtime in kernel. particular testing by ajacoutot@ and sebastia@
* revert falloc change, as it causes all new processes to get stuck after a whileespie2014-04-121-43/+14
| | | | | | | | | | | (race condition ?) problem noticed by me, aja, sthen, brynet, rpe. vanishing after this revert, okay aja@, sthen@ tedu, you probably want to look into re-checking the fcreate/fpublish addition first, then if it's stable, see about tweaking doopenat ?
* Eliminates struct pcred by moving the real and saved ugids intoguenther2014-03-301-2/+2
| | | | | | | | | 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@
* split falloc into two functions, the allocation and the publication.tedu2014-03-081-14/+43
| | | | | | | | | | the first part is likely to fail, but we can generally prevent the second part from failing. use these two functions to drop the fdp lock around vn_open in sys_open, but still maintain the original semantics of allocate then open. the goal here is to fix the blocked fifo deadlock in a threaded program. testing volunteers in short supply, resorting to conscription
* Snapshots for all archs have been built, so remove the T32 codeguenther2013-09-141-27/+1
|
* Switch time_t, ino_t, clock_t, and struct kevent's ident and dataguenther2013-08-131-2/+27
| | | | | | | | | | | | | | | | | | | | members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
* Format string fixes:sf2013-07-041-3/+3
| | | | | | | | f_count is long ok kettenis@ Change esm_sensor_map.arg to int ok deraadt@
* convert some easy bcopy to memcpy and clean up fdexpand a bit.tedu2013-06-111-21/+23
| | | | ok kettenis
* Move FHASLOCK from f_flag to f_iflags, freeing up a bit for passingguenther2013-06-051-3/+3
| | | | | | O_* flags and eliminating an XXX comment. ok matthew@ deraadt@
* To protect assumptions inside systrace, don't let systrace fds beguenther2012-08-231-16/+16
| | | | | | shared between processes. ok djm@
* Revert the blocked FIFO open fix, as there's either a race in theguenther2012-07-111-21/+6
| | | | ref-count handling under handling, or blambert@ is messing with my head
* Don't hold the fd-table lock across vn_open(), as opening a FIFO may block.guenther2012-07-081-6/+21
| | | | | | Having done that, dupfdopen() has to handle a possible race. ok matthew@ krw@
* Cleanup O_CLOEXEC handling and make sure UF_EXCLOSE is set correctlymatthew2012-05-211-2/+3
| | | | | | | | | | when opening /dev/fd/* (i.e., UF_EXCLOSE is now set iff O_CLOEXEC is set, rather than copying UF_EXCLOSE from the file descriptor being dup'd). Also, add support for O_CLOEXEC and O_DIRECTORY to fhopen(). ok krw, guenther; feedback from millert; testing and bug finding by krw
* Remove the "vn_open() returning ENXIO means dup+close" hook thatguenther2012-05-141-48/+14
| | | | | | | was used by the now defunct portalfs. Zero out fd_ofileflags[fd] when allocating an fd instead of when releasing it. ok krw@ matthew@
* Eliminate the f_usecount ref count in struct file; instead of sleepingguenther2012-05-011-30/+16
| | | | | | | | | at the top of closef() until all in-progress calls finish, just do the advisory locking bits required of close() by POSIX and let whichever thread has the last reference do the call to the file's fo_close() method and the final cleanup. lots of discussion with deraadt@ and others; worked out with and ok krw@
* Add struct proc * argument to FRELE() and FILE_SET_MATURE() inguenther2012-04-221-11/+12
| | | | | | anticipation of further changes to closef(). No binary change. ok krw@ miod@ deraadt@
* In this case where dup2() extends the table using fdalloc, the newlyderaadt2012-04-121-1/+2
| | | | | | selected fd is automatically fd_used(). We need to fd_unused() it, because it will be fd_used() again in finishdup(). spotted by guenther ok miod
* New system call: getdtablecount(2) returns the number of filederaadt2012-04-121-1/+10
| | | | | descriptors the process currently has open. ok guenther miod gilles ...
* dup() was calling fd_used() twice for the new file descriptor. Seperatederaadt2012-04-121-7/+8
| | | | | the dup and dup2 cases. with guenther ok miod
* Hold struct filedesc's fd_lock when writing to the fd_ofiles, fd_ofileflags,guenther2012-02-151-9/+25
| | | | | | | | or fd_{lo,hi}maps members, or when doing a read for a write. Fixes hangs when an rthreaded processes sleeps while copying the fd table for fork() and catches another thread with the lock. ok jsing@ tedu@
* Add F_DUPFD_CLOEXEC.matthew2011-07-081-1/+5
| | | | "Sure" deraadt@
* Support sending struct info to kdump. So far for struct stat andotto2011-07-081-1/+6
| | | | struct sockaddress; mostly from freebsd. ok deraadt@ tedu@ nicm@
* Move P_SUGID and P_SUGIDEXEC from struct proc to struct process, soguenther2011-04-021-2/+2
| | | | | | that you can't evade the checks by doing the dirty work in an rthread ok blambert@, deraadt@
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-4/+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