Commit Graph

2415 Commits

Author SHA1 Message Date
itojun f731d2b75a wrong semicolon at EOL. notified by wiz 2002-08-08 00:15:32 +00:00
itojun c1f124cb75 typo 2002-08-07 00:18:21 +00:00
itojun 8fc9db2b63 buffer len check. from silvio@qualys.com 2002-08-06 22:50:37 +00:00
itojun 8dd04cdcd7 correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls.  from openbsd
2002-08-03 00:12:48 +00:00
manu 652d91cab0 Introduce a shared group structure, and make the sproc implementation
more SMP friendly.
2002-08-02 23:02:51 +00:00
manu 2ce44de983 typo 2002-08-02 22:52:50 +00:00
manu 0e12143ef8 Missing P_ZERO in priority mask 2002-08-02 22:52:36 +00:00
gmcgarry cb7e814f6e Fix inverted pre-processor test. 2002-08-02 08:43:09 +00:00
jdolecek 4be499b52b Convert to use p_opptr rather than p_oppid. Part of fix for
security/14444 by David Sainty.
2002-07-28 18:42:41 +00:00
chs 0724ffc87a restructure the FPU and AltiVEC code so that it works for MP. 2002-07-28 07:38:34 +00:00
jdolecek 02eb342b57 Make sure that the pointer to old parent process for ptraced children
gets reset properly when the old parent exits before the child. A flag
is set in old parent process when the child is reparented in ptrace(2).
If it's set when process is exiting, all running processes have their
'old parent process' pointer checked and reset if appropriate. Also
change to use 'struct proc *' pointer directly, rather than pid_t.
This fixes security/14444 by David Sainty.

Reviewed by Christos Zoulas.
2002-07-25 20:04:02 +00:00
matt c172e4d8e8 Make SVR4_32 work with the sparc32 version of setiathome. This required
fixing the socket syscall and the SIOGIFCONF ioctl code.
2002-07-22 05:31:18 +00:00
scw bef00d4895 m68k syscall rototill:
- Switch all m68k-based ports over to __HAVE_SYSCALL_INTERN.
 - Add systrace glue.
 - Define struct mdproc in <m68k/proc.h> instead of <machine/proc.h>.
   (They were all defined exactly the same anyway, other than a couple
   of the MDP_* flags.)
2002-07-13 08:28:40 +00:00
matt 66eaa16742 Change fpuproc to curcpu()->ci_fpuproc. 2002-07-09 17:41:27 +00:00
fvdl e877145e56 Move netbsd32_sysarch to netbsd32_machdep.c 2002-07-07 23:23:41 +00:00
oki 33e652ebfd Regen. 2002-07-07 18:07:43 +00:00
oki 52bdeef730 PECOFF version of stat13 and lstat13 couldn't look for
alternative path at first.  Fixed it.
2002-07-07 18:06:02 +00:00
thorpej 011d4d5f44 Add kernel support for having userland provide the signal trampoline:
* struct sigacts gets a new sigact_sigdesc structure, which has the
  sigaction and the trampoline/version.  Version 0 means "legacy kernel
  provided trampoline".  Other versions are coordinated with machine-
  dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
  the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
  trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions.  Instead,
  sendsig() looks up the handler by peeking in the sigacts for the
  process getting the signal (since it has to look in there for the
  trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
  its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later.  Kernel
version not bumped; we will ride the 1.6C bump made recently.
2002-07-04 23:32:02 +00:00
manu 7d2ac48550 Fixed a typo that borke build with DEBUG_IRIX 2002-06-22 13:02:39 +00:00
gmcgarry d6e1e62162 sync to new ktrsyscall() interface. 2002-06-21 05:48:06 +00:00
enami af1c533269 Don't copy from destination to destination. 2002-06-20 04:01:43 +00:00
eeh 84c049f196 Match the Solaris siginfo layout for _LP64. 2002-06-19 17:33:01 +00:00
wrstuden 10d47b4dd3 Updated version of cscope/mkid support. Check libkern and compat lib
for source files. Also include header files in mkid run.
2002-06-18 23:46:52 +00:00
manu 758eb330b4 build without DEBUG_IRIX 2002-06-17 05:01:56 +00:00
manu 0e28620e0f Two forgotten files in last commit for get/setrlimit 2002-06-14 20:33:11 +00:00
eeh 863fc84f4d Provide the correct architecture for HW_MACHINE_ARCH so things like
"sysctl -p" can tell they are in 32-bit land.
2002-06-14 18:28:19 +00:00
manu 022bd85d32 When sproc is used to create a share group with shared memory, there is a
private area called PRDA that remains unshared. We implement this by using
different vmspace for each share group member, and keeping the memory
appings in sync on each mmap/munmap/mprotect/break...

We use irix_saddr_sync_vmcmd and irix_saddr_sync_syscall to apply a
vmcmd or a syscall to all share group member, this makes the job a bit
easier.

Also implements {get|set}rlimit{64}.
2002-06-12 20:33:20 +00:00
fvdl fab373098c Fix wrong psstr computation.
(XXX why is there an entire copy of sys_execve here?)
2002-06-06 10:12:42 +00:00
manu 55dd8b2806 - Introduce irix_check_exec() to check if a given process is an IRIX one
- First implementation of procblk(). THis is supposed to suspend processes.
We emulate this by sending a SIGSTOP, which is not very accurate since
on IRIX, sending a SIGCONT to a process suspended by procblk() will not
resume it.
- support for shared groups
2002-06-05 17:27:11 +00:00
eeh bf3b10f8aa Prototype for probing noteless 32-bit emulation binaries. 2002-06-04 14:49:15 +00:00
manu a808ca7f07 Now support per-signal signal trampolines. 2002-06-02 19:06:02 +00:00
manu a7fd741e36 Emulate PR_SULIMIT, PR_SID and PR_SUMASK for sproc() 2002-06-01 20:26:42 +00:00
manu 658fcb808d Don't use SVR4 code for fcntl(F_GETFL) and fcntl(F_SETFL) because the constant
are not the same.
2002-06-01 16:16:36 +00:00
fvdl b6631fa4ec Make this compile again since the previous change. KNF. 2002-06-01 15:10:43 +00:00
eeh cfa7e7d168 Support chroot-ing to a 32-bit installation. 2002-05-31 00:49:42 +00:00
thorpej 8bf2751b15 Statements must follow labels. 2002-05-30 18:44:30 +00:00
manu 0d78304995 Improved support for polling semaphores: when a polling semaphore is unblocked,
poll will return true until the semaphore is blocked again, but before the
semaphore is blocked, poll returns false.

We do this by maintaining another queue of "released" processes in
struct irix_usema_rec. Unblocking causes the waiting process record to be
moved to the released queue, and poll check for the process in this released
queue.
2002-05-30 05:16:10 +00:00
manu f4e81e0cfb - the signal trampoline address is now copied during a fork(). This avoids
a SIGSEGV when sigaction(2) is used before a fork(2) and a signal is received
in the child.
- we now nearly correctly emulate PR_TERMCHILD in prctl(2). (the perfect
emulation would not send a SIGHUP if the parent is killed)
2002-05-28 21:15:41 +00:00
manu e8f2e051a3 - When requested a semamphore count, the userlands expects the kernel to
return the number of processes waiting on the semaphore. We now maintiain
a count of waiting processes.
- Blocked processes are unblocked "first in, first out". We now have a
queue of waiting processes on a asemaphores, so that we can wakeup the
first blocked process.

Problems:
- We now have a lot of dynamic memory allocation, it may be a bit slow.
- Nothing is SMP safe for now. We need to add locks.
- On close, we forget about a semaphore, which is incorrect. One process
  can close its fd attached on a semaphore, but other processes  would carry
  on using it. Since any process can join a shared arena, this is not an
  easy thing to solve.
- A lot of usema/usync functionnalities are still to be discovered.
2002-05-26 21:37:12 +00:00
manu d72c924447 First implementation of a few usync_cntl commands. 2002-05-22 21:32:21 +00:00
manu 381f22f4de File forgotten in the previous commit. 2002-05-22 05:14:51 +00:00
manu 23f31f2a3a First implementation of IRIX /dev/usemaclone functionnalities. This
successfully emulates a few test program that use poll semaphores,
including the attach-to-file-descriptor-and-select feature.

There are a few issues:
1) at least one ioctl need to set retval. We handle this in irix_sys_ioctl()
by replacing the data argument by a pointer to a strucutre in the stackgap
that carries the real data and retval. The underlying ioctl methods can
therefore retreive both data and retval.

