summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_usrreq.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* describe why fd passing is now so fucked up, and who's fault it isderaadt2008-04-151-8/+4
|
* Make sure the fd passing code only accepts control messages without paddingkettenis2008-04-101-2/+3
| | | | | | and with exactly the right amount of padding. diff actually typed in by deraadt@
* unp_internalize() repaired wrong file structs on error. ok deraadt@, kettenis@stefan2008-04-081-2/+2
|
* repair code which blocks passing fd's for block devices orderaadt2008-04-021-10/+8
| | | | | dir-outside-chroot-directory into a chroot jail ok markus
* We were led astray (like many others before us) to believe thatderaadt2008-03-241-2/+10
| | | | | | | | | | | | | | | msg_controllen should be CMSG_LEN() instead of CMSG_SPACE() because the kernel fd passing code was erroring out when "cm->cmsg_len != control->m_len" instead of "CMSG_ALIGN(cm->cmsg_len) != control->m_len". On machines with 16-byte alignment, when one thinks about how the ALIGN padding happens, it is clear that msg_controllen has to be CMSG_SPACE() or the kernel cannot hope to bounds check the messages correctly. For now, change the check to cm->cmsg_len > control->m_len to permit the old ABI to continue working. Later perhaps when all the old binaries are gone we can stop permitting their use. lots of discussion with kettenis
* a few more places where getmicrotime is good enough. ok miodtedu2007-11-281-2/+2
|
* For fd passing, at externalize time we are dealing with int[] not pointer[],deraadt2007-10-291-2/+2
| | | | | | so we need to correct the mbuf length using CMSG_LEN() not CMSG_SPACE() test case was sparc64 sending 2 (or more) descriptors ok millert thib
* Use M_ZERO in a few more places to shave bytes from the kernel.art2007-09-071-3/+2
| | | | eyeballed and ok dlg@
* 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)
* Make getpeereid() work on both sides of a connection. The client can now getclaudio2006-11-171-2/+11
| | | | | | | the euid/egid of the server it connects to. The euid and egid are captured in the bind() call -- this is the equivalent of the client behaviour where the same thing is done in connect(). tested and ok espie@, ok henning@, go for it deraadt@
* undo unp_internalize in case of errors; report Christian Biere; ok claudiomarkus2006-10-311-1/+4
|
* Do not stupidly panic but return ENOTCONN when trying to pass fds on anmiod2006-02-271-3/+5
| | | | | unconnected socket; reported by Christian Biere <christianbiere at gmx dot de> ok claudio@ deraadt@
* ansi/deregisterjsg2006-01-051-59/+32
|
* under some circunstances, unp_scan() can call unp_mark() with a null pointer,fgsch2005-05-171-1/+3
| | | | | so check fp before dereferencing it; fixes a crash found by hshoexer@ with input from art@, art@ millert@ deraadt@ ok.
* remove p arg from fdplocktedu2004-07-221-2/+2
|
* This moves access to wall and uptime variables in MI code,tholo2004-06-241-4/+2
| | | | | | | | | | | | | | 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@
* use NULL for ptrs. parts from Joris Vinktedu2004-04-011-25/+25
|
* lock filedesc before manipulating. avoids some rare races.tedu2004-01-061-1/+4
| | | | testing for quite some time by brad + otto
* unused vartedu2003-08-171-4/+1
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Use LIST_ macros for the list of all struct file.art2002-08-231-5/+5
|
* First round of __P removal in sysmillert2002-03-141-2/+2
|
* Heh. Don't assume that sizeof(void *) > sizeof(int).art2002-02-191-5/+5
|
* Big fixup of fd passing. It now works, even on sparc64.art2002-02-111-49/+93
| | | | Some parts from NetBSD, but with big modifications.
* - Rename FILE_{,UN}USE to FREF and FRELE. USE is a bad verb and we don't haveart2002-02-081-3/+3
| | | | | | | | | | | | | | the same semantics as NetBSD anyway, so it's good to avoid name collissions. - Always fdremove before freeing the file, not the other way around. - falloc FREFs the file. - have FILE_SET_MATURE FRELE the file (It feels like a good ortogonality to falloc FREFing the file). - Use closef as much as possible instead of ffree in error paths of falloc:ing functions. closef is much more careful with the fd and can deal with the fd being forcibly closed by dup2. Also try to avoid manually calling *fo_close when closef can do that for us (this makes some error paths mroe complicated (sys_socketpair and sys_pipe), but others become simpler (sys_open)).
* Add counting of temporary references to a struct file (as opposed to referencesart2002-02-051-3/+5
| | | | | | | | | | | | | | | from fd tables and other long-lived objects). This is to avoid races between using a file descriptor and having another process (with shared fd table) close it. We use a separate refence count so that error values from close(2) will be correctly returned to the caller of close(2). The macros for those reference counts are FILE_USE(fp) and FILE_UNUSE(fp). Make sure that the cases where closef can be called "incorrectly" (most notably dup2(2)) are handled. Right now only callers of closef (and {,p}read) use FILE_{,UN}USE correctly, more fixes incoming soon.
* Be more consistent about using fd_getfile where it matters.art2002-02-021-5/+7
|
* - every new fd created by falloc() is marked as larval and should not be usedart2001-10-261-3/+2
| | | | | | | any anyone. Every caller of falloc matures the fd when it's usable. - Since every lookup in the fd table must now check this flag and all of them do the same thing, move all the necessary checks into a function - fd_getfile.
* - split fdalloc into two functions. fdalloc now returns ENOSPC if itart2001-10-261-19/+100
| | | | | | | | | | would have to grow the table and fdexpand that grows the table. Since fdexpand can sleep we have to restart all operations if we have to call it. - dup2 changed so that finishdup frees the destination descriptor. - unp_externalize is a completly rewritten version from NetBSD. Changes mostly inspired by NetBSD.
* implement djb's getpeereid(2), to allow local-domain servers to determine client credentials. mostly from superscript.com. deraadt@ okdugsong2001-06-261-2/+14
|
* Move offsetof define into sys/param.hcsapuntz2001-04-061-2/+1
|
* for AF_UNIX, do not follow symlinks when creating sockets, terminatederaadt1999-10-111-9/+10
| | | | names more carefully; art
* Check that a socket we're closing is really a socket. dillon@freebsdangelos1999-02-051-2/+3
|
* crank f_count/f_msgcount to long; when incrementing try to leave 2 slotsderaadt1998-03-011-2/+5
| | | | empty for unp_gc() in case of cross referenced sockets. part by millert
* kleink: When fstat(2)ing a file descriptor of a local communications domainderaadt1997-11-171-1/+7
| | | | | | | socket, fill the socket's creation time into the stat structure's st_[acm]time fields: POSIX requires this behavior for pipe(2). N.B.: updating the st_[am]time fields when reading/writing the pipe is neither required nor implemented, though.
* 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
|
* fix sendmsg() credential passing on 64 bit machines, i hope. (this was hellish)deraadt1997-06-051-21/+37
|
* consider umask for AF_UNIX bind()deraadt1996-06-251-2/+2
|
* From NetBSD: 960217 mergeniklas1996-03-031-6/+8
|
* initial import of NetBSD treederaadt1995-10-181-0/+840