Commit Graph

272 Commits

Author SHA1 Message Date
Andrew Gallatin
7936339495 A start at an implemention of linux_rt_sendsig & linux_rt_sigreturn
and associated user-level signal trampoline glue.

Without this patch, an SA_SIGINFO style handler can be installed by a linux
app, but if the handler accesses its sip argument, it will get a garbage
pointer and likely segfault.

We currently supply a valid pointer, but its contents are mainly
garbage.  Filling this in properly is future work.

This is the second of 3 commits that will get IBM's JDK 1.3 working with
FreeBSD ...
2000-10-17 00:00:20 +00:00
Dag-Erling Smørgrav
e57416dc56 Mark directories as directories, not as regular files. 2000-10-10 12:32:44 +00:00
Poul-Henning Kamp
00d25f512c Initiate deorbit burn sequence for <machine/console.h>.
Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>.
This is also the appropriate fix for exo-tree sources.

Put warnings in <machine/console.h> to discourage use.
November 15th 2000 the warnings will be converted to errors.
January 15th 2001 the <machine/console.h> files will be removed.
2000-10-08 21:34:00 +00:00
Dag-Erling Smørgrav
cd595ef506 Fix cut'n'paste bogon.
Submitted by:	Jim Pirzyk <Jim.Pirzyk@disney.com>
2000-09-18 17:46:01 +00:00
Dag-Erling Smørgrav
fecfecfbd0 Remove unused variables. 2000-09-09 14:35:35 +00:00
Dag-Erling Smørgrav
ddc0b9925d Add stat, uptime and version.
Note that version currently returns the first line of the version string
from vers.c, which is not quite what a Linux system would return.
2000-09-09 11:44:58 +00:00
Dag-Erling Smørgrav
81dc16f619 Pierre Beyssac originally derived linprocfs from procfs, and I've made (and
will keep making) significant modifications, so I'm adding both our copyrights
to the top of these files.
2000-09-07 16:44:26 +00:00
Dag-Erling Smørgrav
9acf7ab9bc Remove obsolete comment (see rev 1.84 of procfs_vnops.c) 2000-09-04 18:19:04 +00:00
Robert Watson
c0ea0959b8 o Synchronize linprocfs authorization with procfs authorization improvements
(better hiding of hidden processes, more access checks, use vaccess(), et
  al)

Approved by:	des
Obtained from:	TrustedBSD Project
2000-09-01 18:40:52 +00:00
David E. O'Brien
50e59af900 Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
Robert Watson
9cd5f4c13b o Update linprocfs to include similar changes as those in procfs, fixing
the build (oops!): replace calls to p_trespass() and PRISON_CHECK()
  with p_can(..., {P_CAN_SEE, P_CAN_DEBUG}, NULL)
o Remove volatile usage from procfs_readdir() to remove warnings
o Apply bp's CREATE fix to linprocfs, causing EROFS to be returned on
  CREATE calls to procfs_lookup()
o Some further synchronization still needs to occur: only existing
  access checks were replaced, to fix the build--the new ones were not
  added.  I'll do this later today, this is a "fix the build quickly"
  commit.  This means that, in the interim, some information leakage
  can still occur via linprocfs when using jail or kern.ps_showallprocs

Submitted by:	knu
Approved by:	des
Obtained from:	TrustedBSD Project
2000-08-30 13:23:19 +00:00
Marcel Moolenaar
3f3a4815f4 Whitespace change: (near) KNF 2000-08-26 05:12:16 +00:00
Marcel Moolenaar
4a22d85023 Fix bug in previous commit. We need to trim the limits to fit
the datatype (= long). Use ULONG_MAX and LONG_MAX to avoid
creating MD code.
2000-08-26 05:08:10 +00:00
Marcel Moolenaar
eebc2a071f Re-implement linux_{g|s}etrlimit in terms of {g|s}etrlimit
instead of the o{g|s}etrlimit so that the dependency on
COMPAT_43 is removed.
2000-08-26 02:18:41 +00:00
Marcel Moolenaar
bc34729c47 Fix typo in license. 2000-08-25 07:32:24 +00:00
Marcel Moolenaar
ac951e620c Update include directives. 2000-08-22 01:51:54 +00:00
Marcel Moolenaar
ba9ef45b54 Update include directives.
Make linux_to_bsd_sigset and linux_do_sigaction non-static.

Move linux_sigaction. linux_sigsuspend, linux_rt_sigsuspend,
linux_pause and linux_sigaltstack to MD code.
2000-08-22 01:49:54 +00:00
Marcel Moolenaar
a751315ca8 Update include directives.
Move linux_select to MD code (i386 compat. syscall).

Move linux_fork, linux_vfork, linux_clone, linux_mmap,
linux_pipe, linux_ioperm, linux_iopl and linux_modify_ldt
to MD code.
2000-08-22 01:46:50 +00:00
Marcel Moolenaar
607d46ef28 Update include directives. 2000-08-22 01:32:14 +00:00
Marcel Moolenaar
afa66fa8ca Update include directives.
Make the sem*, msg* and shm* function non-static as they are
called from MD code.

