summaryrefslogtreecommitdiffstats
path: root/sys/svr4
Commit message (Collapse)AuthorAgeFilesLines
* This patchset fixes a large number of file descriptor race conditions.dillon2000-11-181-0/+666
| | | | | | | | | | | | Pre-rfork code assumed inherent locking of a process's file descriptor array. However, with the advent of rfork() the file descriptor table could be shared between processes. This patch closes over a dozen serious race conditions related to one thread manipulating the table (e.g. closing or dup()ing a descriptor) while another is blocked in an open(), close(), fcntl(), read(), write(), etc... PR: kern/11629 Discussed with: Alexander Viro <viro@math.psu.edu>
* Cleanup after repo copy of sys/svr4 to sys/compat/svr4.obrien2000-08-3156-14117/+0
|
* Regen. (Fix SYS_exit)peter2000-07-294-7/+7
|
* Sigh. Fix SYS_exit problems. I misunderstood the significance of thesepeter2000-07-291-1/+1
| | | | trailing options.
* Regenerate with makesyscalls.shpeter2000-07-294-7/+7
|
* Change the 'exit()' system call to 'sys_exit()'. This avoids overlappingpeter2000-07-291-1/+1
| | | | | | gcc's internal exit() prototypes and the (futile) hackery that we did to try and avoid warnings. main() was renamed for similar reasons. Remove an exit related hack from makesyscalls.sh.
* Add snapshots to the fast filesystem. Most of the changes supportmckusick2000-07-111-0/+4
| | | | | | | | | | | | | | | | | | | | the gating of system calls that cause modifications to the underlying filesystem. The gating can be enabled by any filesystem that needs to consistently suspend operations by adding the vop_stdgetwritemount to their set of vnops. Once gating is enabled, the function vfs_write_suspend stops all new write operations to a filesystem, allows any filesystem modifying system calls already in progress to complete, then sync's the filesystem to disk and returns. The function vfs_write_resume allows the suspended write operations to begin again. Gating is not added by default for all filesystems as for SMP systems it adds two extra locks to such critical kernel paths as the write system call. Thus, gating should only be added as needed. Details on the use and current status of snapshots in FFS can be found in /sys/ufs/ffs/README.snapshot so for brevity and timelyness is not included here. Unless and until you create a snapshot file, these changes should have no effect on your system (famous last words).
* Modify ktrace's general I/O tracing, ktrgenio(), to use a struct uio *green2000-07-021-6/+14
| | | | | | | | | | | | | instead of a struct iovec * array and int len. Get rid of stupidly trying to allocate all of the memory and copyin()ing the entire iovec[], and instead just do the proper VOP_WRITE() in ktrwrite() using a copy of the struct uio that the syscall originally used. This solves the DoS which could easily be performed; to work around the DoS, one could also remove "options KTRACE" from the kernel. This is a very strong MFC candidate for 4.1. Found by: art@OpenBSD.org
* fix races in the uidinfo subsystem, several problems existed:alfred2000-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 1) while allocating a uidinfo struct malloc is called with M_WAITOK, it's possible that while asleep another process by the same user could have woken up earlier and inserted an entry into the uid hash table. Having redundant entries causes inconsistancies that we can't handle. fix: do a non-waiting malloc, and if that fails then do a blocking malloc, after waking up check that no one else has inserted an entry for us already. 2) Because many checks for sbsize were done as "test then set" in a non atomic manner it was possible to exceed the limits put up via races. fix: instead of querying the count then setting, we just attempt to set the count and leave it up to the function to return success or failure. 3) The uidinfo code was inlining and repeating, lookups and insertions and deletions needed to be in their own functions for clarity. Reviewed by: green
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Regenerated (to fix "created from" lines, and to fix the previousbde2000-05-104-5/+5
| | | | | regeneration which somehow used the wrong syscalls.master file, resulting in unbuildable svr4_sysent.c).
* Fixed the "created from" lines generated from this file. makesyscalls.shbde2000-05-101-6/+6
| | | | | | expects the active id to be on the first line of the specification file. Fixed some nearby gratuitous differences with kern/syscalls.master.
* Regenerated (fixed the calculation of sy_nargs in sysent tables).bde2000-05-092-127/+131
|
* Don't forget to back up svr4_syscallnames.c. Don't depend on side effectsbde2000-05-091-2/+3
| | | | to generate it.
* Fixed the return type and args struct tag for exit(). They were wrong inbde2000-05-091-1/+1
| | | | | all emulators. These entries were unused, so the bug had no effect, but the the args struct tag will be used to calculate sy_nargs correctly.
* Give the "streams" modulea version (1) and depend on it from thegreen2000-05-061-0/+1
| | | | | "svr4elf" module. This unbreaks the SVR4 KLD (which had an undefined function because of thenewly-committed KLD enhancements).
* Remove unneeded #include <vm/vm_zone.h>phk2000-04-302-2/+0
| | | | Generated by: src/tools/tools/kerninclude
* Remove unneeded #include <sys/kernel.h>phk2000-04-292-2/+0
|
* Remove ~25 unneeded #include <sys/conf.h>phk2000-04-191-1/+0
| | | | Remove ~60 unneeded #include <sys/malloc.h>
* Remove unneeded <sys/buf.h> includes.phk2000-04-182-2/+0
| | | | | Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
* Change our ELF binary branding to something more acceptable to the Binutilsobrien2000-04-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | maintainers. After we established our branding method of writing upto 8 characters of the OS name into the ELF header in the padding; the Binutils maintainers and/or SCO (as USL) decided that instead the ELF header should grow two new fields -- EI_OSABI and EI_ABIVERSION. Each of these are an 8-bit unsigned integer. SCO has assigned official values for the EI_OSABI field. In addition to this, the Binutils maintainers and NetBSD decided that a better ELF branding method was to include ABI information in a ".note" ELF section. With this set of changes, we will now create ELF binaries branded using both "official" methods. Due to the complexity of adding a section to a binary, binaries branded with ``brandelf'' will only brand using the EI_OSABI method. Also due to the complexity of pulling a section out of an ELF file vs. poking around in the ELF header, our image activator only looks at the EI_OSABI header field. Note that a new kernel can still properly load old binaries except for Linux static binaries branded in our old method. * * For a short period of time, ``ld'' will also brand ELF binaries * using our old method. This is so people can still use kernel.old * with a new world. This support will be removed before 5.0-RELEASE, * and may not last anywhere upto the actual release. My expiration * time for this is about 6mo. *
* Fix handling of svr4_sigsets, which are implemented in SysVR4 as a sequencenewton2000-01-152-15/+51
| | | | | | | | | | | | | | | | | | | | of 4 longs used as a bitmask. sv4r4_sigfillset has been broken for a while, probably since rev 1.5. This patch fixes SVR4_NSIG (i.e.: sets it to the actual number of signals, instead of the number of bits in the mask) because some SysVR4 clients honestly seem to care about whether bits in the signal mask are set for non-existant signals. Additionally, the svr4_sigfillset macro has been replaced by a fully fledged function, because the macro didn't actually work (it returned an all-ones mask, but we don't want that: we want 0's set where FreeBSD doesn't actually have a signal which is the same as an SysVR4 signal, for example). SysVR4 clients can now successfully ignore signals, although catching them remains problematic (see commit log message for rev1.13 of sys/i386/svr4/svr4_machdep.c for more info).
* Remove some all-too-wordy debugging printsnewton2000-01-151-5/+0
|
* Removed bogus include of opt_global.h. opt_global.h is automaticallybde2000-01-091-1/+0
| | | | | | included in all C files if it makes sense (i.e., for compiling kernels but not for compiling modules), so including it explicitly just complicates module makefiles.
* Need to #include vm_zone.h to pick up inline definition of zfree() so thatnewton2000-01-031-0/+1
| | | | NDFREE() macro from namei.h will be happy.
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-152-1/+4
|
* Replace the svr4_sys_getdents64() routine with a port of linux_getdents() --newton1999-12-121-85/+124
| | | | | | | | | | | | differences between the VFS interface between FreeBSD and NetBSD make it easier to pick up the Linux one than to continue development with the NetBSD port. This patch fixes a bug which caused duplicate filenames to be seen by callers to svr4_sys_getdents64(), leading to malformed directory listings from Solaris client programs. Obtained from: The Linuxulator, with a pointer from marcel
* Avoid excessive redundancy in svr4_sys_getmsg() and svr4_sys_putmsg():newton1999-12-121-8/+8
| | | | | | Only look up the provided descriptor in fd_ofiles[] once. Submitted by: Ville-Pertti Keinone <will@iki.fi>
* fd_revoke() shouldn't panic if the descriptor provided is not a file ornewton1999-12-121-9/+2
| | | | | | socket. Return EINVAL instead. Submitted by: Ville-Pertti Keinone <will@iki.fi>
* Remove unnecessary includesnewton1999-12-0811-68/+19
| | | | Prodded by: phk
* SVR4 emulator source files now take their compilation options fromnewton1999-12-088-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | opt_global.h and opt_svr4.h, instead of from the command line. This brings them in-line with most of the rest of the kernel. svr4_ioctl.c has also failed to compile with debugging for a while now; fixed by adding systm.h and socketvar. Some svr4 source files are automatically generated from syscalls.master; these have been committed as consequential changes, otherwise everyone will have to "make svr4_sysent.c". Changes: sys/svr4/svr4.h include opt_global.h and opt_svr4.h sys/svr4/svr4_ioctl.c include svr4.h, sys/systm.h and sys/socketvar.h sys/svr4/svr4_ipc.c include svr4.h sys/svr4/svr4_resource.c include svr4.h sys/svr4/svr4_socket.c include svr4.h sys/svr4/svr4_ttold.c include svr4.h sys/svr4/syscalls.master include svr4.h sys/svr4/svr4_syscallnames.c dependent on syscalls.master sys/svr4/svr4_sysent.c dependent on syscalls.master sys/svr4/svr4_syscall.h dependent on syscalls.master sys/svr4/svr4_proto.h dependent on syscalls.master sys/modules/svr4/Makefile create opt_global.h and opt_svr4.h
* General clean-up of socket.h and associated sources to synchronise upphk1999-11-241-1/+1
| | | | | | | | | | | | with NetBSD and the Single Unix Specification v2. This updates some structures with other, almost equivalent types and effort is under way to get the whole more consistent. Also removes a double definition of INET6 and some other clean-ups. Reviewed by: green, bde, phk Some part obtained from: NetBSD, SUSv2 specification
* s/p_cred->pc_ucred/p_ucred/gphk1999-11-211-1/+1
|
* useracc() the prequel:phk1999-10-292-2/+0
| | | | | | | | | | | Merge the contents (less some trivial bordering the silly comments) of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts the #defines for the vm_inherit_t and vm_prot_t types next to their typedefs. This paves the road for the commit to follow shortly: change useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE} as argument.
* Remove unnecessary includes.newton1999-10-172-20/+0
| | | | | | | | phk's script walked through .c and .h files, but some of the ones on the list are actually derived from sys/svr4/syscalls.master. Make the necessary changes here and the others will implicitly follow... Submitted by: phk
* Remove unnecessary includes.newton1999-10-1715-55/+4
| | | | Submitted by: phk
* Add a per-signal flag to mark handlers registered with osigaction, so weluoqi1999-10-111-1/+1
| | | | | | | | | | | | | | | can provide the correct context to each signal handler. Fix broken sigsuspend(): don't use p_oldsigmask as a flag, use SAS_OLDMASK as we did before the linuxthreads support merge (submitted by bde). Move ps_sigstk from to p_sigacts to the main proc structure since signal stack should not be shared among threads. Move SAS_OLDMASK and SAS_ALTSTACK flags from sigacts::ps_flags to proc::p_flag. Move PS_NOCLDSTOP and PS_NOCLDWAIT flags from proc::p_flag to procsig::ps_flag. Reviewed by: marcel, jdp, bde
* Removal of sys/device.hn_hibma1999-10-051-1/+0
| | | | | | | | | | | | | - Move intrhook stuff into kernel.h - Remove all occurrences of #device <device.h> - Add kernel.h were necessary (nowhere) - delete device.h This file contained the structures for cfdata (old style config) and is no longer used. It was included by most drivers. It confuses the remote debugger as the definition of 'struct device' in device.h is found before the one in bus_private.h.
* Oops. That'll teach me to commit without testing. I either replacedpeter1999-10-011-1/+1
| | | | | one trigraph with another, or completely missed the point. Kill it for real this time.
* Zap a trigraph (???)peter1999-10-011-1/+1
|
* sigset_t change (part 4 of 5)marcel1999-09-294-67/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------- The compatibility code and/or emulators have been updated: iBCS2 now mostly uses the older syscalls. SVR4 now properly handles all signals. This has been achieved by using the new sigset_t throughout the emulator. The Linuxulator has been severely updated. Internally the new Linux sigset_t is made the default. These are then mapped to and from the new FreeBSD sigset_t. Also, rt_sigsuspend has been implemented in the Linuxulator. Implementing this syscall basicly caused all this sigset_t changing in the first place and the syscall has been used throughout the change as a means for testing. It basicly is too much work to undo the implementation so that it can later be added again. A special note on the use of sv_sigtbl and sv_sigsize in struct sysentvec: Every signal larger than sv_sigsize is not translated and is passed on to the signal handler unmodified. Signals in the range 1 upto and including sv_sigsize are translated. The rationale is that only the system defined signals need to be translated. The emulators also have been updated so that the translation tables are only indexed for valid (system defined) signals. This change also fixes the translation bug already in the SVR4 emulator.
* This is what was "fdfix2.patch," a fix for fd sharing. It's prettygreen1999-09-196-33/+21
| | | | | | | | | | | | | | | | | far-reaching in fd-land, so you'll want to consult the code for changes. The biggest change is that now, you don't use fp->f_ops->fo_foo(fp, bar) but instead fo_foo(fp, bar), which increments and decrements the fp refcount upon entry and exit. Two new calls, fhold() and fdrop(), are provided. Each does what it seems like it should, and if fdrop() brings the refcount to zero, the fd is freed as well. Thanks to peter ("to hell with it, it looks ok to me.") for his review. Thanks to msmith for keeping me from putting locks everywhere :) Reviewed by: peter
* Add MAINTAINER linenewton1999-09-011-0/+2
|
* $Id$ -> $FreeBSD$peter1999-08-2852-52/+52
|
* Simplify the handling of VCHR and VBLK vnodes using the new dev_t:phk1999-08-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make the alias list a SLIST. Drop the "fast recycling" optimization of vnodes (including the returning of a prexisting but stale vnode from checkalias). It doesn't buy us anything now that we don't hardlimit vnodes anymore. Rename checkalias2() and checkalias() to addalias() and addaliasu() - which takes dev_t and udev_t arg respectively. Make the revoke syscalls use vcount() instead of VALIASED. Remove VALIASED flag, we don't need it now and it is faster to traverse the much shorter lists than to maintain the flag. vfs_mountedon() can check the dev_t directly, all the vnodes point to the same one. Print the devicename in specfs/vprint(). Remove a couple of stale LFS vnode flags. Remove unimplemented/unused LK_DRAINED;
* Avoid possible panic by checking for EFAULT from copyinstr() duringnewton1999-08-141-5/+12
| | | | | | pathname translation. Submitted by: green
* Previous commit also removed some 'const' qualifiers on args fornewton1999-07-301-1/+1
| | | | svr4_sys_sendto() which probably shouldn't have been 'const'.
* Previous commit also finished cleaning up some dev_t -> udev_t transformationsnewton1999-07-305-5/+5
| | | | | | related to the commit for rev 1.3 of svr4_stat.c. svr4_sysvec.c also received a copyright message (which is why it grew by 28 lines).
* Fix svr4_sys_poll(); SysV STREAMS produce return values from poll() whichnewton1999-07-301-6/+2
| | | | | BSD sockets don't. Guess at a correct emulation for those values (it seems to work for telnet, ftp and friends)
OpenPOWER on IntegriCloud