2) usemaclone is a cloning device: each time it is open, it creates a new
context, and ioctl operation on each open file descriptor will lead to
different behavior. This functionnality is available in NetBSD through the
devvp branch. This first implementation does not use devvp yet, but this
should be done later. Currently, we create a new vnode, and we provide our
own vnode operations. Some operation are applied to the cloned vnode, others
are applied to the original vnode. The v_data field is used to hold a
reference to the original vnode so that we can work on it.

3) at least the setattr vnode operation needs some customisation: IRIX
libc relies on the fact that fchmod on /dev/usema will return 0 in case
of failure.
2002-05-22 05:14:00 +00:00
jdolecek ee7012d13e linux_sys_getdents64(): remove the oldcall bug workaround cruft,
it's not needed for this call, and update comment accordingly
2002-05-20 06:45:11 +00:00
jdolecek c118cb14c0 linux_sys_getdents64(): make the d_off member point to next entry, rather
than current one; this is expected (even documented) behaviour of the
new system call
This fixes the endless loop when reading directories on NFS, though
applications won't see all directory entries due to different problem.
Fix by Matthias Scheler and Charles Hannum.
2002-05-20 06:40:37 +00:00
jdolecek aae43707d7 whitespace fixes 2002-05-20 06:26:46 +00:00
jdolecek def25b45fa Fix bug introduced in rev. 1.69 - linux_fakedev() returned always
zero for nontranslated raw devices.
This fixes recently discovered jdb /dev/dsp stdin problem, reported
on current-users by Mark Davies.
2002-05-20 06:22:43 +00:00
jdolecek bfbe50611b On archs with broken linux struct stat64 st_ino, rename linux_stat64's
lst_ino to __lst_ino and lst_ino64 to lst_ino, and define
LINUX_STAT64_HAS_BROKEN_ST_INO. Only assign __lst_ino if this define
is present.

This fixes compile on powerpc archs, and hence port-powerpc/16893.
2002-05-19 18:03:15 +00:00
jdolecek 98a5f2b671 hook in truncate64(2) and ftruncate64(2) 2002-05-19 17:55:42 +00:00
jdolecek 973744c531 add missing linux_file64.c, which is needed now 2002-05-19 17:55:08 +00:00
matt 6456f8fa92 Make COMPAT_LINUX compile again on Alpha. linux_getdents64 moved but
files.linux_alpha wasn't updated.  common/linux_file64.c contains a lot
of syscalls which aren't on Linux/alpha so #ifdef them for alpha.
2002-05-13 05:41:26 +00:00