summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Add a comment about how we should use vn_open() here instead of directlyrwatson2002-06-141-0/+4
| | | | | invoking VOP_OPEN(). This would reduce code redundancy with the rest of the kernel, and also is required for MAC to work properly.
* catch up with ktrace changes, KTRPOINT takes a 'struct thread' notalfred2002-06-111-2/+2
| | | | 'struct proc' now.
* Catch up to changes in ktrace API.jhb2002-06-071-2/+2
|
* Fix typo in the BSD copyright: s/withough/without/schweikh2002-06-029-9/+9
| | | | | Spotted and suggested by: des MFC after: 3 weeks
* Back out my lats commit of locking down a socket, it conflicts with hsu's work.tanimura2002-05-312-23/+10
| | | | Requested by: hsu
* correct commented out preprocessor test for i386 to __i386__alfred2002-05-301-1/+1
|
* Fixed a printf format error. It was old and should have been detected bybde2002-05-251-1/+1
| | | | gcc-2.9x, but somehow wasn't fixed already.
* Lock down a socket, milestone 1.tanimura2002-05-202-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred
* Change p_can{debug,see,sched,signal}()'s first argument to be a threadjhb2002-05-191-1/+1
| | | | | | | pointer instead of a proc pointer and require the process pointed to by the second argument to be locked. We now use the thread ucred reference for the credential checks in p_can*() as a result. p_canfoo() should now no longer need Giant.
* In msgrcv(), set msgtyp correctly. Hardwiring 0 as the message typemarcel2002-05-181-1/+1
| | | | | | | | | | yields incorrect behaviour. The hardwiring was present in the very first commit that implemented msgrcv() (revision 1.4) and hasn't been changed since. The native implementation was complete at that time, so there doesn't seem to be a reason for the hardwiring from a technical point of view. Submitted by: Reinier Bezuidenhout <rbezuide@yahoo.com>
* sysctl -w -> sysctldd2002-05-111-2/+2
|
* Zap some stale unused headers, including one machine/psl.h (which ispeter2002-05-011-6/+0
| | | | a stub on alpha). Compile tested on alpha and x86.
* Add an XXX: linux_uselib() should be using vn_open() rather than invokingrwatson2002-04-201-0/+4
| | | | | | | | | | | VOP_OPEN() and doing lots of manual checking. This would further centralize use of the name functions, and once the MAC code is integrated, meaning few extraneous MAC checks scattered all over the place. I don't have time to fix this now, but want to make sure it doesn't get forgotten. Anyone interested in fixing this should feel free. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* - Lock proctree_lock instead of pgrpsess_lock.jhb2002-04-161-1/+1
| | | | - Exclusively lock proctree_lock while calling leavepgrp().
* Rework logic of syscalls that modify process credentials as described injhb2002-04-132-25/+39
| | | | rev 1.152 of sys/kern/kern_prot.c.
* - p_cansee() needs the target process locked.jhb2002-04-131-17/+15
| | | | - We need the proc lock held for more of procfs_doprocstatus().
* Use proc lock to protect p_ucred pointer while we deference it to read ajhb2002-04-111-0/+4
| | | | few values.
* Use td_ucred in a few spots.jhb2002-04-111-3/+3
|
* Initial support for executing IA-32 binaries. This will not compiledfr2002-04-106-0/+2839
| | | | | | | | | without a few patches for the rest of the kernel to allow the image activator to override exec_copyout_strings and setregs. None of the syscall argument translation has been done. Possibly, this translation layer can be shared with any platform that wants to support running ILP32 binaries on an LP64 host (e.g. sparc32 binaries?)
* - Change fill_kinfo_proc() to require that the process is locked when itjhb2002-04-092-4/+7
| | | | | | | | | | | | | | is called. - Change sysctl_out_proc() to require that the process is locked when it is called and to drop the lock before it returns. If this proves too complex we can change sysctl_out_proc() to simply acquire the lock at the very end and have the calling code drop the lock right after it returns. - Lock the process we are going to export before the p_cansee() in the loop in sysctl_kern_proc() and hold the lock until we call sysctl_out_proc(). - Don't call p_cansee() on the process about to be exported twice in the aforementioned loop.
* Moved signal handling and rescheduling from userret() to ast() so thatbde2002-04-042-0/+5
| | | | | | | | | | | they aren't in the usual path of execution for syscalls and traps. The main complication for this is that we have to set flags to control ast() everywhere that changes the signal mask. Avoid locking in userret() in most of the remaining cases. Submitted by: luoqi (first part only, long ago, reorganized by me) Reminded by: dillon
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-015-6/+6
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Protect proc struct (p_args and p_comm) when doing procfs IO that pullsalfred2002-03-291-11/+17
| | | | | | data from it. Submitted by: Jonathan Mini <mini@haikugeek.com>
* Make the reference counting of 'struct pargs' SMP safe.alfred2002-03-271-2/+1
| | | | | | | | | There is still some locations where the PROC lock should be held in order to prevent inconsistent views from outside (like the proc->p_fd fix for kern/vfs_syscalls.c:checkdirs()) that can be fixed later. Submitted by: Jonathan Mini <mini@haikugeek.com>
* Fixed some style bugs in the removal of __P(()). Tabs before "__P(("bde2002-03-241-6/+6
| | | | were not removed.
* Remove references to vm_zone.h and switch over to the new uma API.jeff2002-03-204-5/+2
|
* Remove __P.alfred2002-03-2026-280/+274
|
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-279-23/+22
| | | | reference.
* Use the updated getcredhostname() function.robert2002-02-272-5/+2
|
* - Use the new getcredhostname function in the SVR4 uname system call.robert2002-02-271-2/+3
| | | | | | - Remove spurious empty line. Reviewed by: phk
* Use the getcredhostname function to fill the hostname intorobert2002-02-271-1/+3
| | | | | | | | the linux_newuname_args structure. This should fix the case of jailed linux processes not using the jail's hostname. PR: 35336 Reviewed by: phk
* remove "discards qualifier" erro by not potentially writing tojulian2002-02-261-2/+5
| | | | a const *.
* Lock struct pgrp, session and sigio.tanimura2002-02-233-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current)
* fix file descriptor leak.alfred2002-02-201-1/+2
| | | | Submitted by: Mark Santcroos <marks@ripe.net>
* Garbage collect options AVM_A1_PCI, AVM_A1_PCMCIA, DEBUG_LINUX, DEV_APM,bde2002-02-151-2/+0
| | | | | GUS_DMA, GUS_DMA2, GUS_IRQ, OLTR_NO_BULLSEYE_MAC, OLTR_NO_HAWKEYE_MAC, OLTR_NO_TMS_MAC and PCIC_RESUME_RESET.
* Attempt to unmangle some code touched in the previous commit.peter2002-02-071-11/+8
|
* Pre-KSE/M3 commit.julian2002-02-071-11/+17
| | | | | | | | | | this is a low-functionality change that changes the kernel to access the main thread of a process via the linked list of threads rather than assuming that it is embedded in the process. It IS still embeded there but remove all teh code that assumes that in preparation for the next commit which will actually move it out. Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
* include sys/lock.h and sys/mutex.h to make compile.alfred2002-01-301-0/+2
| | | | Noticed by: Vincent Poy <vince@oahu.WURLDLINK.NET>
* Have SIOCGIFCONF return all (if any) AF_INET addresses for themarcel2002-01-291-4/+22
| | | | | | | | | | | | | | | | | | | | | interfaces we encounter. In Linux, all addresses are returned for which gifconf handlers are installed. This boils down to AF_DECnet and AF_INET. We care mostly about AF_INET for now. Adding additional families is simple enough. Returning the addresses is important for RPC clients to function properly. Andrew found in some reference code that the logic that handles the retransmission looks for an interface that's up and has an AF_INET address. This obviously failed as we didn't return any addresses at all. Note also that with this change we don't return interfaces that don't have AF_INET addresses, whereas before we returned any interface present in the system. This is in line with what Linux does (modulo interfaces with only AF_DECnet addresses of course :-) Reported by: "Andrew Atrens" <atrens@nortelnetworks.com> MFC after: 1 week
* Linux/alpha uses the same BSDish return mechanism we do forgallatin2002-01-231-0/+4
| | | | | | | | getpid, getuid, getgid and pipe, since they bootstrapped from OSF/1 and never cleaned up. Switch to the native syscalls on alpha so that the above functions work MFC after: 7 days
* Lock the caller process if the pid passed to getsid() or getpgid()tanimura2002-01-191-4/+6
| | | | equals to zero.
* For getsid(), return the sid stored in struct session. This preventstanimura2002-01-191-1/+1
| | | | | | panic in case where a session has no session leader. Inspired by: Solaris 8
* Make compile, remove extra fdrop() calls.alfred2002-01-191-3/+1
| | | | Change name of function to what it's supposed to be (s/sys/do)
* make compile, add missing { and variable declaration.alfred2002-01-191-2/+2
|
* Semi-backout previous fgetvp change, we need the struct file pointeralfred2002-01-191-7/+11
| | | | to perform relative offset calculations, so use fget instead.
* fix typo, there's uap, just fdalfred2002-01-161-1/+1
|
* Reinstate linux_ifname. Although the Linuxulator doesn't use itmarcel2002-01-151-0/+27
| | | | | | itself, it's used outside the Linuxulator. Reimplement the function so that its behaviour matches the current renaming scheme. It's probably better to formalize these interdependencies.
* Replace ffind_* with fget calls.alfred2002-01-147-58/+38
| | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf().
* Remove unused variable.alfred2002-01-131-1/+0
|
* Some of the KSE stuff was accidentally reverted by file locking,alfred2002-01-131-5/+5
| | | | | | fix it. Pointed out by: jhb
OpenPOWER on IntegriCloud