summaryrefslogtreecommitdiffstats
path: root/sys/i386/ibcs2
Commit message (Collapse)AuthorAgeFilesLines
* - Pass the ISOPEN flag to namei so filesystems will know we're about tojeff2005-04-271-1/+2
| | | | open them or otherwise access the data.
* - Change the vm_mmap() function to accept an objtype_t parameter specifyingjhb2005-04-011-5/+9
| | | | | | | | | | | | the type of object represented by the handle argument. - Allow vm_mmap() to map device memory via cdev objects in addition to vnodes and anonymous memory. Note that mmaping a cdev directly does not currently perform any MAC checks like mapping a vnode does. - Unbreak the DRM getbufs ioctl by having it call vm_mmap() directly on the cdev the ioctl is acting on rather than trying to find a suitable vnode to map from. Reviewed by: alc, arch@
* Use kern_settimeofday() to avoid stackgap use.jhb2005-03-311-11/+11
|
* correct bounds check of fd parametersam2005-02-251-1/+1
| | | | Noticed by: Coverity Prevent analysis tool
* Backout previous change (disabling of security checks for signals deliveredsobomax2005-02-131-1/+1
| | | | | | in emulation layers), since it appears to be too broad. Requested by: rwatson
* Split out kill(2) syscall service routine into user-level and kernel part, thesobomax2005-02-131-1/+1
| | | | | | | | | | | | | | | | | former is callable from user space and the latter from the kernel one. Make kernel version take additional argument which tells if the respective call should check for additional restrictions for sending signals to suid/sugid applications or not. Make all emulation layers using non-checked version, since signal numbers in emulation layers can have different meaning that in native mode and such protection can cause misbehaviour. As a result remove LIBTHR from the signals allowed to be delivered to a suid/sugid application. Requested (sorta) by: rwatson MFC after: 2 weeks
* - Implement ibcs2_emul_find() using kern_alternate_path(). This changesjhb2005-02-078-376/+268
| | | | | | | | | | | | | | | | | the semantics in that the returned filename to use is now a kernel pointer rather than a user space pointer. This required changing the arguments to the CHECKALT*() macros some and changing the various system calls that used pathnames to use the kern_foo() functions that can accept kernel space filename pointers instead of calling the system call directly. - Use kern_open(), kern_access(), kern_execve(), kern_mkfifo(), kern_mknod(), kern_setitimer(), kern_getrusage(), kern_utimes(), kern_unlink(), kern_chdir(), kern_chmod(), kern_chown(), kern_symlink(), kern_readlink(), kern_select(), kern_statfs(), kern_fstatfs(), kern_stat(), kern_lstat(), kern_fstat(). - Drop the unused 'uap' argument from spx_open(). - Replace a stale duplication of vn_access() in xenix_access() lacking recent additions such as MAC checks, etc. with a call to kern_access().
* o Split out kernel part of execve(2) syscall into two parts: one thatsobomax2005-01-292-6/+1
| | | | | | | | | | | copies arguments into the kernel space and one that operates completely in the kernel space; o use kernel-only version of execve(2) to kill another stackgap in linuxlator/i386. Obtained from: DragonFlyBSD (partially) MFC after: 2 weeks
* /* -> /*- for license, add FreeBSD tagimp2005-01-0631-32/+48
|
* - Move the function prototypes for kern_setrlimit() and kern_wait() tojhb2005-01-051-0/+1
| | | | | sys/syscallsubr.h where all the other kern_foo() prototypes live. - Resort kern_execve() while I'm there.
* Add missing zero flag arguments to sysctl calls.phk2004-10-123-3/+3
| | | | Add missing pointy hat to peter@
* Regenerate after fcntl() wrappers were marked MP safe.jhb2004-08-243-4/+5
|
* Fix the ABI wrappers to use kern_fcntl() rather than calling fcntl()jhb2004-08-242-48/+19
| | | | | | | | directly. This removes a few more users of the stackgap and also marks the syscalls using these wrappers MP safe where appropriate. Tested on: i386 with linux acroread5 Compiled on: i386, alpha LINT
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-1/+1
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES.phk2004-06-212-0/+7
|
* Nice, is a property of a process as a whole..julian2004-06-161-2/+2
| | | | | I mistakenly moved it to the ksegroup when breaking up the process structure. Put it back in the proc structure.
* Regen from ibcs2_wait() becoming MPSAFE.rwatson2004-03-283-5/+4
| | | | Submitted by: Dan Nelson <dnelson@allantgroup.com>
* ibcs2_wait() now MPSAFE.rwatson2004-03-281-1/+1
| | | | Submitted by: Dan Nelson <dnelson@allantgroup.com>
* - Replace wait1() with a kern_wait() function that accepts the pid,jhb2004-03-171-23/+15
| | | | | | | | | | | | | | | options, status pointer and rusage pointer as arguments. It is up to the caller to copyout the status and rusage to userland if needed. This lets us axe the 'compat' argument and hide all that functionality in owait(), by the way. This also cleans up some locking in kern_wait() since it no longer has to drop locks around copyout() since all the copyout()'s are deferred. - Convert owait(), wait4(), and the various ABI compat wait() syscalls to use kern_wait() rather than wait1() or wait4(). This removes a bit more stackgap usage. Tested on: i386 Compiled on: i386, alpha, amd64
* Regen.jhb2004-02-063-19/+19
|
* Sync up MP safe flags with global syscalls.master. This includes write(),jhb2004-02-061-16/+16
| | | | | | close(), getpid(), ibcs2_setuid(), getuid(), ptrace(), ibcs2_pause(), ibcs2_nice(), ibcs2_kill(), ibcs2_pgrpsys(), dup(), pipe(), ibcs2_setgid(), getgid(), umask(), and sigreturn().
* Regen.jhb2004-02-048-11/+11
|
* The following compat syscalls are now mpsafe: linux_getrlimit(),jhb2004-02-043-3/+3
| | | | | | | linux_setrlimit(), linux_old_getrlimit(), osf1_getrlimit(), osf1_setrlimit(), svr4_sys_ulimit(), svr4_sys_setrlimit(), svr4_sys_getrlimit(), svr4_sys_setrlimit64(), svr4_sys_getrlimit64(), ibcs2_sysconf(), and ibcs2_ulimit().
* Locking for the per-process resource limits structure.jhb2004-02-041-51/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64
* GC unused 'syshide' override to /dev/null. This was here to disablepeter2003-12-243-3/+0
| | | | | the output of the namespc column. Its functionality was removed some time ago, but the overrides and the namespc column remained.
* Oops, remove references to namespc column in comment (I'm not going topeter2003-12-241-2/+1
| | | | bother regenerating after this)
* Regen. (This should have been a NOP except it hasn't been regeneratedpeter2003-12-248-317/+351
| | | | | after makesyscalls.sh changes and the last few syscall.master changes, and there have been some tree-sweeps that have touched generated files).
* GC namespc column and unwrap long lines that now fit.peter2003-12-243-234/+222
|
* Replace the dangerous strcpy() call with strlcpy(), instead of the safe onetjr2003-11-181-2/+2
| | | | | | that was incorrectly changed in rev. 1.61. Approved by: re
* Fix a multitude of security bugs in the iBCS2 emulator:tjr2003-10-126-12/+42
| | | | | | | | | | | | | | | | | | | | - Return NULL instead of returning memory outside of the stackgap in stackgap_alloc() (FreeBSD-SA-00:42.linux) - Check for stackgap_alloc() returning NULL in ibcs2_emul_find(); other calls to stackgap_alloc() have not been changed since they are small fixed-size allocations. - Replace use of strcpy() with strlcpy() in exec_coff_imgact() to avoid buffer overflow - Use strlcat() instead of strcat() to avoid a one byte buffer overflow in ibcs2_setipdomainname() - Use copyinstr() instead of copyin() in ibcs2_setipdomainname() to ensure that the string is null-terminated - Avoid integer overflow in ibcs2_setgroups() and ibcs2_setgroups() by checking that gidsetsize argument is non-negative and no larger than NGROUPS_MAX. - Range-check signal numbers in ibcs2_wait(), ibcs2_sigaction(), ibcs2_sigsys() and ibcs2_kill() to avoid accessing array past the end (or before the start)
* Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bitpeter2003-09-251-1/+2
| | | | | | | | | | | | | | | | | | | | | systems where the data/stack/etc limits are too big for a 32 bit process. Move the 5 or so identical instances of ELF_RTLD_ADDR() into imgact_elf.c. Supply an ia32_fixlimits function. Export the clip/default values to sysctl under the compat.ia32 heirarchy. Have mmap(0, ...) respect the current p->p_limits[RLIMIT_DATA].rlim_max value rather than the sysctl tweakable variable. This allows mmap to place mappings at sensible locations when limits have been reduced. Have the imgact_elf.c ld-elf.so.1 placement algorithm use the same method as mmap(0, ...) now does. Note that we cannot remove all references to the sysctl tweakable maxdsiz etc variables because /etc/login.conf specifies a datasize of 'unlimited'. And that causes exec etc to fail since it can no longer find space to mmap things.
* Remove a few ushorts I missed in my earlier pass.jhb2003-08-151-6/+6
| | | | Requested by: bde
* The iBCS2 system call translator for statfs(2) did not check thenectar2003-08-101-0/+4
| | | | | | length parameter for validity. Submitted by: David Rhodus <drhodus@catpa.com>
* Add a "int fd" argument to VOP_OPEN() which in the future willphk2003-07-261-1/+1
| | | | | | | | | contain the filedescriptor number on opens from userland. The index is used rather than a "struct file *" since it conveys a bit more information, which may be useful to in particular fdescfs and /dev/fd/* For now pass -1 all over the place.
* Add a f_vnode field to struct file.phk2003-06-222-3/+3
| | | | | | | | | | | | Several of the subtypes have an associated vnode which is used for stuff like the f*() functions. By giving the vnode a speparate field, a number of checks for the specific subtype can be replaced simply with a check for f_vnode != NULL, and we can later free f_data up to subtype specific use. At this point in time, f_data still points to the vnode, so any code I might have overlooked will still work.
* Use __FBSDID().obrien2003-06-0219-32/+57
|
* - Replace inline implementations of sigprocmask() with calls tojhb2003-04-221-133/+56
| | | | | | | kern_sigprocmask() in the various binary compatibility emulators. - Replace calls to sigsuspend(), sigaltstack(), sigaction(), and sigprocmask() that used the stackgap with calls to the corresponding kern_sig*() functions instead without using the stackgap.
* - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread withjeff2003-03-311-15/+16
| | | | | | | a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
* Back out M_* changes, per decision of the TRB.imp2003-02-193-4/+4
| | | | Approved by: trb
* Split the global timezone structure into two integer fields tophk2003-02-031-2/+2
| | | | | | | | | | prevent the compiler from optimizing assignments into byte-copy operations which might make access to the individual fields non-atomic. Use the individual fields throughout, and don't bother locking them with Giant: it is no longer needed. Inspired by: tjr
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-213-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Bow to the whining masses and change a union back into void *. Retaindillon2003-01-132-3/+3
| | | | | removal of unnecessary casts and throw in some minor cleanups to see if anyone complains, just for the hell of it.
* Change struct file f_data to un_data, a union of the correct structdillon2003-01-122-3/+3
| | | | | | | | | | pointer types, and remove a huge number of casts from code using it. Change struct xfile xf_data to xun_data (ABI is still compatible). If we need to add a #define for f_data and xf_data we can, but I don't think it will be necessary. There are no operational changes in this commit.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-2/+2
| | | | especially in troff files.
* SCARGS removal take II.alfred2002-12-149-324/+319
|
* Backout removal SCARGS, the code freeze is only "selectively" over.alfred2002-12-139-319/+324
|
* Remove SCARGS.alfred2002-12-139-324/+319
| | | | Reviewed by: md5
* Back our kernel support for reliable signal queues.jmallett2002-10-011-2/+1
| | | | Requested by: rwatson, phk, and many others
* Add a missing include.jmallett2002-10-011-0/+1
|
* When working with sigset_t's, and needing to perform masking operations basedjmallett2002-10-011-1/+1
| | | | | | on a process's pending signals, use the signal queue flattener, ksiginfo_to_sigset_t, on the process, and on a local sigset_t, and then work with that as needed.
OpenPOWER on IntegriCloud