Move linux_ipc to MD code.
2000-08-22 01:31:23 +00:00
Marcel Moolenaar
6fd44518f2 Update include directives and remove linux_execve. 2000-08-22 01:27:36 +00:00
Marcel Moolenaar
51705ff7da Provide prototypes for functions used by MD code. 2000-08-22 01:24:36 +00:00
Bruce Evans
c6e4d7c5ba Fixed null pointer panic for accessing "meminfo" when there is no swap. 2000-08-12 21:08:42 +00:00
Peter Wemm
3a285cc807 Regen. (Fix SYS_exit) 2000-07-29 10:07:38 +00:00
Peter Wemm
4e0f152bbe Sigh. Fix SYS_exit problems. I misunderstood the significance of these
trailing options.
2000-07-29 10:05:25 +00:00
Peter Wemm
69065e880a Regenerate with makesyscalls.sh 2000-07-29 00:21:50 +00:00
Peter Wemm
ac2b067b9a Change the 'exit()' system call to 'sys_exit()'. This avoids overlapping
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.
2000-07-29 00:16:28 +00:00
Marcel Moolenaar
4c02bded00 Remove the only use of SCARG and perform dead code elimination. 2000-07-27 01:22:24 +00:00
Marcel Moolenaar
03567510a8 Add bounds checking to stackgap_alloc. Previously it was possible
to construct a path that was long enough (ie longer than
SPARE_USRSPACE bytes) and trash the stack.

Note that SPARE_USRSPACE is much smaller than MAXPATHLEN so that
the Linuxulator will now return ENAMETOOLONG even if the path
is smaller than MAXPATHLEN.

PR: 12749
2000-07-23 16:54:18 +00:00
Marcel Moolenaar
a603fe5a07 Revert implementation of setfsuid and setfsgid due to security
issues.

Requested by: rwatson
Backed by: kris
2000-07-20 05:37:41 +00:00
Marcel Moolenaar
d5124417a7 Implement pread and pwrite.
PR: 17991
Submitted by: Geoffrey Speicher <geoff@caribbean.sea-incorporated.com>
2000-07-17 00:17:07 +00:00
Marcel Moolenaar
ddb48608ab Implement setfsuid and setfsgid. Implementation derived from patch
in PR.

PR: 16993
Submitted by: Bjoern Groenvall <bg@sics.se>
2000-07-16 21:23:34 +00:00
Marcel Moolenaar
fbdf894562 Simplify the F_GETOWN and F_SETOWN fcntl commands. The workaround
is not needed since the FreeBSD native implementation switched
from TIOC{G|S}PGRP to FIO{G|S}ETOWN (kern_descrip.c rev 1.55).

PR: 16946
Submitted by: Victor Salaman <salaman@teknos.com>
2000-07-15 22:33:24 +00:00
Kirk McKusick
f2a2857bb3 Add snapshots to the fast filesystem. Most of the changes support
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).
2000-07-11 22:07:57 +00:00
Poul-Henning Kamp
77978ab8bc Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.
Pointed out by:	bde
2000-07-04 11:25:35 +00:00
Poul-Henning Kamp
82d9ae4e32 Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:
Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our
sources:

        -sysctl_vm_zone SYSCTL_HANDLER_ARGS
        +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
2000-07-03 09:35:31 +00:00
Brian Feldman
42ebfbf227 Modify ktrace's general I/O tracing, ktrgenio(), to use a struct uio *
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
2000-07-02 08:08:09 +00:00
Alfred Perlstein
c636255150 fix races in the uidinfo subsystem, several problems existed:
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
2000-06-22 22:27:16 +00:00
Martin Cracauer
6f6b2cd019 Linux allows to mmap annonymous with a file descriptor passed, FreeBSD
doesn't.  In the Linux emulation layer, ignore the fd passed when
MAP_ANON is specified.

Known application to be fixed: Xanalys/Harlequin Lispworks

Also improve debug output for mmap, now showing what the emulation
layer mapped to what (-DDEBUG).

Reviewed by:	marcel
2000-06-15 09:57:34 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Dag-Erling Smørgrav
ce4e34c875 Make exe a symlink. 2000-05-24 07:37:02 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
Bruce Evans
fdf7d274e8 Regenerated (to fix "created from" lines, and to fix the previous
regeneration which somehow used the wrong syscalls.master file,
resulting in unbuildable svr4_sysent.c).
2000-05-10 14:38:28 +00:00
Bruce Evans
43914915de Fixed the "created from" lines generated from this file. makesyscalls.sh
expects the active id to be on the first line of the specification file.

Fixed some nearby gratuitous differences with kern/syscalls.master.
2000-05-10 14:32:32 +00:00
Bruce Evans
9114579d7a Regenerated (fixed the calculation of sy_nargs in sysent tables). 2000-05-09 21:52:02 +00:00
Bruce Evans
563ae30721 Don't forget to back up svr4_syscallnames.c. Don't depend on side effects
to generate it.
2000-05-09 21:40:01 +00:00
Bruce Evans
8bc3445472 Fixed the return type and args struct tag for exit(). They were wrong in
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.
2000-05-09 18:08:51 +00:00
Brian Feldman
d6b17eeba3 Give the "streams" modulea version (1) and depend on it from the
"svr4elf" module.  This unbreaks the SVR4 KLD (which had an undefined
function because of thenewly-committed KLD enhancements).
2000-05-06 01:39:45 +00:00
Peter Wemm
365c5db0a7 Add $FreeBSD$ 2000-05-01 20:32:07 +00:00
Poul-Henning Kamp
2c9b67a8df Remove unneeded #include <vm/vm_zone.h>
Generated by:	src/tools/tools/kerninclude
2000-04-30 18:52:11 +00:00