summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
AgeCommit message (Collapse)Author
2015-07-19tame(2) is a subsystem which restricts programs into a "reduced featureTheo de Raadt
operating model". This is the kernel component; various changes should proceed in-tree for a while before userland programs start using it. ok miod, discussions and help from many
2015-05-07Pass a thread pointer instead of its file descriptor table to getvnode(9).Martin Pieuchot
Input and ok millert@
2015-04-30Indroduce fd_getfile_mode() and use it were fd_getfile() is directlyMartin Pieuchot
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@
2015-04-17Tweaks utimensat/futimens handling to always update ctime, even when bothPhilip Guenther
atime and mtime are UTIME_OMIT (at least for ufs, tmpfs, and ext2fs), and to correctly handle a timestamp of -1. ok millert@
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2014-12-16primary change: move uvm_vnode out of vnode, keeping only a pointer.Ted Unangst
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
2014-12-08Add chflagsat(), modeled on fchmodat() with name to match FreeBSD.Philip Guenther
2014-11-14prefer sizeof(*ptr) to sizeof(struct) for malloc and freeTed Unangst
2014-11-03include sys/unistd.h where needed instead of indirect reliance. ok jsgTed Unangst
2014-11-03pass size argument to free()Theo de Raadt
ok doug tedu
2014-10-22Extend domknodat() to support S_IFIFO directly and remove domkfifoat().Todd C. Miller
Both sys_mkfifo(2) and sys_mkfifoat(2) could be replace by libc wrappers using mknodat(2) at a later date if we desire. OK guenther@
2014-10-13POSIX says that mknod(2) should support fifos. OK guenther@Todd C. Miller
2014-09-18Correct argument name (int flags -> int amode) in sys_access().Masao Uebayashi
OK guenther@
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-05-25In access(), use the real UID/GID for the path search too.Philip Guenther
ok matthew@
2014-04-12revert falloc change, as it causes all new processes to get stuck after a whileMarc Espie
(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 ?
2014-03-30Eliminates struct pcred by moving the real and saved ugids intoPhilip Guenther
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@
2014-03-08split falloc into two functions, the allocation and the publication.Ted Unangst
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
2014-01-21bzero -> memsetTed Unangst
2014-01-20Fix commentPhilip Guenther
2013-12-01Change 'mountlist' from CIRCLEQ to TAILQ. Be paranoid andKenneth R Westerback
use TAILQ_*_SAFE more than might be needed. Bulk ports build by sthen@ showed nobody sticking their fingers so deep into the kernel. Feedback and suggestions from millert@. ok jsing@
2013-10-25fix commentTodd C. Miller
2013-09-14Snapshots for all archs have been built, so remove the T32 codePhilip Guenther
2013-08-16Tweak the getdents() kernel prototype to use "void *"Philip Guenther
Provide a declaration for userspace Fix the kernel's sanity check on the buflen argument lack of prototype pointed out by sthen@ and landry@ ok kettenis@ otto@
2013-08-14The last user of the old __tfork() was updated to the current one,Philip Guenther
so COMPAT_O51 can go. The complete ABI role means COMPAT_O53 can be removed as well. ok jsing@ tedu@
2013-08-13Switch time_t, ino_t, clock_t, and struct kevent's ident and dataPhilip Guenther
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@
2013-08-08Drop the retval argument from do*at() functions which don't use it.Philip Guenther
ok kettenis@ mpi@ deraadt@ millert@ miod@ matthew@ beck@
2013-06-05Move FHASLOCK from f_flag to f_iflags, freeing up a bit for passingPhilip Guenther
O_* flags and eliminating an XXX comment. ok matthew@ deraadt@
2013-04-15Add an f_mntfromspec member to struct statfs, which specifies the name ofJoel Sing
the special provided when the mount was requested. This may be the same as the special that was actually used for the mount (e.g. in the case of a device node) or it may be different (e.g. in the case of a DUID). Whilst here, change f_ctime to a 64 bit type and remove the pointless f_spare members. Compatibility goo courtesy of guenther@ ok krw@ millert@
2013-03-28When updating fd_cdir or fd_rdir, put the new pointer in placePhilip Guenther
_before_ vrele()'ing the old one, so that you can't catch the process with a vnode with no references. Similarly, in checkdirs(), just count the needed releases and do them all at the end. (I think I saw this in FreeBSD.) Original problem encountered by landry@ (yay for backtrace) ok tedu@ deraadt@
2013-01-30In doreadlinkat(), only access auio.uio_resid if it's already beenMatthew Dempsky
initialized. (In the case where it wasn't initialized, the computed *retval ends up getting clobbered by the EINVAL error anyway so it's not an info leak, but it's still technically undefined behavior.) pointed out by Maxime Villard on tech ok guenther
2012-09-10Cleanup VFS mount string handling:Joel Sing
- Avoid using copyinstr() without checking the return value. - sys_mount() has already copied the path in, so pass this to the filesystem mount code so that it does not have to copy it in again. - Avoid copyinstr()/bzero() dance when we can simply bzero() and strlcpy(). ok krw@
2012-09-10delete compat_o48_sys_getdirentries; ok guentherTheo de Raadt
2012-07-11Revert the blocked FIFO open fix, as there's either a race in thePhilip Guenthe
ref-count handling under handling, or blambert@ is messing with my head
2012-07-10Don't release a FILE that wan't allocated. Found by benno@Philip Guenthe
ok matthew@ benno@
2012-07-08Don't hold the fd-table lock across vn_open(), as opening a FIFO may block.Philip Guenthe
Having done that, dupfdopen() has to handle a possible race. ok matthew@ krw@
2012-05-21Cleanup O_CLOEXEC handling and make sure UF_EXCLOSE is set correctlyMatthew Dempsky
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
2012-05-14Remove the "vn_open() returning ENXIO means dup+close" hook thatPhilip Guenthe
was used by the now defunct portalfs. Zero out fd_ofileflags[fd] when allocating an fd instead of when releasing it. ok krw@ matthew@
2012-04-22Add struct proc * argument to FRELE() and FILE_SET_MATURE() inPhilip Guenthe
anticipation of further changes to closef(). No binary change. ok krw@ miod@ deraadt@
2012-03-19Add tracing and dumping of "pointer to struct" syscall arguments forPhilip Guenthe
structs timespec, timeval, sigaction, and rlimit. ok otto@ jsing@
2011-11-06Negative offsets to pread/pwrite-family are only legal for character devices.Philip Guenthe
Pointed out by Alexander Polakov (polachok at gmail.com) ok deraadt@
2011-11-05ttys can't seek, so make pread/pwrite/preadv/pwritev fail with ESPIPEPhilip Guenthe
on them too ok deraadt@, miod@
2011-07-25Make sure vfsp is not used uninitialized in the mount -o update case;Miod Vallat
ok krw@ matthew@
2011-07-18Add support for UTIME_OMIT and UTIME_NOW to utimensat(2), add theMatthew Dempsky
futimens(2) system call, and refactor futimes(2) to share the same code. (As with other openat(2) system call stuff, this is not exposed to userland yet.) naddy@ pointed out rsync expects UTIME_* if openat(2) is available tweaks and ok guenther@; tested by naddy@ in a bulk build
2011-07-14Add support for AT_REMOVEDIR to unlinkat(2), and switch sys_rmdir() toMatthew Dempsky
use it. ok tedu@, guenther@
2011-07-12Fix typo that caused fchownat(2) and fchmodat(2) to try to dereferenceMatthew Dempsky
symbolic links even when the AT_SYMLINK_NOFOLLOW flag is passed. noticed by naddy@ testing gnulib ok deraadt@ and presumably tedu@ (who wrote a similar diff)
2011-07-09Fix up previous diff: use COMPAT_O48 instead of COMPAT_48, add optionMatthew Dempsky
to GENERIC, wrap compat_o48_sys_getdirentries() with an appropriate #ifdef, and use struct compat_o48_sys_getdirentries_args instead of struct sys_getdirentries_args.
2011-07-09More syscalls.master cleanup:Matthew Dempsky
sys_osigaltstack() is 7 years old and no longer needed; all glory to the sys_sigaltstack()! sys_ogetdirentries() is about 9 months old, but still acceptable within our release cycle; move from STD to COMPAT_48 to make this clearer for tedu@ next year. sys_sbrk() and sys_sstk() are completely obsolete: all they do is return ENOSYS. ok guenther@
2011-07-09Add support for the O_CLOEXEC and O_DIRECTORY flags introduced inMatthew Dempsky
POSIX Issue 7. Requested by oga@ (and maybe djm@); ok guenther@