Commit Graph

20519 Commits

Author SHA1 Message Date
thorpej cc22126721 Implement passing credentials as ancillary data on Unix domain sockets,
enabled with the LOCAL_CREDS socket option on the listener.  Semantics are
similar to BSD/OS's:
- Creds are available with first data on SOCK_STREAM, and with every datagram
  on SOCK_DGRAM.
- It is not possible to forge credentials.

Different in that:
- Different credential data structure (ours does not rely on the format
  of internal kernel data structures, and does not pass the login name).
- We can pass creds and file descriptors at the same time (this does not
  work in BSD/OS).

Luke Mewburn <lukem@netbsd.org> gets credit for inspiring me to implement
this.  :-)
1998-01-07 22:57:09 +00:00
lukem c80b4400e5 add the following, derived from FreeBSD:
* IP_PORTRANGE socket option, which controls how the ephemeral ports
  are allocated. it takes the following settings:
	IP_PORTRANGE_DEFAULT	use anonportmin (49152) -> anonportmax (65535)
	IP_PORTRANGE_HIGH	as IP_PORTRANGE_DEFAULT (retained for FreeBSD
				compat reasons, where these are separate)
	IP_PORTRANGE_LOW	use 600 -> 1023. only works if uid==0.
* in_pcb flag INP_ANONPORT. set if port was allocated ephmerally
1998-01-07 22:51:22 +00:00
thorpej cf89ccf13e Add uipc_ctloutput(). 1998-01-07 22:50:42 +00:00
thorpej ba2c7e8ca0 Add flags to the unpcb, and define the "want credentials" flag. 1998-01-07 22:49:47 +00:00
thorpej e7a511e0c1 Define the LOCAL_CREDS socket option, and pass a proc * to unp_output(). 1998-01-07 22:49:12 +00:00
thorpej 2731959046 Prototype uipc_ctloutput(). 1998-01-07 22:47:49 +00:00
thorpej 84741f2538 Add the sockcred structure and related definitions, and the SCM_CREDS
control message type.
1998-01-07 22:46:26 +00:00
is 5d5c1cd59e - avoid system stack underflow when calling sigreturn via trap #0
- make sure all sigreturn error conditions are reported to the caller,
  instead of the place jumped to.
This is the bugfix part of pr 4628 by ITOH Yasufumi.
The performance optimization part will be handled seperately, after evaluating
its implications.
Testing on 68040 and removing the performance change from the proposed patch
by scottr. Half of the Amiga machdep.c change had to be done manually by me,
as the patchfile didn't apply cleanly.
XXX Yes, Amiga should be changed to use the common sig_machdep.c instead.
XXX Really soon now. I promise.
1998-01-07 22:46:00 +00:00
mikel c0d8293951 fix some typos in error messages & comments 1998-01-07 08:47:54 +00:00
scottr 4567c69fea Update from John Wittkoski: the Color Classic and Color Classic II
have Cuda hardware, not IIsi-based.
1998-01-07 07:33:36 +00:00
thorpej b981fc4d34 Fix bug in recvit() that would cause recvmsg() to only receive one
control message, even if there were multiple control messages on
the queue.  From Jean-Luc Richier <Jean-Luc.Richier@imag.fr>, in
bug report kern/4700.
1998-01-07 05:49:25 +00:00
thorpej e918c058f1 Fix passing of multiple file descriptors (was broken when code was made
64-bit safe).
1998-01-07 04:03:38 +00:00
thorpej 974b59d07c Happy new year! 1998-01-07 00:41:43 +00:00
thorpej 052b639ac1 Clean up the forking of init and the pagedaemon slightly: call fork1()
directly (which provides a pointer to the new process).
1998-01-06 21:18:00 +00:00
thorpej 07216d15fc Allow retval to be NULL, filling it in only if it was passed. 1998-01-06 21:15:41 +00:00
is d002f566b3 Support 68060 (and, for the Amiga, even 68040 buserr frames) in the sendsig()
and, indirectly, sigreturn() functions.
XXX The Amiga should be switched to using sig_machdep.c instead.
1998-01-06 20:50:22 +00:00
bouyer d8d77f77d6 Add a few quirk entries from OpenBSD. 1998-01-06 17:03:15 +00:00
thorpej 6ac24f05df Garbage-collect VM_PMAP. 1998-01-06 08:46:11 +00:00
thorpej 2317f9064e Garbage-collect pm_stchanged. 1998-01-06 08:40:50 +00:00
thorpej d8ee45898e Garbage-collect __VM_PMAP_HACK. 1998-01-06 08:36:23 +00:00
thorpej 0e5cf40b1f Always include pmap_pinit(), since it is a defined pmap interface
function (thought, we might revisit that later).  Just call pmap_pinit()
in pmap_create(), instead of inlining what pmap_pinit() does.

