Commit Graph

4931 Commits

Author SHA1 Message Date
matt b1afbb311c Fix -fno-common found by building i386/conf/ALL 2012-07-28 00:43:22 +00:00
christos 8c79b0cd87 always allocate a full ucontext structure so that we don't corrupt memory.
XXX: needs pullup to 6?
2012-07-20 02:27:36 +00:00
dsl c578e8d211 Rename MDP_IRET to MDL_IRET since it is an lwp flag, not a proc one.
Add an MDL_COMPAT32 flag to the lwp's md_flags, set it for 32bit lwps
  and use it to force 'return to user' with iret (as is done when
  MDL_IRET is set).
Split the iret/sysret code paths much later.
Remove all the replicated code for 32bit system calls - which was only
  needed so that iret was always used.
frameasm.h for XEN contains '#define swapgs', while XEN probable never
  needs swapgs, this is likely to be confusing.
Add a SWAPGS which is a nop on XEN and swapgs otherwise.
(I've not yet checked all the swapgs in files that include frameasm.h)
Simple x86 programs still work.
Hijack 6.99.9 kernel bump (needed for compat32 modules)
2012-07-15 15:17:56 +00:00
christos c35446cdef regen 2012-07-13 18:21:45 +00:00
christos 643208810c add xattr stubs 2012-07-13 18:21:33 +00:00
dsl d222864098 The MDP_USEDFPU (amd64 and sh3) and MDP_SSTEP (sh3) are lwp flags not
process ones, rename to MDL_xxx.
2012-07-08 20:14:11 +00:00
martin de489d0684 From the "parse errors that you just do not see as a human" department:
build fix.
2012-06-22 08:47:47 +00:00
christos 23ccd40d8e fix token pasting. 2012-06-21 17:55:15 +00:00
christos 9c85d0acc9 print proper ktruser names depending on the emulation. 2012-06-20 15:03:18 +00:00
christos 82e21017c8 compat for 80211 ioctls from jmcneill 2012-05-28 14:19:10 +00:00
martin 6c3cc552c2 Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.

To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.

Add an exhaustive atf test case, based partly on code from Joel Sing.

Should finally fix the remaining open part of PR kern/43903.
2012-05-21 14:15:16 +00:00
christos 254cd91895 provide clockctl ioctl emulation 2012-05-11 19:00:36 +00:00
christos 15c591f469 regen 2012-05-10 19:41:52 +00:00
christos de41ffce81 Fix rt_sigtimedwait():
It is wishful thinking that:
    1. declaring a 32 bit syscall with 64 bit pointers
    2. passing a struct with 32 bit pointers to a 64 bit function
is going to work.
2012-05-10 19:40:46 +00:00
christos d1109b6273 prefix message with linux32 2012-05-10 19:38:23 +00:00
rmind b10bf4690c Revert posix_spawn() clean up for now, there are some bugs. 2012-05-02 23:33:11 +00:00
rmind 0c217aec3a posix_spawn:
- Remove copy-pasting in error paths, use execve_free_{vmspace,data}().
- Move some code (both in the init and exit paths) out of the locks.
- Slightly simplify do_posix_spawn() callers.
- Add few asserts and comments.
2012-04-30 21:19:58 +00:00
martin e6f332c7b3 Regen (posix_spawn) 2012-04-08 11:28:12 +00:00
martin 94b761b6aa Rework posix_spawn locking and memory management:
- always provide a vmspace for the new proc, initially borrowing from proc0
   (this part fixes PR 46286)
 - increase parallelism between parent and child if arguments allow this,
   avoiding a potential deadlock on exec_lock
 - add a new flag for userland to request old (lockstepped) behaviour for
   better error reporting
 - adapt test cases to the previous two and add a new variant to test the
   diagnostics flag
 - fix a few memory (and lock) leaks
 - provide netbsd32 compat
2012-04-08 11:27:44 +00:00
chs cf43d4681a define LINUX_DEBUGLINK_SIGNATURE for i386 too.
this allows linux ldd to work.
2012-03-21 03:20:22 +00:00
martin 3e9dfcff83 Remove spurious bsd.kinc.mk include, which seems to not be needed here
and does not work at all (missing bsd.own.mk for ACTIVE_CC) anyway.
2012-03-20 09:18:00 +00:00
njoly eda28ff705 Add missing semi-colon. 2012-03-18 21:48:47 +00:00
bouyer 44cd46846c Do not read past end of array. Found by gcc -03 2012-03-15 16:17:48 +00:00
elad 0c9d8d15c9 Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

    http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
    http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
    http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
2012-03-13 18:40:26 +00:00
joerg 99c3eea80c P1003_1B_SEMAPHORE is no longer optional. 2012-03-10 21:51:48 +00:00
joerg 4acff4c01b Implement sem_timedwait. 2012-03-08 21:59:24 +00:00
joerg 3bd1fd2afe Add entry for _ksem_timedwait. 2012-03-08 21:55:45 +00:00
macallan c4a8ce45f6 allow mounting ext2fs and msdosfs
while there also enable lfs but that's untested
2012-03-06 07:37:05 +00:00
rjs bbf374d1d6 Switch to ANSI style declaration. 2012-02-21 18:10:00 +00:00
rmind ad12c77015 Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
2012-02-19 21:05:51 +00:00
matt d24466683b Add compat_60 stub for the SA syscall (all which just call sys_nosys). 2012-02-19 17:40:46 +00:00
rmind 510eed8079 Make SA calls obsolete (use stubs in kern case, as libc needs them for now). 2012-02-19 17:08:02 +00:00
matt 1d7f24ead8 Change old-style function defintions to C89 prototypes.
Approved by releng.
2012-02-12 16:34:06 +00:00
christos ff4d8f4f03 ansi prototypes 2012-02-03 23:39:59 +00:00
christos e2d86e914d Kill of messy ifdefs, and use an ansi prototype. 2012-02-03 23:38:07 +00:00
matt 2210079e9b Add a hook for freeing an ep_emul_arg. Add a wrapper routine
(exec_free_emul_arg) to call the hook and then clear the ep_emul_arg
and ep_emul_arg_free members in the exec_package.
Change users/accessors to use these routines.
Approved by releng.
2012-02-03 20:11:53 +00:00
christos e135d08485 elf_args needs to be freed with kmem_free() since it is now allocated with
kmem_alloc(). Should fix running 32 bit elf binaries.
2012-02-03 03:54:35 +00:00
dholland 832d4ca72b Be consistent about whether idtype and objtype codes are signed or
unsigned. They are signed. (While unsigned might have been a better
choice, it doesn't really matter and the majority of preexisting uses
were signed. And consistency is good.)
2012-02-01 05:46:45 +00:00
dholland d2d6fa0ae1 Improve the names of some members of struct quotactl_args. These are
effectively function parameter names, but since they need to be
described with the same names in the man page the choices do matter.
Some.
2012-02-01 05:43:53 +00:00
dholland 56cf2d9a90 Regen syscalls with proper id info. 2012-02-01 05:42:17 +00:00
dholland 6d90c35d73 Update compat_netbsd32 for new quotactl. 2012-02-01 05:40:00 +00:00
dholland 59b296daa7 Change the syscall API for quotas over to the new non-proplib one.
- struct vfs_quotactl_args -> struct quotactl_args
   - add sys/stdint.h to sys/quotactl.h for clean userland build
   - install sys/quotactl.h in /usr/include
   - update set lists for same
   - add new marshalling code in libquota
   - add new unmarshalling code in vfs_syscalls.c
   - discard proplib interpreter code in vfs_quotactl.c
   - add dispatching code for the 14 quotactl ops in vfs_quotactl.c
   - mark the proplib quotactl syscall obsolete
   - add a new syscall number for the new quotactl syscall
   - change the name of the syscall to __quotactl()
   - remove the decl of the old quotactl from quota/quotaprop.h
   - add a decl of the new quotactl to sys/quotactl.h
   - update the libc build
   - update ktruss
   - remove proplib marshalling code from libquota
   - update copy of syscall table in gdb ppc sources
   - hack rumphijack to accomodate new quotactl name (as I recall,
     pooka wanted such a name change to simplify something, but I
     don't really see what/how)

This change appears to require a kernel version bump for rumpish
reasons.
2012-02-01 05:34:38 +00:00
matt f7a1e1f692 Add missing *at syscalls among others 2012-01-31 22:53:56 +00:00
matt 1c72d69ada Regen. 2012-01-31 22:53:28 +00:00
matt 886e1e0fe1 Add the *at syscalls and other missing syscalls. 2012-01-31 22:52:19 +00:00
matt f79a630ee2 Add netbsd32_socklenp_t 2012-01-31 22:51:41 +00:00
dholland 27eb63df33 Some further tidying for the COMPAT_50 quotactl code. Mostly cosmetic,
but also use PNBUF_GET() and PNBUF_PUT() for a path buffer instead of
malloc with M_TEMP.
2012-01-29 07:19:48 +00:00
dholland 306e2450d7 Remove the proplib goop from the COMPAT_50 code for the old quotactl;
use the new VFS_QUOTACTL instead.
2012-01-29 07:19:04 +00:00
dholland f0f8fe3be2 Rename static inline "helper" functions:
ufsclass2qtype -> quota_idtype_to_ufs
   qtype2ufsclass -> quota_idtype_from_ufs

The reason for the direction of "ufs" changing is that the old names
were among the symbols using "ufs" to mean "fs-independent". So the
old names were for translating "ufsclass" (fs-independent quota id
type) to "qtype" (ufs-specific quota id type) and vice versa.

These functions are used in only two places, both of which are
inappropriate, so at some point they should probably be removed.
They're also identity transformations so not particularly helpful,
unless one were to make a careful and concerted effort to distinguish
the ufs quota code numbers from the fs-independent ones. This has not
been done and is probably impossible without support from a program
verifier, and maybe not even then.

They are static inline, so no compat concerns arise.

Also adjust the symbols they use to avoid <quota/quotaprop.h>.
2012-01-29 07:16:00 +00:00
dholland b0d7bab70f Add vfs_quotactl() in between the syscall and VFS_QUOTACTL. Call it
from the COMPAT_50 code as well as the current sys_quotactl instead
of going directly to VFS_QUOTACTL. Doesn't actually do anything yet.
2012-01-29 06:29:04 +00:00