Also, g/c a TAILQ_FIRST() macro that is now defined in <sys/queue.h>
1998-01-06 08:27:05 +00:00
thorpej a26db50632 Don't need __VM_PMAP_HACK anymore. 1998-01-06 08:14:14 +00:00
thorpej 4044eccd3f Don't use vm_pmap; use vm_map.pmap instead. 1998-01-06 08:13:08 +00:00
thorpej c2768af3d4 Garbage-collect cpu_set_init_frame(); it hasn't been needed for some time
now.
1998-01-06 08:06:45 +00:00
thorpej 07f835de1f Garbage-collect PMAP_ACTIVATE() call here; it's no longer necessary. 1998-01-06 07:49:36 +00:00
thorpej 3e7eb6c80a Garbage-collect pm_pdchanged; it's not used by anything. 1998-01-06 07:16:06 +00:00
thorpej 61567b54de Garbage-collect pm_stchanged; it's not used by anything. 1998-01-06 07:02:58 +00:00
thorpej d11b109f2b Garbage-collect use of the PCB's copy of the user segment table pointer. 1998-01-06 06:51:40 +00:00
thorpej ab9b250a37 The user segment table pointer is no longer kept here. Change it to
a spare field.

XXX Should be changed to use generic m68k PCB!
1998-01-06 06:47:04 +00:00
thorpej 8cbc5caabb The user segment table pointer is no longer kept here. Change it to
a spare field.
1998-01-06 06:46:05 +00:00
perry 8a98e23a48 RCSID Police. 1998-01-06 04:55:52 +00:00
perry 2ec6474b31 RCSID Police. 1998-01-06 04:44:59 +00:00
jtk fe87ac4104 fix for changes in bioscall structure and include files 1998-01-06 00:35:42 +00:00
thorpej a8f80ad4fd Fix a bogosity apparently inherited from when the Utah 4.3BSD code base
was converted to use Mach VM for Net2/4.4BSD.  The user segment table
pointer was originally stored in the PCB.  When Mach VM came along,
however, it was also stored in the pmap, and loaded into the PCB in
pmap_activate().  pmap_activate() would then note that the PCB's USTP
was now in sync with the pmap's USTP, and the low-level context switch
code would use the value from the PCB.

However, pmap_activate() would also load the hardware MMU context if
the pmap was the current pmap (or, in the case where pmaps can be shared,
such as in NetBSD, if the proc was the current proc).  The low-level
context switch code would then reload the hardware _again_ using the
USTP from the PCB.

However, the optimization of not calling pmap_activate() if "stchanged"
was false ended up causing some processes to use stale USTP values from
the PCB when the low-level context switch code reloaded the hardware!
This was noticed by using a real vfork(2) (which worked for some time
before failing, surprisingly!)

Since I'm hard pressed to find any real optimization here (since the
hardware was always reloaded once, sometimes twice!), the code now always
calls pmap_activate(), which uses the correct USTP value (the one in the
pmap).  The PCB's USTP is now ignored, and should eventually be g/c'd.

Another optimization can actually be performed, and I have added a comment
describing what it is, but have not yet implemented it.

Also note that most of the loadustp() functions where actually incomplete.
This has been corrected.  These functions should probably be split up into
MMU-specific operations, and called indirectly, rather than doing constant
run-time decision making based on values that will never change during the
course of a boot's lifetime.
1998-01-05 23:16:21 +00:00
perry 3625dbcd48 RCSID Police. 1998-01-05 21:34:56 +00:00
perry 5646f55116 make script insert RCS ids into generated files 1998-01-05 21:28:21 +00:00
perry 086015d681 RCSID Police. 1998-01-05 21:13:51 +00:00
perry e464358f5f make script insert RCS ids into generated files 1998-01-05 21:12:34 +00:00
perry 49ad493e50 RCSID Police. 1998-01-05 21:11:15 +00:00
perry 489c2f7e06 make script insert RCS ids into generated files 1998-01-05 21:10:18 +00:00
perry b46484bb8a RCSID Police. 1998-01-05 20:51:25 +00:00
perry 24920eefb1 RCSID Police. 1998-01-05 19:40:40 +00:00
perry 736c62507d regened with RCSIDs in place 1998-01-05 19:38:41 +00:00
perry e6fe83471e make script insert RCS ids into generated files 1998-01-05 19:37:08 +00:00
perry 5e35a0595e regened with RCSIDs in place 1998-01-05 19:30:30 +00:00
perry 5e96ab4c0a make script insert RCS ids into generated files 1998-01-05 19:28:16 +00:00
perry c915c7718d regened with RCSIDs in place 1998-01-05 19:25:06 +00:00
perry 127f6582ff make script insert RCS ids into generated files 1998-01-05 19:24:28 +00:00
perry 1a80fd799d RCSID Police. 1998-01-05 19:19:41 +00:00
perry 3a47434df3 regened with RCSIDs in place 1998-01-05 19:14:39 +00:00