The NetBSD Project

CVS log for src/sys/kern/kern_exec.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.518 / (download) - annotate - [select for diffs], Fri Jul 1 01:05:31 2022 UTC (6 months, 3 weeks ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.517: +5 -3 lines
Diff to previous 1.517 (colored)

posix_spawn(2): Plug leak in proc_alloc error branch.

Revision 1.517 / (download) - annotate - [select for diffs], Sat Apr 9 23:38:33 2022 UTC (9 months, 2 weeks ago) by riastradh
Branch: MAIN
Changes since 1.516: +4 -4 lines
Diff to previous 1.516 (colored)

sys: Use membar_release/acquire around reference drop.

This just goes through my recent reference count membar audit and
changes membar_exit to membar_release and membar_enter to
membar_acquire -- this should make everything cheaper on most CPUs
without hurting correctness, because membar_acquire is generally
cheaper than membar_enter.

Revision 1.516 / (download) - annotate - [select for diffs], Sat Mar 12 15:32:32 2022 UTC (10 months, 2 weeks ago) by riastradh
Branch: MAIN
Changes since 1.515: +5 -2 lines
Diff to previous 1.515 (colored)

sys: Membar audit around reference count releases.

If two threads are using an object that is freed when the reference
count goes to zero, we need to ensure that all memory operations
related to the object happen before freeing the object.

Using an atomic_dec_uint_nv(&refcnt) == 0 ensures that only one
thread takes responsibility for freeing, but it's not enough to
ensure that the other thread's memory operations happen before the
freeing.

Consider:

	  Thread A			  Thread B
	obj->foo = 42;			obj->baz = 73;
	mumble(&obj->bar);		grumble(&obj->quux);
	/* membar_exit(); */		/* membar_exit(); */
	atomic_dec -- not last		atomic_dec -- last
					/* membar_enter(); */
					KASSERT(invariant(obj->foo,
					    obj->bar));
					free_stuff(obj);

The memory barriers ensure that

	obj->foo = 42;
	mumble(&obj->bar);

in thread A happens before

	KASSERT(invariant(obj->foo, obj->bar));
	free_stuff(obj);

in thread B.  Without them, this ordering is not guaranteed.

So in general it is necessary to do

	membar_exit();
	if (atomic_dec_uint_nv(&obj->refcnt) != 0)
		return;
	membar_enter();

to release a reference, for the `last one out hit the lights' style
of reference counting.  (This is in contrast to the style where one
thread blocks new references and then waits under a lock for existing
ones to drain with a condvar -- no membar needed thanks to mutex(9).)

I searched for atomic_dec to find all these.  Obviously we ought to
have a better abstraction for this because there's so much copypasta.
This is a stop-gap measure to fix actual bugs until we have that.  It
would be nice if an abstraction could gracefully handle the different
styles of reference counting in use -- some years ago I drafted an
API for this, but making it cover everything got a little out of hand
(particularly with struct vnode::v_usecount) and I ended up setting
it aside to work on psref/localcount instead for better scalability.

I got bored of adding #ifdef __HAVE_ATOMIC_AS_MEMBAR everywhere, so I
only put it on things that look performance-critical on 5sec review.
We should really adopt membar_enter_preatomic/membar_exit_postatomic
or something (except they are applicable only to atomic r/m/w, not to
atomic_load/store_*, making the naming annoying) and get rid of all
the ifdefs.

Revision 1.515 / (download) - annotate - [select for diffs], Sat Feb 5 23:10:20 2022 UTC (11 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.514: +11 -4 lines
Diff to previous 1.514 (colored)

Prevent escallation of privilege due to poor handling of argc == 0 in set*id
binaries by refusing to execute them.

Revision 1.514 / (download) - annotate - [select for diffs], Fri Nov 26 08:06:12 2021 UTC (14 months ago) by ryo
Branch: MAIN
Changes since 1.513: +87 -35 lines
Diff to previous 1.513 (colored)

Fix anonymous memory object leak for sigcode.

- Repeating "modload compat_linux && /emul/linux/bin/ls && modunload compat_linux"
  will reproduce this problem.
- It cause in exec_sigcode_map(), anon-object for sigcode was created at
  first exec, but it remained even after exec_remove.
- Fixed that the anon-object for sigcode is created at exec_add(), and the
  anon-object reference is removed at exec_remove().
- sigobject_lock is no longer needed since it is locked by exec_lock.
- The compat_16 module rewrites the e_sigcode entry in emul_netbsd directly and
  does not use exec_add()/exec_remove(), so it needs to call
  sigcode_alloc()/sigcode_free() on its own.

Revision 1.513 / (download) - annotate - [select for diffs], Thu Nov 25 10:31:50 2021 UTC (14 months ago) by ryo
Branch: MAIN
Changes since 1.512: +33 -80 lines
Diff to previous 1.512 (colored)

Reverte my previous changes kern_exec.c r1.512. It panics.

This changes was insufficient because es_emul is referenced by multiple execsw.

Revision 1.512 / (download) - annotate - [select for diffs], Thu Nov 25 02:37:38 2021 UTC (14 months ago) by ryo
Branch: MAIN
Changes since 1.511: +82 -35 lines
Diff to previous 1.511 (colored)

Fix anonymous memory object leak for sigcode.

- Repeating "modload compat_linux && /emul/linux/bin/ls && modunload compat_linux"
  will reproduce this problem.
- It cause in exec_sigcode_map(), anon-object for sigcode was created at
  first exec, but it remained even after exec_remove.
- Fixed that the anon-object for sigcode is created at exec_add(), and the
  anon-object reference is removed at exec_remove().
- sigobject_lock is no longer needed since it is locked by exec_lock.

Revision 1.511 / (download) - annotate - [select for diffs], Sun Nov 7 13:47:49 2021 UTC (14 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.510: +31 -11 lines
Diff to previous 1.510 (colored)

Merge the kernel portion of the posix-spawn-chdir project by Piyush Sachdeva.

Revision 1.510 / (download) - annotate - [select for diffs], Sun Oct 10 18:07:51 2021 UTC (15 months, 2 weeks ago) by thorpej
Branch: MAIN
Changes since 1.509: +13 -4 lines
Diff to previous 1.509 (colored)

Changes to make EVFILT_PROC MP-safe:

Because the locking protocol around processes is somewhat complex
compared to other events that can be posted on kqueues, introduce
new functions for posting NOTE_EXEC, NOTE_EXIT, and NOTE_FORK,
rather than just using the generic knote() function.  These functions
KASSERT() their locking expectations, and deal with other complexities
for each situation.

knote_proc_fork(), in particiular, needs to handle NOTE_TRACK, which
requires allocation of a new knote to attach to the child process.  We
don't want to be allocating memory while holding the parent's p_lock.
Furthermore, we also have to attach the tracking note to the child
process, which means we have to acquire the child's p_lock.

So, to handle all this, we introduce some additional synchronization
infrastructure around the 'knote' structure:

- Add the ability to mark a knote as being in a state of flux.  Knotes
  in this state are guaranteed not to be detached/deleted, thus allowing
  a code path drop other locks after putting a knote in this state.

- Code paths that wish to detach/delete a knote must first check if the
  knote is in-flux.  If so, they must wait for it to quiesce.  Because
  multiple threads of execution may attempt this concurrently, a mechanism
  exists for a single LWP to claim the detach responsibility; all other
  threads simply wait for the knote to disappear before they can make
  further progress.

- When kqueue_scan() encounters an in-flux knote, it simply treats the
  situation just like encountering another thread's queue marker -- wait
  for the flux to settle and continue on.

(The "in-flux knote" idea was inspired by FreeBSD, but this works differently
from their implementation, as the two kqueue implementations have diverged
quite a bit.)

knote_proc_fork() uses this infrastructure to implement NOTE_TRACK like so:

- Attempt to put the original tracking knote into a state of flux; if this
  fails (because the note has a detach pending), we skip all processing
  (the original process has lost interest, and we simply won the race).

- Once the note is in-flux, drop the kq and forking process's locks, and
  allocate 2 knotes: one to post the NOTE_CHILD event, and one to attach
  a new NOTE_TRACK to the child process.  Notably, we do NOT go through
  kqueue_register() to do this, but rather do all of the work directly
  and KASSERT() our assumptions; this allows us to directly control our
  interaction with locks.  All memory allocations here are performed with
  KM_NOSLEEP, in order to prevent holding the original knote in-flux
  indefinitely.

- Because the NOTE_TRACK use case adds knotes to kqueues through a
  sort of back-door mechanism, we must serialize with the closing of
  the destination kqueue's file descriptor, so steal another bit from
  the kq_count field to notify other threads that a kqueue is on its
  way out to prevent new knotes from being enqueued while the close
  path detaches them.

In addition to fixing EVFILT_PROC's reliance on KERNEL_LOCK, this also
fixes a long-standing bug whereby a NOTE_CHILD event could be dropped
if the child process exited before the interested process received the
NOTE_CHILD event (the same knote would be used to deliver the NOTE_EXIT
event, and would clobber the NOTE_CHILD's 'data' field).

Add a bunch of comments to explain what's going on in various critical
sections, and sprinkle additional KASSERT()s to validate assumptions
in several more locations.

Revision 1.509 / (download) - annotate - [select for diffs], Tue Sep 28 15:35:44 2021 UTC (15 months, 4 weeks ago) by thorpej
Branch: MAIN
Changes since 1.508: +8 -2 lines
Diff to previous 1.508 (colored)

Make sure the robust futex head is zeroed out, since this LWP
will live on with a different program image.  (Thanks ryo@ for
pointing out my mistake.)

Revision 1.508 / (download) - annotate - [select for diffs], Tue Sep 28 15:05:42 2021 UTC (15 months, 4 weeks ago) by thorpej
Branch: MAIN
Changes since 1.507: +3 -4 lines
Diff to previous 1.507 (colored)

futex_release_all_lwp(): No need to pass the "tid" argument separately; that
is a vestige of an older version of the code.  Also, move a KASSERT() that
both futex_release_all_lwp() call sites had inside of futex_release_all_lwp()
itself.

Revision 1.507 / (download) - annotate - [select for diffs], Tue Sep 28 14:52:22 2021 UTC (15 months, 4 weeks ago) by thorpej
Branch: MAIN
Changes since 1.506: +13 -2 lines
Diff to previous 1.506 (colored)

In the exec path, multi-LWP programs dispose of their robust futexes
by calling exit_lwps(), except for the last LWP.  So, dispose of that
LWP's robust futexes right before calling lwp_ctl_exit().

Fixes a "WARNING: ... : unmapped robust futex list head" message when
running bash under Linux emulation on aarch64.

Root caused and patch proposed by ryo@.  I have tweaked it slightly,
just to add a comment and a KASSERT().

Revision 1.504.4.2 / (download) - annotate - [select for diffs], Thu Jun 17 04:46:33 2021 UTC (19 months, 1 week ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.504.4.1: +6 -6 lines
Diff to previous 1.504.4.1 (colored) to branchpoint 1.504 (colored) next main 1.505 (colored)

Sync w/ HEAD.

Revision 1.506 / (download) - annotate - [select for diffs], Fri Jun 11 12:54:22 2021 UTC (19 months, 2 weeks ago) by martin
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2
Changes since 1.505: +6 -6 lines
Diff to previous 1.505 (colored)

Fix the order of handling of posix_spawn attributes and file actions.
The standard is explicit about it and it matters if e.g. RESETIDS is
used as an attribute and file actions depend on the group rights for
opening a file.

Revision 1.504.4.1 / (download) - annotate - [select for diffs], Thu May 13 00:47:32 2021 UTC (20 months, 2 weeks ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.504: +3 -3 lines
Diff to previous 1.504 (colored)

Sync with HEAD.

Revision 1.442.4.8 / (download) - annotate - [select for diffs], Mon May 3 09:15:30 2021 UTC (20 months, 3 weeks ago) by bouyer
Branch: netbsd-8
Changes since 1.442.4.7: +3 -3 lines
Diff to previous 1.442.4.7 (colored) to branchpoint 1.442 (colored) next main 1.443 (colored)

Pull up following revision(s) (requested by martin in ticket #1677):
	sys/kern/kern_exec.c: revision 1.505 via patch
Fix copy&pasto in handling of POSIX_SPAWN_RESETIDS in posix_spawn(3)

Revision 1.478.2.2 / (download) - annotate - [select for diffs], Mon May 3 09:12:50 2021 UTC (20 months, 3 weeks ago) by bouyer
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE
Changes since 1.478.2.1: +3 -3 lines
Diff to previous 1.478.2.1 (colored) to branchpoint 1.478 (colored) next main 1.479 (colored)

Pull up following revision(s) (requested by martin in ticket #1265):
	sys/kern/kern_exec.c: revision 1.505 via patch
Fix copy&pasto in handling of POSIX_SPAWN_RESETIDS in posix_spawn(3)

Revision 1.505 / (download) - annotate - [select for diffs], Sun May 2 10:23:55 2021 UTC (20 months, 3 weeks ago) by martin
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.504: +3 -3 lines
Diff to previous 1.504 (colored)

Fix copy&pasto in handling of POSIX_SPAWN_RESETIDS in posix_spawn(3)

Revision 1.502.2.1 / (download) - annotate - [select for diffs], Mon Dec 14 14:38:13 2020 UTC (2 years, 1 month ago) by thorpej
Branch: thorpej-futex
Changes since 1.502: +6 -4 lines
Diff to previous 1.502 (colored) next main 1.503 (colored)

Sync w/ HEAD.

Revision 1.504 / (download) - annotate - [select for diffs], Sat Dec 5 18:17:01 2020 UTC (2 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base, thorpej-cfargs
Branch point for: thorpej-i2c-spi-conf
Changes since 1.503: +3 -3 lines
Diff to previous 1.503 (colored)

Refactor interval timers to make it possible to support types other than
the BSD/POSIX per-process timers:

- "struct ptimer" is split into "struct itimer" (common interval timer
  data) and "struct ptimer" (per-process timer data, which contains a
  "struct itimer").

- Introduce a new "struct itimer_ops" that supplies information about
  the specific kind of interval timer, including it's processing
  queue, the softint handle used to schedule processing, the function
  to call when the timer fires (which adds it to the queue), and an
  optional function to call when the CLOCK_REALTIME clock is changed by
  a call to clock_settime() or settimeofday().

- Rename some fuctions to clearly identify what they're operating on
  (ptimer vs itimer).

- Use kmem(9) to allocate ptimer-related structures, rather than having
  dedicated pools for them.

Welcome to NetBSD 9.99.77.

Revision 1.503 / (download) - annotate - [select for diffs], Wed Nov 25 21:08:59 2020 UTC (2 years, 2 months ago) by wiz
Branch: MAIN
Changes since 1.502: +5 -3 lines
Diff to previous 1.502 (colored)

Define LMSG outside the MAXTSIZ check so it also exists in non-MAXTSIZ kernels.

Revision 1.502 / (download) - annotate - [select for diffs], Tue Oct 6 13:38:00 2020 UTC (2 years, 3 months ago) by christos
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.501: +20 -13 lines
Diff to previous 1.501 (colored)

Make MAXTSIZ optional.

Revision 1.501 / (download) - annotate - [select for diffs], Sat May 23 23:42:43 2020 UTC (2 years, 8 months ago) by ad
Branch: MAIN
Changes since 1.500: +19 -19 lines
Diff to previous 1.500 (colored)

Move proc_lock into the data segment.  It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.

Revision 1.500 / (download) - annotate - [select for diffs], Thu May 7 20:02:34 2020 UTC (2 years, 8 months ago) by kamil
Branch: MAIN
Changes since 1.499: +8 -4 lines
Diff to previous 1.499 (colored)

On debugger attach to a prestarted process don't report SIGTRAP

Introduce PSL_TRACEDCHILD that indicates tracking of birth of a process.
A freshly forked process checks whether it is traced and if so, reports
SIGTRAP + TRAP_CHLD event to a debugger as a result of tracking forks-like
events. There is a time window when a debugger can attach to a newly
created process and receive SIGTRAP + TRAP_CHLD instead of SIGSTOP.

Fixes races in t_ptrace_wait* tests when a test hangs or misbehaves,
especially the ones reported in tracer_sysctl_lookup_without_duplicates.

Revision 1.495.2.2 / (download) - annotate - [select for diffs], Sat Apr 25 11:24:05 2020 UTC (2 years, 9 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.495.2.1: +19 -17 lines
Diff to previous 1.495.2.1 (colored) to branchpoint 1.495 (colored) next main 1.496 (colored)

Sync with bouyer-xenpvh-base2 (HEAD)

Revision 1.499 / (download) - annotate - [select for diffs], Fri Apr 24 03:22:06 2020 UTC (2 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: bouyer-xenpvh-base2
Changes since 1.498: +11 -8 lines
Diff to previous 1.498 (colored)

Overhaul the way LWP IDs are allocated.  Instead of each LWP having it's
own LWP ID space, LWP IDs came from the same number space as PIDs.  The
lead LWP of a process gets the PID as its LID.  If a multi-LWP process's
lead LWP exits, the PID persists for the process.

In addition to providing system-wide unique thread IDs, this also lets us
eliminate the per-process LWP radix tree, and some associated locks.

Remove the separate "global thread ID" map added previously; it is no longer
needed to provide this functionality.

Nudged in this direction by ad@ and chs@.

Revision 1.498 / (download) - annotate - [select for diffs], Tue Apr 21 21:42:47 2020 UTC (2 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.497: +10 -11 lines
Diff to previous 1.497 (colored)

Revert the changes made in February to make cwdinfo use mostly lockless,
which relied on taking extra vnode refs.

Having benchmarked various experimental changes over the past few months it
seems that it's better to avoid vnode refs as much as possible.  cwdi_lock
as a RW lock already did that to some extent for getcwd() and will permit
the same for namei() too.

Revision 1.459.2.3 / (download) - annotate - [select for diffs], Tue Apr 21 18:42:42 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.459.2.2: +8 -3 lines
Diff to previous 1.459.2.2 (colored) to branchpoint 1.459 (colored) next main 1.460 (colored)

Sync with HEAD

Revision 1.495.2.1 / (download) - annotate - [select for diffs], Mon Apr 20 11:29:10 2020 UTC (2 years, 9 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.495: +10 -5 lines
Diff to previous 1.495 (colored)

Sync with HEAD

Revision 1.497 / (download) - annotate - [select for diffs], Sun Apr 19 20:31:59 2020 UTC (2 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base1
Changes since 1.496: +7 -2 lines
Diff to previous 1.496 (colored)

- Only increment nprocs when we're creating a new process, not just
  when allocating a PID.
- Per above, proc_free_pid() no longer decrements nprocs.  It's now done
  in proc_free() right after proc_free_pid().
- Ensure nprocs is accessed using atomics everywhere.

Revision 1.496 / (download) - annotate - [select for diffs], Tue Apr 14 22:42:18 2020 UTC (2 years, 9 months ago) by kamil
Branch: MAIN
Changes since 1.495: +5 -5 lines
Diff to previous 1.495 (colored)

Set p_oppid always, not just when a parent is traced

PR kern/55151 by Martin Husemann

Revision 1.459.2.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:03 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.459.2.1: +422 -288 lines
Diff to previous 1.459.2.1 (colored) to branchpoint 1.459 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.495 / (download) - annotate - [select for diffs], Mon Apr 6 08:20:05 2020 UTC (2 years, 9 months ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.494: +3 -2 lines
Diff to previous 1.494 (colored)

Reintroduce struct proc::p_oppid

Relying on p_opptr is not safe as there is a race between:
 - spawner giving a birth to a child process and being killed
 - spawnee accessng p_opptr and reporting TRAP_CHLD

PR kern/54786 by Andreas Gustafsson

Revision 1.494 / (download) - annotate - [select for diffs], Sun Apr 5 20:53:17 2020 UTC (2 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.493: +164 -164 lines
Diff to previous 1.493 (colored)

- Untangle spawn_return by splitting it up to sub-functions.
- Merge the eventswitch parent notification code which was copied in two
  places (eventswitchchild)
- Fix bugs in the eventswitch parent notification code:
  1. p_slflags should be accessed holding both proc_lock and p->p_lock
  2. p->p_opptr can be NULL if the parent was PSL_CHTRACED and exited.

Fixes random crashes the posix_spawn_kill_spawner unit test which tried
to dereference a NULL pptr.

Revision 1.485.2.4 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:02 2020 UTC (2 years, 10 months ago) by ad
Branch: ad-namecache
Changes since 1.485.2.3: +18 -14 lines
Diff to previous 1.485.2.3 (colored) to branchpoint 1.485 (colored) next main 1.486 (colored)

Sync with head.

Revision 1.493 / (download) - annotate - [select for diffs], Sun Feb 23 22:14:03 2020 UTC (2 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.492: +12 -11 lines
Diff to previous 1.492 (colored)

Merge from ad-namecache:

- Have a stab at clustering the members of vnode_t and vnode_impl_t in a
  more cache-conscious way.  With that done, go back to adjusting v_usecount
  with atomics and keep vi_lock directly in vnode_impl_t (saves KVA).

- Allow VOP_LOCK(LK_NONE) for the benefit of VFS_VGET() and VFS_ROOT().
  Make sure LK_UPGRADE always comes with LK_NOWAIT.

- Make cwdinfo use mostly lockless.

Revision 1.492 / (download) - annotate - [select for diffs], Sat Feb 15 17:13:55 2020 UTC (2 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.491: +5 -28 lines
Diff to previous 1.491 (colored)

PR kern/54922: 9.99.45@20200202 panic: diagnostic assertion linux ldconfig triggers vpp != NULL in exit1()->radixtree.c line 674

Create an lwp_renumber() from the code in emulexec() and use in
linux_e_proc_exec() and linux_e_proc_fork() too.

Revision 1.491 / (download) - annotate - [select for diffs], Mon Feb 10 22:13:01 2020 UTC (2 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.490: +14 -6 lines
Diff to previous 1.490 (colored)

- check for errors in exec_resolvename() and fail
- put back the compat_linux modules in the exec array (commented out)
- remove extra parens

Revision 1.490 / (download) - annotate - [select for diffs], Wed Jan 29 15:47:52 2020 UTC (2 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.489: +28 -9 lines
Diff to previous 1.489 (colored)

- Track LWPs in a per-process radixtree.  It uses no extra memory in the
  single threaded case.  Replace scans of p->p_lwps with lookups in the
  tree.  Find free LIDs for new LWPs in the tree.  Replace the hashed sleep
  queues for park/unpark with lookups in the tree under cover of a RW lock.

- lwp_wait(): if waiting on a specific LWP, find the LWP via tree lookup and
  return EINVAL if it's detached, not ESRCH.

- Group the locks in struct proc at the end of the struct in their own cache
  line.

- Add some comments.

Revision 1.485.2.3 / (download) - annotate - [select for diffs], Sat Jan 25 22:38:50 2020 UTC (3 years ago) by ad
Branch: ad-namecache
Changes since 1.485.2.2: +4 -4 lines
Diff to previous 1.485.2.2 (colored) to branchpoint 1.485 (colored)

Sync with head.

Revision 1.485.2.2 / (download) - annotate - [select for diffs], Sat Jan 25 15:54:03 2020 UTC (3 years ago) by ad
Branch: ad-namecache
Changes since 1.485.2.1: +12 -11 lines
Diff to previous 1.485.2.1 (colored) to branchpoint 1.485 (colored)

Make cwdinfo use mostly lockless, and largely hide the details in vfs_cwd.c.

Revision 1.489 / (download) - annotate - [select for diffs], Thu Jan 23 10:05:44 2020 UTC (3 years ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base2
Changes since 1.488: +4 -4 lines
Diff to previous 1.488 (colored)

exec_lock: declare it in the header, and mark with __cachline_aligned.

Revision 1.485.2.1 / (download) - annotate - [select for diffs], Fri Jan 17 21:47:35 2020 UTC (3 years ago) by ad
Branch: ad-namecache
Changes since 1.485: +56 -35 lines
Diff to previous 1.485 (colored)

Sync with head.

Revision 1.488 / (download) - annotate - [select for diffs], Sun Jan 12 22:03:22 2020 UTC (3 years ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base1
Changes since 1.487: +47 -29 lines
Diff to previous 1.487 (colored)

A final set of scheduler tweaks:

- Try hard to keep vfork() parent and child on the same CPU until execve(),
  failing that on the same core, but in all other cases scatter new LWPs
  among the different CPU packages, round robin, to try and get the best out
  of the available cache and bus bandwidth.

- Remove attempts at balancing.  Replace with a rate-limited skim of other
  CPU's run queues in sched_idle(), starting in the current package and
  moving outwards.  Add a sysctl tunable to change the interval.

- Make the cacheht_time tuneable take a milliseconds value.

- It's possible to configure things such that there's no CPU allowed to run
  an LWP.  Defeat this by always having a default:

Reported-by: syzbot+46968944dd9359ab93bc@syzkaller.appspotmail.com
Reported-by: syzbot+7f750a4cc230d1e831f9@syzkaller.appspotmail.com
Reported-by: syzbot+88d7675158f5cb4684db@syzkaller.appspotmail.com
Reported-by: syzbot+d409c2338150e9a8ae1e@syzkaller.appspotmail.com
Reported-by: syzbot+e152dc5bff188f67358a@syzkaller.appspotmail.com

Revision 1.487 / (download) - annotate - [select for diffs], Sun Jan 12 18:30:58 2020 UTC (3 years ago) by ad
Branch: MAIN
Changes since 1.486: +11 -7 lines
Diff to previous 1.486 (colored)

Tidy up the vnode locking around execve() on ELF images to acquire and
release the locks fewer times.  Proposed on tech-kern a very long time go.

Revision 1.486 / (download) - annotate - [select for diffs], Wed Jan 8 17:38:42 2020 UTC (3 years ago) by ad
Branch: MAIN
Changes since 1.485: +2 -3 lines
Diff to previous 1.485 (colored)

Hopefully fix some problems seen with MP support on non-x86, in particular
where curcpu() is defined as curlwp->l_cpu:

- mi_switch(): undo the ~2007ish optimisation to unlock curlwp before
  calling cpu_switchto().  It's not safe to let other actors mess with the
  LWP (in particular l->l_cpu) while it's still context switching.  This
  removes l->l_ctxswtch.

- Move the LP_RUNNING flag into l->l_flag and rename to LW_RUNNING since
  it's now covered by the LWP's lock.

- Ditch lwp_exit_switchaway() and just call mi_switch() instead.  Everything
  is in cache anyway so it wasn't buying much by trying to avoid saving old
  state.  This means cpu_switchto() will never be called with prevlwp ==
  NULL.

- Remove some KERNEL_LOCK handling which hasn't been needed for years.

Revision 1.485 / (download) - annotate - [select for diffs], Fri Dec 6 21:36:10 2019 UTC (3 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base
Branch point for: ad-namecache
Changes since 1.484: +3 -2 lines
Diff to previous 1.484 (colored)

Make it possible to call mi_switch() and immediately switch to another CPU.
This seems to take about 3us on my Intel system.  Two changes required:

- Have the caller to mi_switch() be responsible for calling spc_lock().
- Avoid using l->l_cpu in mi_switch().

While here:

- Add a couple of calls to membar_enter()
- Have the idle LWP set itself to LSIDL, to match softint_thread().
- Remove unused return value from mi_switch().

Revision 1.484 / (download) - annotate - [select for diffs], Sat Nov 23 19:42:52 2019 UTC (3 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.483: +9 -6 lines
Diff to previous 1.483 (colored)

Minor scheduler cleanup:

- Adapt to cpu_need_resched() changes. Avoid lost & duplicate IPIs and ASTs.
  sched_resched_cpu() and sched_resched_lwp() contain the logic for this.
- Changes for LSIDL to make the locking scheme match the intended design.
- Reduce lock contention and false sharing further.
- Numerous small bugfixes, including some corrections for SCHED_FIFO/RT.
- Use setrunnable() in more places, and merge cut & pasted code.

Revision 1.478.2.1 / (download) - annotate - [select for diffs], Tue Oct 15 18:32:13 2019 UTC (3 years, 3 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.478: +5 -7 lines
Diff to previous 1.478 (colored)

Pull up following revision(s) (requested by kamil in ticket #311):

	sys/sys/siginfo.h: revision 1.34
	sys/kern/sys_ptrace_common.c: revision 1.59
	sys/kern/sys_lwp.c: revision 1.70
	sys/compat/sys/siginfo.h: revision 1.8
	sys/kern/kern_sig.c: revision 1.365
	sys/kern/kern_lwp.c: revision 1.203
	sys/sys/signalvar.h: revision 1.96
	sys/kern/kern_exec.c: revision 1.482
	sys/kern/kern_fork.c: revision 1.214

Move TRAP_CHLD/TRAP_LWP ptrace information from struct proc to siginfo

Storing struct ptrace_state information inside struct proc was vulnerable
to synchronization bugs, as multiple events emitted in the same time were
overwritting other ones.

Cache the original parent process id in p_oppid. Reusing here p_opptr is
in theory prone to slight race codition.

Change the semantics of PT_GET_PROCESS_STATE, reutning EINVAL for calls
prompting for the value in cases when there wasn't registered an
appropriate event.

Add an alternative approach to check the ptrace_state information, directly
from the siginfo_t value returned from PT_GET_SIGINFO. The original
PT_GET_PROCESS_STATE approach is kept for compat with older NetBSD and
OpenBSD. New code is recommended to keep using PT_GET_PROCESS_STATE.
Add a couple of compile-time asserts for assumptions in the code.

No functional change intended in existing ptrace(2) software.

All ATF ptrace(2) and ATF GDB tests pass.

This change improves reliability of the threading ptrace(2) code.

Revision 1.483 / (download) - annotate - [select for diffs], Sat Oct 12 10:55:23 2019 UTC (3 years, 3 months ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.482: +3 -4 lines
Diff to previous 1.482 (colored)

Remove p_oppid from struct proc

This field is not needed as it duplicated p_opptr that is alread safe to
use, unless proven otherwise.

eventswitch() already contained a check for != initproc (pid1).

Ride ABI bump for 9.99.16.

Revision 1.482 / (download) - annotate - [select for diffs], Mon Sep 30 21:13:33 2019 UTC (3 years, 3 months ago) by kamil
Branch: MAIN
Changes since 1.481: +6 -7 lines
Diff to previous 1.481 (colored)

Move TRAP_CHLD/TRAP_LWP ptrace information from struct proc to siginfo

Storing struct ptrace_state information inside struct proc was vulnerable
to synchronization bugs, as multiple events emitted in the same time were
overwritting other ones.

Cache the original parent process id in p_oppid. Reusing here p_opptr is
in theory prone to slight race codition.

Change the semantics of PT_GET_PROCESS_STATE, reutning EINVAL for calls
prompting for the value in cases when there wasn't registered an
appropriate event.

Add an alternative approach to check the ptrace_state information, directly
from the siginfo_t value returned from PT_GET_SIGINFO. The original
PT_GET_PROCESS_STATE approach is kept for compat with older NetBSD and
OpenBSD. New code is recommended to keep using PT_GET_PROCESS_STATE.

Add a couple of compile-time asserts for assumptions in the code.

No functional change intended in existing ptrace(2) software.

All ATF ptrace(2) and ATF GDB tests pass.

This change improves reliability of the threading ptrace(2) code.

Revision 1.481 / (download) - annotate - [select for diffs], Tue Sep 17 15:19:27 2019 UTC (3 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.480: +21 -18 lines
Diff to previous 1.480 (colored)

Add a boolean argument to indicate if we have a path/true (execve) or an
fd/false (fexecve). This is needed to differentiate between them because
NULL/-1 can be readily passed from userland.

Revision 1.480 / (download) - annotate - [select for diffs], Sun Sep 15 20:23:50 2019 UTC (3 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.479: +101 -41 lines
Diff to previous 1.479 (colored)

- Add support for fexecve
	- get the vnode from the fd passed instead of calling namei() on the
	  path
	- try to reverse resolve the vnode to extract the pathname
	- deal with not having a resolved path available
- rename variable that was not a pathbuf

Revision 1.479 / (download) - annotate - [select for diffs], Sat Sep 7 15:34:44 2019 UTC (3 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.478: +14 -25 lines
Diff to previous 1.478 (colored)

- move quadruplicated code into a function
- delete #if 1 and #if 0 code

Revision 1.442.4.7 / (download) - annotate - [select for diffs], Mon Aug 5 14:47:49 2019 UTC (3 years, 5 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE
Changes since 1.442.4.6: +3 -3 lines
Diff to previous 1.442.4.6 (colored) to branchpoint 1.442 (colored)

Fix editor mistake in previous

Revision 1.442.4.6 / (download) - annotate - [select for diffs], Mon Aug 5 14:43:54 2019 UTC (3 years, 5 months ago) by martin
Branch: netbsd-8
Changes since 1.442.4.5: +3 -3 lines
Diff to previous 1.442.4.5 (colored) to branchpoint 1.442 (colored)

Backout the pullup of r1.476:

	remove offs initialization and XXX gcc comment.

While actually the "offs" variable is always initialized when used, the
gcc version on this branch is not smart enough to recognize that.

Revision 1.442.4.5 / (download) - annotate - [select for diffs], Sun Aug 4 11:25:43 2019 UTC (3 years, 5 months ago) by martin
Branch: netbsd-8
Changes since 1.442.4.4: +22 -16 lines
Diff to previous 1.442.4.4 (colored) to branchpoint 1.442 (colored)

Pull up the following revisions, requested by maxv in ticket #1324:

	sys/kern/kern_exec.c	1.469-1.478 (via patch)

Fix off-by-one and info leak.

Revision 1.478 / (download) - annotate - [select for diffs], Fri Jul 5 17:14:48 2019 UTC (3 years, 6 months ago) by maxv
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.477: +3 -2 lines
Diff to previous 1.477 (colored)

Fix info leak. The padding of 'sigact' is not initialized, it gets copied
in the proc, and can later be obtained by userland.

Revision 1.477 / (download) - annotate - [select for diffs], Thu Jun 27 19:56:10 2019 UTC (3 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.476: +5 -3 lines
Diff to previous 1.476 (colored)

Fix this fucking shit once and for all, for fuck's sake.

Revision 1.476 / (download) - annotate - [select for diffs], Thu Jun 27 17:09:31 2019 UTC (3 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.475: +3 -3 lines
Diff to previous 1.475 (colored)

remove offs initialization and XXX gcc comment. Offs should always be
initialized. Pointed out by maxv.

Revision 1.475 / (download) - annotate - [select for diffs], Thu Jun 27 17:07:51 2019 UTC (3 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.474: +3 -3 lines
Diff to previous 1.474 (colored)

Return an error if the path was too long. Pointed out by maxv

Revision 1.474 / (download) - annotate - [select for diffs], Wed Jun 26 20:28:59 2019 UTC (3 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.473: +4 -9 lines
Diff to previous 1.473 (colored)

Remove useless debugging messages which achieved nothing but hiding bugs.

Revision 1.473 / (download) - annotate - [select for diffs], Wed Jun 26 00:30:39 2019 UTC (3 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.472: +3 -3 lines
Diff to previous 1.472 (colored)

whitespace around operators

Revision 1.472 / (download) - annotate - [select for diffs], Tue Jun 25 21:32:58 2019 UTC (3 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.471: +7 -5 lines
Diff to previous 1.471 (colored)

Fail if getcwd fails. Pointed out by maxv@

Revision 1.471 / (download) - annotate - [select for diffs], Tue Jun 25 19:47:35 2019 UTC (3 years, 7 months ago) by wiz
Branch: MAIN
Changes since 1.470: +3 -3 lines
Diff to previous 1.470 (colored)

Fix word (direct -> directory) in comment.

Revision 1.470 / (download) - annotate - [select for diffs], Tue Jun 25 18:06:29 2019 UTC (3 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.469: +8 -2 lines
Diff to previous 1.469 (colored)

add a comment explaining what this does.

Revision 1.469 / (download) - annotate - [select for diffs], Tue Jun 25 16:58:02 2019 UTC (3 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.468: +3 -3 lines
Diff to previous 1.468 (colored)

Fix buffer overflow. It seems that some people need to go back to the
basics of C programming.

Reported-by: syzbot+8665827f389a9fac5cc9@syzkaller.appspotmail.com

Revision 1.468 / (download) - annotate - [select for diffs], Tue Jun 18 23:53:55 2019 UTC (3 years, 7 months ago) by kamil
Branch: MAIN
Changes since 1.467: +3 -2 lines
Diff to previous 1.467 (colored)

Add support for KTR logs of SIGTRAP for TRAP_CHILD events

Previously it was disabled due to vfork(2) synchronization issues.
These problems are now gone.

While there, set l_vforkwaiting to false in posix_spawn. This is not very
needed but it does not make harm to keep it initialized explicitly.

Revision 1.467 / (download) - annotate - [select for diffs], Thu Jun 13 20:20:18 2019 UTC (3 years, 7 months ago) by kamil
Branch: MAIN
Changes since 1.466: +10 -3 lines
Diff to previous 1.466 (colored)

Correct use-after-free issue in vfork(2)

In the previous behavior vforking parent was keeping pointer to a child
and checking whether it clears a PL_PPWAIT in its bitfield p_lflag. However
a child can go invalid between exec/exit event from child and waking up
vforked parent and this can cause invalid pointer read and in the worst
scenario kernel crash.

In the new behavior vforked child keeps a reference to vforked parent LWP
and sets a value l_vforkwaiting to false. This means that vforked child
can finish its work, exec/exit and be terminated and once parent will be
woken up it will read its own field whether its child is still blocking.

Add new field in struct lwp: l_vforkwaiting protected by proc_lock.
In future it should be refactored and all PL_PPWAIT users transformed to
l_vforkwaiting and next l_vforkwaiting probably transformed into a bit
field.

This is another attempt of fixing this bug after <rmind> from 2012 in
commit:

Author: rmind <rmind@NetBSD.org>
Date:   Sun Jul 22 22:40:18 2012 +0000

    fork1: fix use-after-free problems.  Addresses PR/46128 from Andrew Doran.
    Note: PL_PPWAIT should be fully replaced and modificaiton of l_pflag by
    other LWP is undesirable, but this is enough for netbsd-6.

The new version no longer performs unsafe access in l_lflag changing the
LP_VFORKWAIT bit.

Verified with ATF t_vfork and t_ptrace* tests and they are no longer
causing any issues in my local setup.

Fixes PR/46128 by Andrew Doran

Revision 1.466 / (download) - annotate - [select for diffs], Tue Jun 11 23:18:55 2019 UTC (3 years, 7 months ago) by kamil
Branch: MAIN
Changes since 1.465: +58 -19 lines
Diff to previous 1.465 (colored)

Add support for PTRACE_POSIX_SPAWN to report posix_spawn(3) events

posix_spawn(3) is a first class syscall in NetBSD, different to
(V)FORK+EXEC as these operations are executed in one go. This differs to
Linux and FreeBSD, where posix_spawn(3) is implemented with existing kernel
primitives (clone(2), vfork(2), exec(3)) inside libc.

Typically LLDB and GDB software is aware of FORK/VFORK events. As discussed
with the LLDB community, instead of slicing the posix_spawn(3) operation
into phases emulating (V)FORK+EXEC(+VFORK_DONE) and returning intermediate
state to the debugger, that might have abnormal state, introduce new event
type: PTRACE_POSIX_SPAWN.

A debugger implementor can easily map it into existing fork+exec semantics
or treat as a distinct event.

There is no functional change for existing debuggers as there was no
support for reporting posix_spawn(3) events on the kernel side.

Revision 1.459.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:03 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.459: +8 -11 lines
Diff to previous 1.459 (colored)

Sync with HEAD

Revision 1.465 / (download) - annotate - [select for diffs], Thu May 9 20:50:14 2019 UTC (3 years, 8 months ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20190609
Changes since 1.464: +3 -3 lines
Diff to previous 1.464 (colored)

Report TRAP_EXEC (for exec()) to a debugger in the PT_SYSCALL mode

Orignally exec() reporting was disabled in the NetBSD version as there
was no support for fine-grained reporting. Meanwhile PT_SYSCALL was broken
for years and there is no software that depends on this behavior.

There is need to catch exec() events in syscall tracers using ptrace(2).
Instead of adding workarounds of guessing that exec() happened, report the
event directly from the kernel.

All ATF ptrace(2) tests pass.

Revision 1.464 / (download) - annotate - [select for diffs], Fri May 3 22:34:21 2019 UTC (3 years, 8 months ago) by kamil
Branch: MAIN
Changes since 1.463: +3 -5 lines
Diff to previous 1.463 (colored)

Register KTR events for debugger related signals

Register signals for:

 - crashes (FPE, SEGV, FPE, ILL, BUS)
 - LWP events
 - CHLD (FORK/VFORK/VFORK_DONE) events -- temporarily disabled
 - EXEC events

While there refactor related functions in order to simplify the code.

Add missing comment documentation for recently added kernel functions.

Revision 1.463 / (download) - annotate - [select for diffs], Wed May 1 17:21:55 2019 UTC (3 years, 8 months ago) by kamil
Branch: MAIN
Changes since 1.462: +3 -7 lines
Diff to previous 1.462 (colored)

Add eventswitch() in signal code

Route all crash and debugger related signal through eventswitch(), that
calls sigswitch() with preprocessed arguments.

This code avoids code duplication and allows to introduce changes that
will affect all callers of sigswitch() in debugger-related events.

No functional change intended.

Revision 1.408.2.6 / (download) - annotate - [select for diffs], Wed Nov 28 19:39:56 2018 UTC (4 years, 1 month ago) by martin
Branch: netbsd-7
Changes since 1.408.2.5: +4 -2 lines
Diff to previous 1.408.2.5 (colored) to branchpoint 1.408 (colored) next main 1.409 (colored)

Pull up following revision(s) (requested by maxv in ticket #1658):

	sys/kern/kern_exec.c: revision 1.462

Fix stack info leak. There are 2x4 bytes of padding in struct ps_strings.

[  223.896199] kleak: Possible leak in copyout: [len=32, leaked=8]
[  223.906430] #0 0xffffffff80224d0a in kleak_note <netbsd>
[  223.906430] #1 0xffffffff80224d8a in kleak_copyout <netbsd>
[  223.918363] #2 0xffffffff80b1e26c in copyoutpsstrs <netbsd>
[  223.926560] #3 0xffffffff80b1e331 in copyoutargs <netbsd>
[  223.936216] #4 0xffffffff80b21768 in execve_runproc <netbsd>
[  223.946225] #5 0xffffffff80b21cc9 in execve1 <netbsd>
[  223.946225] #6 0xffffffff8025a89c in sy_call <netbsd>
[  223.956225] #7 0xffffffff8025aace in sy_invoke <netbsd>
[  223.966232] #8 0xffffffff8025ab54 in syscall <netbsd>

Revision 1.408.2.4.4.2 / (download) - annotate - [select for diffs], Wed Nov 28 19:38:48 2018 UTC (4 years, 1 month ago) by martin
Branch: netbsd-7-1
Changes since 1.408.2.4.4.1: +4 -2 lines
Diff to previous 1.408.2.4.4.1 (colored) to branchpoint 1.408.2.4 (colored) next main 1.408.2.5 (colored)

Pull up following revision(s) (requested by maxv in ticket #1658):

	sys/kern/kern_exec.c: revision 1.462

Fix stack info leak. There are 2x4 bytes of padding in struct ps_strings.

[  223.896199] kleak: Possible leak in copyout: [len=32, leaked=8]
[  223.906430] #0 0xffffffff80224d0a in kleak_note <netbsd>
[  223.906430] #1 0xffffffff80224d8a in kleak_copyout <netbsd>
[  223.918363] #2 0xffffffff80b1e26c in copyoutpsstrs <netbsd>
[  223.926560] #3 0xffffffff80b1e331 in copyoutargs <netbsd>
[  223.936216] #4 0xffffffff80b21768 in execve_runproc <netbsd>
[  223.946225] #5 0xffffffff80b21cc9 in execve1 <netbsd>
[  223.946225] #6 0xffffffff8025a89c in sy_call <netbsd>
[  223.956225] #7 0xffffffff8025aace in sy_invoke <netbsd>
[  223.966232] #8 0xffffffff8025ab54 in syscall <netbsd>

Revision 1.408.2.3.2.3 / (download) - annotate - [select for diffs], Wed Nov 28 19:37:46 2018 UTC (4 years, 1 month ago) by martin
Branch: netbsd-7-0
Changes since 1.408.2.3.2.2: +4 -2 lines
Diff to previous 1.408.2.3.2.2 (colored) to branchpoint 1.408.2.3 (colored) next main 1.408.2.4 (colored)

Pull up following revision(s) (requested by maxv in ticket #1658):

	sys/kern/kern_exec.c: revision 1.462

Fix stack info leak. There are 2x4 bytes of padding in struct ps_strings.

[  223.896199] kleak: Possible leak in copyout: [len=32, leaked=8]
[  223.906430] #0 0xffffffff80224d0a in kleak_note <netbsd>
[  223.906430] #1 0xffffffff80224d8a in kleak_copyout <netbsd>
[  223.918363] #2 0xffffffff80b1e26c in copyoutpsstrs <netbsd>
[  223.926560] #3 0xffffffff80b1e331 in copyoutargs <netbsd>
[  223.936216] #4 0xffffffff80b21768 in execve_runproc <netbsd>
[  223.946225] #5 0xffffffff80b21cc9 in execve1 <netbsd>
[  223.946225] #6 0xffffffff8025a89c in sy_call <netbsd>
[  223.956225] #7 0xffffffff8025aace in sy_invoke <netbsd>
[  223.966232] #8 0xffffffff8025ab54 in syscall <netbsd>

Revision 1.456.2.5 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:50 2018 UTC (4 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.456.2.4: +4 -2 lines
Diff to previous 1.456.2.4 (colored) to branchpoint 1.456 (colored) next main 1.457 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.442.4.4 / (download) - annotate - [select for diffs], Wed Nov 21 11:58:32 2018 UTC (4 years, 2 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-1-RELEASE, netbsd-8-1-RC1
Changes since 1.442.4.3: +4 -2 lines
Diff to previous 1.442.4.3 (colored) to branchpoint 1.442 (colored)

Pull up following revision(s) (requested by maxv in ticket #1100):

	sys/kern/kern_exec.c: revision 1.462

Fix stack info leak. There are 2x4 bytes of padding in struct ps_strings.
[  223.896199] kleak: Possible leak in copyout: [len=32, leaked=8]
[  223.906430] #0 0xffffffff80224d0a in kleak_note <netbsd>
[  223.906430] #1 0xffffffff80224d8a in kleak_copyout <netbsd>
[  223.918363] #2 0xffffffff80b1e26c in copyoutpsstrs <netbsd>
[  223.926560] #3 0xffffffff80b1e331 in copyoutargs <netbsd>
[  223.936216] #4 0xffffffff80b21768 in execve_runproc <netbsd>
[  223.946225] #5 0xffffffff80b21cc9 in execve1 <netbsd>
[  223.946225] #6 0xffffffff8025a89c in sy_call <netbsd>
[  223.956225] #7 0xffffffff8025aace in sy_invoke <netbsd>
[  223.966232] #8 0xffffffff8025ab54 in syscall <netbsd>

Revision 1.462 / (download) - annotate - [select for diffs], Sun Nov 11 10:55:58 2018 UTC (4 years, 2 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, isaki-audio2-base, isaki-audio2
Changes since 1.461: +4 -2 lines
Diff to previous 1.461 (colored)

Fix stack info leak. There are 2x4 bytes of padding in struct ps_strings.

[  223.896199] kleak: Possible leak in copyout: [len=32, leaked=8]
[  223.906430] #0 0xffffffff80224d0a in kleak_note <netbsd>
[  223.906430] #1 0xffffffff80224d8a in kleak_copyout <netbsd>
[  223.918363] #2 0xffffffff80b1e26c in copyoutpsstrs <netbsd>
[  223.926560] #3 0xffffffff80b1e331 in copyoutargs <netbsd>
[  223.936216] #4 0xffffffff80b21768 in execve_runproc <netbsd>
[  223.946225] #5 0xffffffff80b21cc9 in execve1 <netbsd>
[  223.946225] #6 0xffffffff8025a89c in sy_call <netbsd>
[  223.956225] #7 0xffffffff8025aace in sy_invoke <netbsd>
[  223.966232] #8 0xffffffff8025ab54 in syscall <netbsd>

Revision 1.456.2.4 / (download) - annotate - [select for diffs], Thu Sep 6 06:56:41 2018 UTC (4 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.456.2.3: +4 -3 lines
Diff to previous 1.456.2.3 (colored) to branchpoint 1.456 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.461 / (download) - annotate - [select for diffs], Mon Sep 3 16:29:35 2018 UTC (4 years, 4 months ago) by riastradh
Branch: MAIN
CVS Tags: pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906
Changes since 1.460: +3 -3 lines
Diff to previous 1.460 (colored)

Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)

Revision 1.460 / (download) - annotate - [select for diffs], Fri Aug 10 21:44:59 2018 UTC (4 years, 5 months ago) by pgoyette
Branch: MAIN
Changes since 1.459: +3 -2 lines
Diff to previous 1.459 (colored)

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys.  Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

	sys/arch/usermode/modules/syscallemu/syscallemu.c

Revision 1.456.2.3 / (download) - annotate - [select for diffs], Mon Jun 25 07:26:04 2018 UTC (4 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.456.2.2: +11 -9 lines
Diff to previous 1.456.2.2 (colored) to branchpoint 1.456 (colored)

Sync with HEAD

Revision 1.459 / (download) - annotate - [select for diffs], Mon May 28 11:32:20 2018 UTC (4 years, 8 months ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0728, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.458: +11 -9 lines
Diff to previous 1.458 (colored)

Correct reporting SIGTRAP TRAP_EXEC when SIGTRAP is masked

Switch from kpsignal(9) to sigswitch() as it allows to bypass signal
masking rules of a crash signal.

There are no regressions in existing tests.

Sponsored by <The NetBSD Foundation>

Revision 1.339.2.5.4.5 / (download) - annotate - [select for diffs], Tue May 22 14:49:01 2018 UTC (4 years, 8 months ago) by martin
Branch: netbsd-6-0
Changes since 1.339.2.5.4.4: +2 -6 lines
Diff to previous 1.339.2.5.4.4 (colored) to branchpoint 1.339.2.5 (colored) next main 1.339.2.6 (colored)

Apply patch requested by maxv in ticket #1500:

 * disable compat_svr4 and compat_svr4_32 everywhere
 * disable compat_ibcs2 everywhere but on Vax
 * remove the svr4/svr4_32/ibcs2/freebsd entries from the autoload list

Revision 1.339.2.6.2.4 / (download) - annotate - [select for diffs], Tue May 22 14:44:30 2018 UTC (4 years, 8 months ago) by martin
Branch: netbsd-6-1
Changes since 1.339.2.6.2.3: +2 -6 lines
Diff to previous 1.339.2.6.2.3 (colored) to branchpoint 1.339.2.6 (colored) next main 1.339.2.7 (colored)

Apply patch requested by maxv in ticket #1500:

 * disable compat_svr4 and compat_svr4_32 everywhere
 * disable compat_ibcs2 everywhere but on Vax
 * remove the svr4/svr4_32/ibcs2/freebsd entries from the autoload list

Revision 1.339.2.11 / (download) - annotate - [select for diffs], Tue May 22 14:38:20 2018 UTC (4 years, 8 months ago) by martin
Branch: netbsd-6
Changes since 1.339.2.10: +2 -6 lines
Diff to previous 1.339.2.10 (colored) to branchpoint 1.339 (colored) next main 1.340 (colored)

Apply patch requested by maxv in ticket #1500:

 * disable compat_svr4 and compat_svr4_32 everywhere
 * disable compat_ibcs2 everywhere but on Vax
 * remove the svr4/svr4_32/ibcs2/freebsd entries from the autoload list

Revision 1.456.2.2 / (download) - annotate - [select for diffs], Mon May 21 04:36:15 2018 UTC (4 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.456.2.1: +2 -3 lines
Diff to previous 1.456.2.1 (colored) to branchpoint 1.456 (colored)

Sync with HEAD

Revision 1.458 / (download) - annotate - [select for diffs], Sun May 6 13:40:51 2018 UTC (4 years, 8 months ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-compat-0521
Changes since 1.457: +2 -3 lines
Diff to previous 1.457 (colored)

Remove an element from struct emul: e_tracesig

e_tracesig used to be implemented for Darwin compat. Nowadays the Darwin
compatiblity layer is gone and there are no other users.

This functionality isn't used where it shall be used in the existing
codebase.

If we want to emulate debugging interfaces in compat layers we would need
to implement that from scratch anyway. We would need to be bug compatible
with other OSes too.

Proposed on tech-kern@.

Welcome to NetBSD 8.99.16!

Sponsored by <The NetBSD Foundation>

Revision 1.456.2.1 / (download) - annotate - [select for diffs], Wed May 2 07:20:22 2018 UTC (4 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.456: +16 -9 lines
Diff to previous 1.456 (colored)

Synch with HEAD

Revision 1.457 / (download) - annotate - [select for diffs], Fri Apr 27 18:33:24 2018 UTC (4 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-0502
Changes since 1.456: +16 -9 lines
Diff to previous 1.456 (colored)

Canonicalize the interpreter path in #! scripts since check_exec() expects
an absolute path, and we KASSERT if that's not the case later.

Revision 1.442.4.3 / (download) - annotate - [select for diffs], Sat Mar 17 11:19:27 2018 UTC (4 years, 10 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Changes since 1.442.4.2: +4 -4 lines
Diff to previous 1.442.4.2 (colored) to branchpoint 1.442 (colored)

Pull up the following revision, requested by maxv as part of ticket #637:

	sys/kern/kern_exec.c	1.456

Fix off-by-one, we don't want the entry point to equal the maximum
address.

Revision 1.408.2.5 / (download) - annotate - [select for diffs], Sun Feb 25 21:16:07 2018 UTC (4 years, 11 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-2-RELEASE
Changes since 1.408.2.4: +2 -6 lines
Diff to previous 1.408.2.4 (colored) to branchpoint 1.408 (colored)

Apply patch (requested by maxv in ticket #1499):
- disable compat_svr4 and compat_svr4_32 everywhere
- disable compat_ibcs2 everywhere but on Vax
- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list

Revision 1.408.2.4.4.1 / (download) - annotate - [select for diffs], Sun Feb 25 21:15:39 2018 UTC (4 years, 11 months ago) by snj
Branch: netbsd-7-1
CVS Tags: netbsd-7-1-2-RELEASE
Changes since 1.408.2.4: +2 -6 lines
Diff to previous 1.408.2.4 (colored)

Apply patch (requested by maxv in ticket #1499):
- disable compat_svr4 and compat_svr4_32 everywhere
- disable compat_ibcs2 everywhere but on Vax
- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list

Revision 1.408.2.3.2.2 / (download) - annotate - [select for diffs], Sun Feb 25 21:15:20 2018 UTC (4 years, 11 months ago) by snj
Branch: netbsd-7-0
Changes since 1.408.2.3.2.1: +2 -6 lines
Diff to previous 1.408.2.3.2.1 (colored) to branchpoint 1.408.2.3 (colored)

Apply patch (requested by maxv in ticket #1499):
- disable compat_svr4 and compat_svr4_32 everywhere
- disable compat_ibcs2 everywhere but on Vax
- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list

Revision 1.456 / (download) - annotate - [select for diffs], Fri Feb 23 19:43:08 2018 UTC (4 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.455: +4 -4 lines
Diff to previous 1.455 (colored)

Fix off-by-one, we don't want the entry point to equal the maximum
address.

Revision 1.455 / (download) - annotate - [select for diffs], Tue Jan 9 20:55:43 2018 UTC (5 years ago) by maya
Branch: MAIN
Changes since 1.454: +2 -3 lines
Diff to previous 1.454 (colored)

remove struct emul's e_fault.

It used to be used by COMPAT_IRIX for the purpose of overriding
uvm_fault (only implemented in MIPS), now removed.

Ride 8.99.12 version bump.

Revision 1.454 / (download) - annotate - [select for diffs], Fri Jan 5 01:51:36 2018 UTC (5 years ago) by christos
Branch: MAIN
Changes since 1.453: +3 -3 lines
Diff to previous 1.453 (colored)

don't print for ENOEXEC

Revision 1.355.2.4 / (download) - annotate - [select for diffs], Sun Dec 3 11:38:44 2017 UTC (5 years, 1 month ago) by jdolecek
Branch: tls-maxphys
Changes since 1.355.2.3: +185 -139 lines
Diff to previous 1.355.2.3 (colored) next main 1.356 (colored)

update from HEAD

Revision 1.453 / (download) - annotate - [select for diffs], Mon Nov 13 22:01:45 2017 UTC (5 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.452: +7 -5 lines
Diff to previous 1.452 (colored)

grab a copy of the absolute pathbuf, before namei() munges it.

Revision 1.452 / (download) - annotate - [select for diffs], Mon Nov 13 20:38:31 2017 UTC (5 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.451: +11 -5 lines
Diff to previous 1.451 (colored)

Use the pathbuf which we pass to namei() (which is always absolute) as the
resolved pathname. We need this in the case of scripts where p_path needs
to point to the interpreter and not the script itself. Otherwise things
like perl script that depend on /proc/$$/exe to re-exec themselves end up
being fork bombs.

In reality we should be using the fully resolved/canonicalized path here, but
namei is not giving it back to us.

Revision 1.451 / (download) - annotate - [select for diffs], Tue Nov 7 20:58:23 2017 UTC (5 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.450: +5 -3 lines
Diff to previous 1.450 (colored)

hack around namei problem.

Revision 1.450 / (download) - annotate - [select for diffs], Tue Nov 7 19:44:04 2017 UTC (5 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.449: +9 -53 lines
Diff to previous 1.449 (colored)

Store full executable path in p->p_path as discussed in tech-kern.
This means that the full executable path is always available.

- exec_elf.c: use p->path to set AT_SUN_EXECNAME, and since this is
  always set, do so unconditionally.
- kern_exec.c: simplify pathexec, use kmem_strfree where appropriate
  and set p->p_path
- kern_exit.c: free p->p_path
- kern_fork.c: set p->p_path for the child.
- kern_proc.c: use p->p_path to return the executable pathname; the
  NULL check for p->p_path, should be a KASSERT?
- exec.h: gc ep_path, it is not used anymore
- param.h: bump version, 'struct proc' size change

TODO:
1. reference count the path string, to save copy at fork and free
   just before exec?
2. canonicalize the pathname by changing namei() to LOCKPARENT
   vnode and then using getcwd() on the parent directory?

Revision 1.449 / (download) - annotate - [select for diffs], Fri Oct 20 19:06:46 2017 UTC (5 years, 3 months ago) by riastradh
Branch: MAIN
Changes since 1.448: +3 -3 lines
Diff to previous 1.448 (colored)

Initialize the in/out parameter vmin.

vmin is only an optional hint since we're not passing UVM_FLAG_FIXED,
but that doesn't mean we should use uninitialized stack garbage as
the hint.

Noted by chs@.

Revision 1.448 / (download) - annotate - [select for diffs], Fri Oct 20 14:48:43 2017 UTC (5 years, 3 months ago) by riastradh
Branch: MAIN
Changes since 1.447: +11 -6 lines
Diff to previous 1.447 (colored)

Carve out KVA for execargs on boot from an exec_map like we used to.

Candidate fix for PR kern/45718: `processes sometimes get stuck and
spin in vm_map', a problem that has been plaguing all our 32-bit
ports for years.

Since we currently use large (256k) buffers for execargs, and since
nobody has stepped up to tackle breaking them into bite-sized (or at
least page-sized) chunks, after KVA gets sufficiently fragmented we
can't allocate new execargs buffers from kernel_map.

Until 2008, we always carved out KVA for execargs on boot with a uvm
submap exec_map of kernel_map.  Then ad@ found that the uvm_km_free
call, to discard them when done, cost about 100us, which a pool
avoided:

https://mail-index.NetBSD.org/tech-kern/2008/06/25/msg001854.html
https://mail-index.NetBSD.org/tech-kern/2008/06/26/msg001859.html

ad@ _simultaneously_ introduced a pool _and_ eliminated the reserved
KVA in the exec_map submap.  This change preserves the pool, but
restores exec_map (with less code, by putting it in MI code instead
of copying it in every MD initialization routine).

Patch proposed on tech-kern:
https://mail-index.NetBSD.org/tech-kern/2017/10/19/msg022461.html

Patch tested by bouyer@:
https://mail-index.NetBSD.org/tech-kern/2017/10/20/msg022465.html

I previously discussed the issue on tech-kern before I knew of the
history around exec_map:
https://mail-index.NetBSD.org/tech-kern/2012/12/09/msg014695.html

The candidate workaround I proposed of using pool_setlowat to force
preallocation of KVA would also force preallocation of physical RAM,
which is a waste not incurred by using exec_map, and which is part of
why I never committed it.

There may remain a general problem that if thread A calls pool_get
and tries to service that request by a uvm_km_alloc call that hangs
because KVA is scarce, and thread B does pool_put, the pool_put in
thread B will not notify the pool_get in thread A that it doesn't
need to wait for KVA, and so thread A may continue to hang in
uvm_km_alloc.  However,

(a) That won't apply here, because there is exactly as much KVA
available in exec_map as exec_pool will ever try to use.

(b) It is possible that may not even matter in other cases as long as
the page daemon eventually tries to shrink the pool, which will cause
a uvm_km_free that can unhang the hung uvm_km_alloc.

XXX pullup-8
XXX pullup-7
XXX pullup-6
XXX pullup-5, perhaps...

Revision 1.447 / (download) - annotate - [select for diffs], Fri Oct 20 12:11:34 2017 UTC (5 years, 3 months ago) by martin
Branch: MAIN
Changes since 1.446: +4 -4 lines
Diff to previous 1.446 (colored)

Make check_exec() errors print the name of the binary that fails to
execute.

Revision 1.446 / (download) - annotate - [select for diffs], Fri Sep 29 17:47:29 2017 UTC (5 years, 3 months ago) by maxv
Branch: MAIN
Changes since 1.445: +2 -3 lines
Diff to previous 1.445 (colored)

Remove compat_linux32 from the autoload list and add a enable/disable
sysctl, like compat_linux.

Revision 1.445 / (download) - annotate - [select for diffs], Fri Sep 29 17:08:00 2017 UTC (5 years, 3 months ago) by maxv
Branch: MAIN
Changes since 1.444: +2 -3 lines
Diff to previous 1.444 (colored)

Remove compat_linux from the autoload list, and add a sysctl to enable or
disable it - which defaults to disabled. The following command is now
required to use linux binaries:

	sysctl -w emul.linux.enabled=1

After a discussion on tech-kern@. All the other ideas to reduce the attack
surface have drawbacks, and this sysctl seems to be the best option.

Revision 1.442.4.2 / (download) - annotate - [select for diffs], Mon Sep 11 05:13:45 2017 UTC (5 years, 4 months ago) by snj
Branch: netbsd-8
CVS Tags: matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.442.4.1: +2 -4 lines
Diff to previous 1.442.4.1 (colored) to branchpoint 1.442 (colored)

Pull up following revision(s) (requested by maxv in ticket #256):
	sys/arch/i386/conf/GENERIC: revision 1.1159 via patch
	sys/arch/i386/conf/XEN3_DOMU: revision 1.78 via patch
	sys/arch/i386/conf/XEN3_DOM0: revision 1.114 via patch
	sys/kern/kern_exec.c: 1.443-1.444 via patch
Disable svr4 and ibcs2 by default.
These options are not well-tested, of a limited use case, and the potential
for damage is too high. Vulnerabilities were presented at DEFCON 25 - I see
that at least one of them can be exploited to get ring0 privileges.
--
Remove compat_freebsd from the list of autoloaded modules. Interested users
will now have to type 'modload' to use it, or uncomment the entry in
GENERIC. I should have removed it when I disabled COMPAT_FREEBSD by
default, sorry about that.
--
Remove compat_svr4, compat_svr4_32 and compat_ibcs2 from the list of
autoloaded modules. These options are disabled everywhere (except ibcs2
on Vax, but Vax does not support kernel modules, so doesn't matter),
therefore there is no issue in removing them from the list. Interested
users will now have to do a 'modload' first, or uncomment the entries in
GENERIC.

Revision 1.442.4.1 / (download) - annotate - [select for diffs], Thu Aug 31 08:41:33 2017 UTC (5 years, 4 months ago) by bouyer
Branch: netbsd-8
Changes since 1.442: +2 -4 lines
Diff to previous 1.442 (colored)

apply paych, requested by maxv in ticket #237:
	sys/arch/amiga/conf/DRACO		patch
	sys/arch/amiga/conf/GENERIC		patch
	sys/arch/amiga/conf/GENERIC.in		patch
	sys/arch/i386/conf/ALL			patch
	sys/arch/i386/conf/GENERIC		patch
	sys/arch/i386/conf/XEN3_DOM0		patch
	sys/arch/i386/conf/XEN3_DOMU		patch
	sys/arch/sparc/conf/GENERIC		patch
	sys/arch/sparc/conf/KRUPS		patch
	sys/arch/sparc/conf/MRCOFFEE		patch
	sys/arch/sparc/conf/TADPOLE3GX		patch
	sys/arch/sparc64/conf/GENERIC		patch
	sys/arch/sparc64/conf/NONPLUS64		patch
	sys/kern/kern_exec.c			patch

Disables compat_svr4 and compat_svr4_32 on each architecture,
and removes the associated module autoload entries.

Revision 1.410.2.10 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:07 2017 UTC (5 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.410.2.9: +3 -7 lines
Diff to previous 1.410.2.9 (colored) to branchpoint 1.410 (colored) next main 1.411 (colored)

Sync with HEAD

Revision 1.444 / (download) - annotate - [select for diffs], Tue Aug 8 16:57:32 2017 UTC (5 years, 5 months ago) by maxv
Branch: MAIN
CVS Tags: nick-nhusb-base-20170825
Changes since 1.443: +2 -5 lines
Diff to previous 1.443 (colored)

Remove compat_svr4, compat_svr4_32 and compat_ibcs2 from the list of
autoloaded modules. These options are disabled everywhere (except ibcs2
on Vax, but Vax does not support kernel modules, so doesn't matter),
therefore there is no issue in removing them from the list. Interested
users will now have to do a 'modload' first, or uncomment the entries in
GENERIC.

Revision 1.443 / (download) - annotate - [select for diffs], Tue Aug 8 08:12:14 2017 UTC (5 years, 5 months ago) by maxv
Branch: MAIN
Changes since 1.442: +2 -3 lines
Diff to previous 1.442 (colored)

Remove compat_freebsd from the list of autoloaded modules. Interested users
will now have to type 'modload' to use it, or uncomment the entry in
GENERIC. I should have removed it when I disabled COMPAT_FREEBSD by
default, sorry about that.

Revision 1.435.2.4 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:26 2017 UTC (5 years, 9 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.435.2.3: +3 -3 lines
Diff to previous 1.435.2.3 (colored) to branchpoint 1.435 (colored) next main 1.436 (colored)

Sync with HEAD

Revision 1.440.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:02 2017 UTC (5 years, 9 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.440: +9 -9 lines
Diff to previous 1.440 (colored) next main 1.441 (colored)

Sync with HEAD

Revision 1.442 / (download) - annotate - [select for diffs], Fri Apr 21 15:10:34 2017 UTC (5 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, bouyer-socketcan-base1
Branch point for: netbsd-8
Changes since 1.441: +3 -3 lines
Diff to previous 1.441 (colored)

- Propagate the signal mask from the ucontext_t to the newly created thread
  as specified by _lwp_create(2)
- Reset the signal stack for threads created with _lwp_create(2)

Revision 1.435.2.3 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:47 2017 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.435.2.2: +8 -23 lines
Diff to previous 1.435.2.2 (colored) to branchpoint 1.435 (colored)

Sync with HEAD

Revision 1.410.2.9 / (download) - annotate - [select for diffs], Sun Feb 5 13:40:56 2017 UTC (5 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.410.2.8: +9 -23 lines
Diff to previous 1.410.2.8 (colored) to branchpoint 1.410 (colored)

Sync with HEAD

Revision 1.441 / (download) - annotate - [select for diffs], Wed Jan 25 17:57:14 2017 UTC (6 years ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320, nick-nhusb-base-20170204, jdolecek-ncq-base, jdolecek-ncq
Changes since 1.440: +8 -8 lines
Diff to previous 1.440 (colored)

es_arglen is already in bytes...

Revision 1.440 / (download) - annotate - [select for diffs], Mon Jan 9 00:31:30 2017 UTC (6 years ago) by kamil
Branch: MAIN
CVS Tags: bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.439: +2 -17 lines
Diff to previous 1.439 (colored)

Cleanup dead code after revert of racy vfork(2) commit

This removes dead code introduced with the following commit:

date: 2012-07-27 22:52:49 +0200;  author: christos;  state: Exp;  lines: +8 -2;
revert racy vfork() parent-blocking-before-child-execs-or-exits code.
ok rmind

Revision 1.435.2.2 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:49 2017 UTC (6 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.435.2.1: +3 -2 lines
Diff to previous 1.435.2.1 (colored) to branchpoint 1.435 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.439 / (download) - annotate - [select for diffs], Fri Jan 6 22:42:58 2017 UTC (6 years ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107
Changes since 1.438: +3 -2 lines
Diff to previous 1.438 (colored)

Introduce new SIGTRAP code: TRAP_EXEC

On exec() events under a debugger generate the SIGTRAP signal with
TRAP_EXEC property. This allows tracer to distinguish exec() events easily.

Sponsored by <The NetBSD Foundation>

Revision 1.410.2.8 / (download) - annotate - [select for diffs], Mon Dec 5 10:55:26 2016 UTC (6 years, 1 month ago) by skrll
Branch: nick-nhusb
Changes since 1.410.2.7: +3 -3 lines
Diff to previous 1.410.2.7 (colored) to branchpoint 1.410 (colored)

Sync with HEAD

Revision 1.435.2.1 / (download) - annotate - [select for diffs], Fri Nov 4 14:49:17 2016 UTC (6 years, 2 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.435: +16 -3 lines
Diff to previous 1.435 (colored)

Sync with HEAD

Revision 1.438 / (download) - annotate - [select for diffs], Thu Nov 3 22:08:30 2016 UTC (6 years, 2 months ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, nick-nhusb-base-20161204
Changes since 1.437: +3 -3 lines
Diff to previous 1.437 (colored)

Prefer modern simple past tense and past participle of catch

The "catched" form is obsolete and nonstandard, prefer "caught".

Revision 1.410.2.7 / (download) - annotate - [select for diffs], Wed Oct 5 20:56:02 2016 UTC (6 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.410.2.6: +19 -5 lines
Diff to previous 1.410.2.6 (colored) to branchpoint 1.410 (colored)

Sync with HEAD

Revision 1.437 / (download) - annotate - [select for diffs], Thu Sep 15 17:44:16 2016 UTC (6 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20161004
Changes since 1.436: +3 -3 lines
Diff to previous 1.436 (colored)

m68k binaries load @ pagesize. unbreak.

Revision 1.436 / (download) - annotate - [select for diffs], Sat Aug 6 15:13:13 2016 UTC (6 years, 5 months ago) by maxv
Branch: MAIN
CVS Tags: localcount-20160914
Changes since 1.435: +19 -5 lines
Diff to previous 1.435 (colored)

The way the kernel tries to prevent a userland process from allocating page
zero is hugely flawed. It is easy to demonstrate that one can trick UVM
into chosing a NULL hint after the user_va0_disable check from uvm_map.
Such a bypass allows kernel NULL pointer dereferences to be exploitable on
architectures with a shared userland<->kernel VA, like amd64.

Fix this by increasing the limit of the vm space made available for
userland processes. This way, UVM will never chose a NULL hint, since it
would be outside of the vm space.

The user_va0_disable sysctl still controls this feature.

Revision 1.410.2.6 / (download) - annotate - [select for diffs], Sat Jul 9 20:25:20 2016 UTC (6 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.410.2.5: +28 -8 lines
Diff to previous 1.410.2.5 (colored) to branchpoint 1.410 (colored)

Sync with HEAD

Revision 1.435 / (download) - annotate - [select for diffs], Thu Jul 7 06:55:43 2016 UTC (6 years, 6 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Changes since 1.434: +3 -3 lines
Diff to previous 1.434 (colored)

KNF. Remove extra spaces. No functional change.

Revision 1.434 / (download) - annotate - [select for diffs], Mon Jun 20 19:14:35 2016 UTC (6 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.433: +27 -7 lines
Diff to previous 1.433 (colored)

put back commented out name resolution code that was gc'ed after previous
refactoring.

Revision 1.433 / (download) - annotate - [select for diffs], Thu Jun 9 00:17:45 2016 UTC (6 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.432: +3 -3 lines
Diff to previous 1.432 (colored)

fix variable name

Revision 1.432 / (download) - annotate - [select for diffs], Wed Jun 8 23:55:24 2016 UTC (6 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.431: +3 -3 lines
Diff to previous 1.431 (colored)

ignore EACCES

Revision 1.410.2.5 / (download) - annotate - [select for diffs], Sun May 29 08:44:37 2016 UTC (6 years, 8 months ago) by skrll
Branch: nick-nhusb
Changes since 1.410.2.4: +11 -12 lines
Diff to previous 1.410.2.4 (colored) to branchpoint 1.410 (colored)

Sync with HEAD

Revision 1.431 / (download) - annotate - [select for diffs], Wed May 25 20:07:54 2016 UTC (6 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529
Changes since 1.430: +3 -3 lines
Diff to previous 1.430 (colored)

Give 0,1,2 for security.pax.mprotect.ptrace and make it default to 1
as documented in sysctl(7):
0 - ptrace does not affect mprotect
1 - (default) mprotect is disabled for processes that start executing from
    the debugger (being traced)
2 - mprotect restrictions are relaxed for traced processes

Revision 1.430 / (download) - annotate - [select for diffs], Sun May 22 14:26:09 2016 UTC (6 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.429: +3 -11 lines
Diff to previous 1.429 (colored)

reduce #ifdef mess caused by PaX

Revision 1.429 / (download) - annotate - [select for diffs], Wed May 11 02:18:27 2016 UTC (6 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.428: +3 -3 lines
Diff to previous 1.428 (colored)

Fix builds of ALL kernels that define DEBUG_EXEC

Revision 1.428 / (download) - annotate - [select for diffs], Sun May 8 20:00:21 2016 UTC (6 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.427: +9 -2 lines
Diff to previous 1.427 (colored)

Enable DEBUG_EXEC, if we have DEBUG (since it only fires on errors) and
disable the super verbose printing by protecting it against TRACE_EXEC.

Revision 1.427 / (download) - annotate - [select for diffs], Sun May 8 01:28:09 2016 UTC (6 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.426: +3 -3 lines
Diff to previous 1.426 (colored)

Move all the randomization inside kern_pax.c so we can control it directly.
Add debugging flags to be able to set the random number externally.

Revision 1.410.2.4 / (download) - annotate - [select for diffs], Fri Apr 22 15:44:16 2016 UTC (6 years, 9 months ago) by skrll
Branch: nick-nhusb
Changes since 1.410.2.3: +5 -5 lines
Diff to previous 1.410.2.3 (colored) to branchpoint 1.410 (colored)

Sync with HEAD

Revision 1.426 / (download) - annotate - [select for diffs], Mon Apr 4 23:07:06 2016 UTC (6 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20160422
Changes since 1.425: +4 -4 lines
Diff to previous 1.425 (colored)

no need to pass the coredump flag to exit1() since it is set and known
in one place.

Revision 1.425 / (download) - annotate - [select for diffs], Mon Apr 4 20:47:57 2016 UTC (6 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.424: +4 -4 lines
Diff to previous 1.424 (colored)

Split p_xstat (composite wait(2) status code, or signal number depending
on context) into:
1. p_xexit:		exit code
2. p_xsig:		signal number
3. p_sflag & WCOREFLAG	bit to indicated that the process core-dumped.

Fix the documentation of the flag bits in <sys/proc.h>

Revision 1.424 / (download) - annotate - [select for diffs], Sun Mar 20 14:58:10 2016 UTC (6 years, 10 months ago) by khorben
Branch: MAIN
Changes since 1.423: +3 -3 lines
Diff to previous 1.423 (colored)

Let PaX ASLR know about the current emulation

This effectively fixes PaX ASLR with 32-bits emulation on 64-bits
platforms. Without this knowledge, the offset applied for 32-bits
programs was really meant for a 64-bits address space - thus
shifting the address up to 12 bits, with a success rate of about
1/4096. This offset is calculated once in the lifetime of the
process, which therefore behaved normally when able to start.

Fixes kern/50469, probably also kern/50986

Tested on NetBSD/amd64 (emul_netbsd32)

Revision 1.410.2.3 / (download) - annotate - [select for diffs], Sun Dec 27 12:10:05 2015 UTC (7 years, 1 month ago) by skrll
Branch: nick-nhusb
Changes since 1.410.2.2: +56 -29 lines
Diff to previous 1.410.2.2 (colored) to branchpoint 1.410 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.423 / (download) - annotate - [select for diffs], Mon Nov 30 22:47:19 2015 UTC (7 years, 1 month ago) by pgoyette
Branch: MAIN
CVS Tags: nick-nhusb-base-20160319, nick-nhusb-base-20151226
Changes since 1.422: +10 -2 lines
Diff to previous 1.422 (colored)

Make the list of syscalls which can trigger a module autoload an
attribute of each emulation, rather than having a single global
list which applies only to the default emulation.

This changes 'struct emul' so

        Welcome to 7.99.23 !

Revision 1.422 / (download) - annotate - [select for diffs], Thu Nov 26 13:15:34 2015 UTC (7 years, 2 months ago) by martin
Branch: MAIN
Changes since 1.421: +3 -3 lines
Diff to previous 1.421 (colored)

We never exec(2) with a kernel vmspace, so do not test for that, but instead
KASSERT() that we don't.
When calculating the load address for the interpreter (e.g. ld.elf_so),
we need to take into account wether the exec'd process will run with
topdown memory or bottom up. We can not use the current vmspace's flags
to test for that, as this happens too early. Luckily the execpack already
knows what the new state will be later, so instead of testing the current
vmspace, pass the info as additional argument to struct emul
e_vm_default_addr.
Fix all such functions and adopt all callers.

Revision 1.339.2.6.2.3 / (download) - annotate - [select for diffs], Sun Nov 15 20:38:17 2015 UTC (7 years, 2 months ago) by bouyer
Branch: netbsd-6-1
Changes since 1.339.2.6.2.2: +27 -9 lines
Diff to previous 1.339.2.6.2.2 (colored) to branchpoint 1.339.2.6 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #1333):
	sys/kern/kern_exec.c: revision 1.420
	sys/kern/kern_synch.c: revision 1.309
	sys/kern/kern_exit.c: revision 1.246
	sys/kern/kern_exit.c: revision 1.247
	sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330
Pullups will be requested for NetBSD-7, -6, -6-0, and -6-1

Revision 1.339.2.5.4.4 / (download) - annotate - [select for diffs], Sun Nov 15 20:38:01 2015 UTC (7 years, 2 months ago) by bouyer
Branch: netbsd-6-0
Changes since 1.339.2.5.4.3: +27 -9 lines
Diff to previous 1.339.2.5.4.3 (colored) to branchpoint 1.339.2.5 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #1333):
	sys/kern/kern_exec.c: revision 1.420
	sys/kern/kern_synch.c: revision 1.309
	sys/kern/kern_exit.c: revision 1.246
	sys/kern/kern_exit.c: revision 1.247
	sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330
Pullups will be requested for NetBSD-7, -6, -6-0, and -6-1

Revision 1.339.2.10 / (download) - annotate - [select for diffs], Sun Nov 15 20:37:04 2015 UTC (7 years, 2 months ago) by bouyer
Branch: netbsd-6
Changes since 1.339.2.9: +27 -9 lines
Diff to previous 1.339.2.9 (colored) to branchpoint 1.339 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #1333):
	sys/kern/kern_exec.c: revision 1.420
	sys/kern/kern_synch.c: revision 1.309
	sys/kern/kern_exit.c: revision 1.246
	sys/kern/kern_exit.c: revision 1.247
	sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
Pullups will be requested for:
        NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330
Pullups will be requested for NetBSD-7, -6, -6-0, and -6-1

Revision 1.280.4.4 / (download) - annotate - [select for diffs], Sat Nov 7 20:43:23 2015 UTC (7 years, 2 months ago) by snj
Branch: netbsd-5
Changes since 1.280.4.3: +3 -3 lines
Diff to previous 1.280.4.3 (colored) to branchpoint 1.280 (colored) next main 1.281 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #1979):
	sys/kern/kern_synch.c: revision 1.309
	sys/kern/kern_exit.c: revisions 1.246, 1.247
	sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
--
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
--
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
--
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308

Revision 1.280.4.3.6.1 / (download) - annotate - [select for diffs], Sat Nov 7 20:42:59 2015 UTC (7 years, 2 months ago) by snj
Branch: netbsd-5-1
Changes since 1.280.4.3: +3 -3 lines
Diff to previous 1.280.4.3 (colored) next main 1.280.4.4 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #1979):
	sys/kern/kern_synch.c: revision 1.309
	sys/kern/kern_exit.c: revisions 1.246, 1.247
	sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
--
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
--
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
--
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308

Revision 1.280.4.3.10.1 / (download) - annotate - [select for diffs], Sat Nov 7 20:42:25 2015 UTC (7 years, 2 months ago) by snj
Branch: netbsd-5-2
Changes since 1.280.4.3: +3 -3 lines
Diff to previous 1.280.4.3 (colored) next main 1.280.4.4 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #1979):
	sys/kern/kern_synch.c: revision 1.309
	sys/kern/kern_exit.c: revisions 1.246, 1.247
	sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
--
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
--
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
--
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308

Revision 1.408.2.3.2.1 / (download) - annotate - [select for diffs], Thu Nov 5 09:05:18 2015 UTC (7 years, 2 months ago) by snj
Branch: netbsd-7-0
CVS Tags: netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Changes since 1.408.2.3: +27 -9 lines
Diff to previous 1.408.2.3 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #996):
	sys/kern/kern_exec.c: revisions 1.419, 1.420
	sys/kern/kern_exit.c: revisions 1.246, 1.247
	sys/kern/kern_synch.c: revision 1.309
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
--
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
--
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
--
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
--
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330

Revision 1.408.2.4 / (download) - annotate - [select for diffs], Thu Nov 5 09:04:55 2015 UTC (7 years, 2 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-1-RELEASE
Branch point for: netbsd-7-1
Changes since 1.408.2.3: +27 -9 lines
Diff to previous 1.408.2.3 (colored) to branchpoint 1.408 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #996):
	sys/kern/kern_exec.c: revisions 1.419, 1.420
	sys/kern/kern_exit.c: revisions 1.246, 1.247
	sys/kern/kern_synch.c: revision 1.309
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
--
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
--
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
--
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
--
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330

Revision 1.421 / (download) - annotate - [select for diffs], Thu Oct 22 11:48:02 2015 UTC (7 years, 3 months ago) by maxv
Branch: MAIN
Changes since 1.420: +8 -2 lines
Diff to previous 1.420 (colored)

Reset the PaX flags, make sure ep_emul_arg is NULL, and add a comment.

Revision 1.420 / (download) - annotate - [select for diffs], Tue Oct 13 00:29:34 2015 UTC (7 years, 3 months ago) by pgoyette
Branch: MAIN
Changes since 1.419: +26 -8 lines
Diff to previous 1.419 (colored)

In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).

If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.

This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.

Fixes PR kern/50330

Pullups will be requested for NetBSD-7, -6, -6-0, and -6-1

Revision 1.419 / (download) - annotate - [select for diffs], Tue Oct 13 00:24:35 2015 UTC (7 years, 3 months ago) by pgoyette
Branch: MAIN
Changes since 1.418: +3 -3 lines
Diff to previous 1.418 (colored)

In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.

Fixes PR kern/50298

Pullups will be requested for:

       NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2

Revision 1.418 / (download) - annotate - [select for diffs], Fri Oct 2 16:54:15 2015 UTC (7 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.417: +10 -18 lines
Diff to previous 1.417 (colored)

Change SDT (Statically Defined Tracing) probes to use link sets so that it
is easier to add probes. (From FreeBSD)

Revision 1.417 / (download) - annotate - [select for diffs], Sat Sep 26 16:12:24 2015 UTC (7 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.416: +8 -5 lines
Diff to previous 1.416 (colored)

Revamp the way processes are PaX'ed in the kernel. Sent on tech-kern@ two
months ago, but no one reviewed it - probably because it's not a trivial
change.

This change fixes the following bug: when loading a PaX'ed binary, the
kernel updates the PaX flag of the calling process before it makes sure
the new process is actually launched. If the kernel fails to launch the
new process, it does not restore the PaX flag of the calling process,
leaving it in an inconsistent state.

Actually, simply restoring it would be horrible as well, since in the
meantime another thread may have used the flag.

The solution is therefore: modify all the functions used by PaX so that
they take as argument the exec package instead of the lwp, and set the PaX
flag in the process *right before* launching the new process - it cannot
fail in the meantime.

Revision 1.410.2.2 / (download) - annotate - [select for diffs], Tue Sep 22 12:06:07 2015 UTC (7 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.410.2.1: +66 -38 lines
Diff to previous 1.410.2.1 (colored) to branchpoint 1.410 (colored)

Sync with HEAD

Revision 1.416 / (download) - annotate - [select for diffs], Sat Sep 12 18:30:46 2015 UTC (7 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921
Changes since 1.415: +3 -3 lines
Diff to previous 1.415 (colored)

gcc does not detect initialization correctly on all platforms (hpcsh)

Revision 1.415 / (download) - annotate - [select for diffs], Sat Sep 12 17:04:57 2015 UTC (7 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.414: +19 -14 lines
Diff to previous 1.414 (colored)

- preserve the error number returned from copyin.
- preserve the original pathname in ep_kname, because this is what gets passed
  to userland in exec_script.c

Revision 1.414 / (download) - annotate - [select for diffs], Fri Sep 11 01:23:37 2015 UTC (7 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.413: +53 -30 lines
Diff to previous 1.413 (colored)

On non absolute exec pathnames, prepend the working directory if
possible so that we can provide in most situations the absolute
pathname in the AUX vector so that $ORIGIN works. The following
are implementation issues:
    1. deep path execs still don't work (can't provide path to the AUX vector)
    2. the returned path is not normalized (cosmetic)

Revision 1.413 / (download) - annotate - [select for diffs], Fri Jul 31 07:37:17 2015 UTC (7 years, 5 months ago) by maxv
Branch: MAIN
Changes since 1.412: +3 -3 lines
Diff to previous 1.412 (colored)

Small changes:
 - rename pax_aslr_init() to pax_aslr_init_vm()
 - remove the PAX_ flags (unused)
 - fix a comment in pax.h

Revision 1.408.2.3 / (download) - annotate - [select for diffs], Tue Apr 14 05:12:17 2015 UTC (7 years, 9 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1
Branch point for: netbsd-7-0
Changes since 1.408.2.2: +11 -5 lines
Diff to previous 1.408.2.2 (colored) to branchpoint 1.408 (colored)

Pull up following revision(s) (requested by christos in ticket #686):
	sys/kern/kern_exec.c: revision 1.411
	sys/sys/exec.h: revision 1.147
PR/49287: Masao Uebayashi: Handle exec_script argument vector from the 32 ->
64 bit case. When execing a 64 bit shell from a 32 bit binary the argument
vector was still incorrect.

Revision 1.410.2.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:18:20 2015 UTC (7 years, 9 months ago) by skrll
Branch: nick-nhusb
Changes since 1.410: +12 -7 lines
Diff to previous 1.410 (colored)

Sync with HEAD

Revision 1.408.2.2 / (download) - annotate - [select for diffs], Sat Jan 17 12:10:55 2015 UTC (8 years ago) by martin
Branch: netbsd-7
Changes since 1.408.2.1: +2 -3 lines
Diff to previous 1.408.2.1 (colored) to branchpoint 1.408 (colored)

Pull up following revision(s) (requested by maxv in ticket #427):
	sys/compat/svr4/svr4_schedctl.c: revision 1.8
	sys/netinet/tcp_timer.c: revision 1.88
	sys/miscfs/genfs/layer_vfsops.c: revision 1.45
	sys/compat/svr4/svr4_ioctl.c: revision 1.37
	sys/ufs/chfs/chfs_vfsops.c: revision 1.14
	sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
	sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
	sys/compat/common/kern_time_50.c: revision 1.28
	sys/netinet6/ip6_forward.c: revision 1.74
	sys/miscfs/umapfs/umap_vnops.c: revision 1.57
	sys/compat/svr4/svr4_fcntl.c: revision 1.74
	distrib/sets/lists/comp/mi: revision 1.1931
	sys/netinet6/udp6_output.c: revision 1.46
	sys/fs/puffs/puffs_compat.c: revision 1.3
	sys/fs/udf/udf_rename.c: revision 1.11
	sys/compat/svr4/svr4_filio.c: revision 1.24
	sys/fs/udf/udf_rename.c: revision 1.12
	sys/netinet/tcp_usrreq.c: revision 1.202
	sys/miscfs/umapfs/umap_subr.c: revision 1.29
	sys/compat/linux/common/linux_fadvise64.c: revision 1.3
	sys/netinet/if_atm.c: revision 1.34
	sys/miscfs/procfs/procfs_subr.c: revision 1.106
	sys/miscfs/genfs/layer_subr.c: revision 1.37
	sys/netinet/tcp_sack.c: revision 1.30
	sys/compat/freebsd/freebsd_misc.c: revision 1.33
	sys/compat/freebsd/freebsd_file.c: revision 1.33
	sys/ufs/chfs/chfs_vnode.c: revision 1.12
	sys/compat/svr4/svr4_ttold.c: revision 1.34
	sys/compat/linux/common/linux_file.c: revision 1.114
	sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
	sys/compat/linux/common/linux_signal.c: revision 1.76
	sys/compat/common/compat_util.c: revision 1.46
	sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
	sys/compat/svr4/svr4_sockio.c: revision 1.36
	sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
	sys/compat/svr4/svr4_signal.c: revision 1.66
	sys/kern/kern_exec.c: revision 1.410
	sys/fs/puffs/puffs_vfsops.c: revision 1.115
	sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
	sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
	sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
	sys/compat/linux32/common/linux32_misc.c: revision 1.24
	sys/netinet/in_pcb.c: revision 1.153
	sys/sys/malloc.h: revision 1.116
	sys/compat/common/if_43.c: revision 1.9
	share/man/man9/Makefile: revision 1.380
	sys/netinet/tcp_vtw.c: revision 1.12
	sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
	sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
	sys/compat/common/uipc_syscalls_43.c: revision 1.46
	sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
	sys/fs/puffs/puffs_msgif.c: revision 1.97
	sys/compat/svr4/svr4_ipc.c: revision 1.27
	sys/compat/linux/common/linux_exec.c: revision 1.117
	sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
	sys/netinet/tcp_output.c: revision 1.179
	sys/compat/svr4/svr4_termios.c: revision 1.28
	sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
	sys/fs/puffs/puffs_subr.c: revision 1.67
	sys/fs/puffs/puffs_node.c: revision 1.36
	sys/miscfs/overlay/overlay_vnops.c: revision 1.21
	sys/fs/cd9660/cd9660_node.c: revision 1.34
	sys/netinet/raw_ip.c: revision 1.146
	sys/sys/mallocvar.h: revision 1.13
	sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
	share/man/man9/malloc.9: revision 1.50
	sys/netinet6/dest6.c: revision 1.18
	sys/compat/linux/common/linux_uselib.c: revision 1.33
	sys/compat/linux/common/linux_socket.c: revision 1.120
	share/man/man9/malloc.9: revision 1.51
	sys/netinet/tcp_subr.c: revision 1.257
	sys/compat/linux/common/linux_socketcall.c: revision 1.45
	sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
	sys/compat/freebsd/freebsd_ipc.c: revision 1.17
	sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
	sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
	sys/netinet6/in6_pcb.c: revision 1.132
	sys/netinet6/in6_ifattach.c: revision 1.94
	sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
	sys/miscfs/nullfs/null_vfsops.c: revision 1.90
	sys/fs/cd9660/cd9660_util.c: revision 1.12
	sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
	sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
	sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
	sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
	sys/compat/linux/common/linux_sched.c: revision 1.67
	sys/compat/linux/common/linux_exec_aout.c: revision 1.67
	sys/compat/linux/common/linux_pipe.c: revision 1.67
	sys/compat/linux/common/linux_llseek.c: revision 1.34
	sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
 - remove struct kmembuckets (dead)
 - correctly deadify MALLOC_XX
 - remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
 - remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
   and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.

Revision 1.412 / (download) - annotate - [select for diffs], Sun Dec 14 23:49:28 2014 UTC (8 years, 1 month ago) by chs
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606, nick-nhusb-base-20150406
Changes since 1.411: +3 -4 lines
Diff to previous 1.411 (colored)

remove ep_name, change the last reference to use ep_kname instead.

Revision 1.411 / (download) - annotate - [select for diffs], Sun Dec 14 21:35:24 2014 UTC (8 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.410: +11 -5 lines
Diff to previous 1.410 (colored)

PR/49287: Masao Uebayashi: Handle exec_script argument vector from the 32 ->
64 bit case. When execing a 64 bit shell from a 32 bit binary the argument
vector was still incorrect.

XXX: Pullup 7

Revision 1.410 / (download) - annotate - [select for diffs], Sun Nov 9 17:50:01 2014 UTC (8 years, 2 months ago) by maxv
Branch: MAIN
CVS Tags: nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.409: +2 -3 lines
Diff to previous 1.409 (colored)

Do not uselessly include <sys/malloc.h>.

Revision 1.408.2.1 / (download) - annotate - [select for diffs], Sat Oct 25 10:00:47 2014 UTC (8 years, 3 months ago) by martin
Branch: netbsd-7
Changes since 1.408: +10 -7 lines
Diff to previous 1.408 (colored)

Pull up following revision(s) (requested by dholland in ticket #156):
	sys/kern/kern_exec.c: revision 1.409
PR/49287: David Holland: Skip the right number of bytes to go over the first
argument in the argv vector. Fixes netbsd32 script execution, where you lost
the first argument because it skipped 8 bytes instead of 4.

Revision 1.409 / (download) - annotate - [select for diffs], Fri Oct 24 21:13:30 2014 UTC (8 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.408: +10 -7 lines
Diff to previous 1.408 (colored)

PR/49287: David Holland: Skip the right number of bytes to go over the first
argument in the argv vector. Fixes netbsd32 script execution, where you lost
the first argument because it skipped 8 bytes instead of 4.

Revision 1.355.2.3 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:28 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.355.2.2: +753 -580 lines
Diff to previous 1.355.2.2 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.377.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:55:58 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.377: +691 -546 lines
Diff to previous 1.377 (colored) next main 1.378 (colored)

Rebase.

Revision 1.408 / (download) - annotate - [select for diffs], Sun Jun 22 17:23:34 2014 UTC (8 years, 7 months ago) by maxv
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-base
Branch point for: netbsd-7
Changes since 1.407: +4 -4 lines
Diff to previous 1.407 (colored)

A KASSERT() is better.

Revision 1.329.2.4 / (download) - annotate - [select for diffs], Thu May 22 11:41:03 2014 UTC (8 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.329.2.3: +759 -585 lines
Diff to previous 1.329.2.3 (colored) to branchpoint 1.329 (colored) next main 1.330 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.361.2.1 / (download) - annotate - [select for diffs], Sun May 18 17:46:07 2014 UTC (8 years, 8 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.361: +755 -582 lines
Diff to previous 1.361 (colored) next main 1.362 (colored)

sync with head

Revision 1.407 / (download) - annotate - [select for diffs], Fri Apr 25 18:04:45 2014 UTC (8 years, 9 months ago) by riastradh
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base
Changes since 1.406: +3 -3 lines
Diff to previous 1.406 (colored)

Correct type of i in execve_dovmcmds.  Fixes DEBUG_EXEC build.

Revision 1.339.2.5.4.3 / (download) - annotate - [select for diffs], Mon Apr 21 10:00:35 2014 UTC (8 years, 9 months ago) by bouyer
Branch: netbsd-6-0
CVS Tags: netbsd-6-0-6-RELEASE
Changes since 1.339.2.5.4.2: +3 -2 lines
Diff to previous 1.339.2.5.4.2 (colored) to branchpoint 1.339.2.5 (colored)

Pull up following revision(s) (requested by maxv in ticket #1048):
	sys/kern/kern_exec.c: revision 1.403
'error' is not set on failure. This is a true bug: everything is freed
and unlocked while zero is returned. Since there's no error, execve_runproc()
will get called and will try to use those freed things.

Revision 1.339.2.6.2.2 / (download) - annotate - [select for diffs], Mon Apr 21 10:00:33 2014 UTC (8 years, 9 months ago) by bouyer
Branch: netbsd-6-1
CVS Tags: netbsd-6-1-5-RELEASE
Changes since 1.339.2.6.2.1: +3 -2 lines
Diff to previous 1.339.2.6.2.1 (colored) to branchpoint 1.339.2.6 (colored)

Pull up following revision(s) (requested by maxv in ticket #1048):
	sys/kern/kern_exec.c: revision 1.403
'error' is not set on failure. This is a true bug: everything is freed
and unlocked while zero is returned. Since there's no error, execve_runproc()
will get called and will try to use those freed things.

Revision 1.339.2.9 / (download) - annotate - [select for diffs], Mon Apr 21 10:00:10 2014 UTC (8 years, 9 months ago) by bouyer
Branch: netbsd-6
Changes since 1.339.2.8: +3 -2 lines
Diff to previous 1.339.2.8 (colored) to branchpoint 1.339 (colored)

Pull up following revision(s) (requested by maxv in ticket #1048):
	sys/kern/kern_exec.c: revision 1.403
'error' is not set on failure. This is a true bug: everything is freed
and unlocked while zero is returned. Since there's no error, execve_runproc()
will get called and will try to use those freed things.

Revision 1.406 / (download) - annotate - [select for diffs], Sun Apr 20 00:20:01 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.405: +62 -53 lines
Diff to previous 1.405 (colored)

execve_runproc: Isolate emul specific code into a function.

Revision 1.405 / (download) - annotate - [select for diffs], Sat Apr 19 23:00:27 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.404: +9 -10 lines
Diff to previous 1.404 (colored)

copyinargs: Shorten a local var name.

Revision 1.404 / (download) - annotate - [select for diffs], Sat Apr 19 22:59:08 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.403: +11 -3 lines
Diff to previous 1.403 (colored)

copyinargs: Plug theoretical memory leak when fakearg is too long.

Pointed out & reviewed by Maxime Villard.

Revision 1.403 / (download) - annotate - [select for diffs], Fri Apr 18 11:44:31 2014 UTC (8 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.402: +3 -2 lines
Diff to previous 1.402 (colored)

'error' is not set on failure. This is a true bug: everything is freed
and unlocked while zero is returned. Since there's no error, execve_runproc()
will get called and will try to use those freed things.

PS: This bug was here before uebayasi@'s changes

Revision 1.402 / (download) - annotate - [select for diffs], Fri Apr 18 06:59:32 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.401: +5 -8 lines
Diff to previous 1.401 (colored)

calcargs: Correct the size of "argc" in the stack size calculation.

(The old code has worked because it is compensated by wrong size calculation
of "auxinfo" (multiplied by sizeof(void *)).)

Revision 1.401 / (download) - annotate - [select for diffs], Wed Apr 16 02:22:38 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.400: +57 -46 lines
Diff to previous 1.400 (colored)

execve_runproc: Isolate vmcmd execution code into a function.

Revision 1.400 / (download) - annotate - [select for diffs], Wed Apr 16 01:30:33 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.399: +53 -48 lines
Diff to previous 1.399 (colored)

execve_runproc: Isolate path / commandname (proc:p_comm) related code into a function.

Revision 1.399 / (download) - annotate - [select for diffs], Tue Apr 15 17:06:21 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.398: +44 -29 lines
Diff to previous 1.398 (colored)

execve_runproc: Isolate new stack arg filling code into a function.

Revision 1.398 / (download) - annotate - [select for diffs], Tue Apr 15 16:44:57 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.397: +35 -22 lines
Diff to previous 1.397 (colored)

execve_runproc: Isolate ps_strings filling code into a function.

Revision 1.397 / (download) - annotate - [select for diffs], Tue Apr 15 16:13:04 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.396: +6 -22 lines
Diff to previous 1.396 (colored)

execve_runproc: Simplify &argc address calc.  The set of (argc, argv, ...)
is located just "behind" the initial SP.  SHRINK, then ALLOC, and you get
&argc.

Revision 1.396 / (download) - annotate - [select for diffs], Tue Apr 15 15:50:16 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.395: +58 -40 lines
Diff to previous 1.395 (colored)

exec_loadvm: Isolate stack size calc logic into separate functions.

Revision 1.395 / (download) - annotate - [select for diffs], Mon Apr 14 13:14:38 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.394: +1 -1 lines
Diff to previous 1.394 (colored)

copyinargs: Redo previous; if given fakearg is longer than arg buf (which is
very unlikely to happen), there's no point to continue with truncated arg.
Just give up and return E2BIG.

Revision 1.394 / (download) - annotate - [select for diffs], Mon Apr 14 05:39:19 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.393: +11 -10 lines
Diff to previous 1.393 (colored)

copyinargs: Replace a hand-written string copy loop with strlcpy(3).  Carefully
reuse return value of strlcpy(3) to iterate.

Revision 1.393 / (download) - annotate - [select for diffs], Sun Apr 13 12:11:01 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.392: +0 -12 lines
Diff to previous 1.392 (colored)

Revert braces.

Revision 1.392 / (download) - annotate - [select for diffs], Sun Apr 13 09:19:42 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.391: +53 -41 lines
Diff to previous 1.391 (colored)

copyinargs: Refactor.  Share code.

Revision 1.391 / (download) - annotate - [select for diffs], Sun Apr 13 06:03:49 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.390: +111 -89 lines
Diff to previous 1.390 (colored)

execve_loadvm: Move long code block reading passed arguments() into a function.
This needs further clean up.  (See the XXX comment.)  No functional changes.

Revision 1.390 / (download) - annotate - [select for diffs], Sat Apr 12 15:08:56 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.389: +14 -7 lines
Diff to previous 1.389 (colored)

execve_runproc: Correct thinko in Rev. 1.386; the new SP always points to
after (higher adderss) argc/argv/env/aux/strings regardless of stack growing
direction .  Machines with grow-up stack will detect the top of
argc/argv/env/aux/strings by the address of *argv[] via ps_strings:ps_argvstr.

This means that old comments about RTLD_GAP are all obsolete.

With help from Nick Hudson.

Revision 1.389 / (download) - annotate - [select for diffs], Sat Apr 12 07:38:32 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.388: +0 -1 lines
Diff to previous 1.388 (colored)

Don't #define DEBUG_EXEC.

Revision 1.388 / (download) - annotate - [select for diffs], Sat Apr 12 07:33:51 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.387: +39 -46 lines
Diff to previous 1.387 (colored)

execve_runproc: Refactor debug code.

Revision 1.387 / (download) - annotate - [select for diffs], Sat Apr 12 06:31:27 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.386: +91 -77 lines
Diff to previous 1.386 (colored)

execve_runproc: Move a long code block handling credential into a separate
function.  No functional changes.

Revision 1.386 / (download) - annotate - [select for diffs], Sat Apr 12 05:25:23 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.385: +48 -47 lines
Diff to previous 1.385 (colored)

execve_runproc: Unbreak __MACHINE_STACK_GROWS_UP machines.  Clarify the stack
address allocation code.  Summarize an awful big comment about the _rtld()
"gap".

(The log message in Rev. 1.384 was wrong; the new stack address is passed
not via the 3rd register argument, but via the SP.  The 3rd is for ps_strings.)

Revision 1.385 / (download) - annotate - [select for diffs], Fri Apr 11 18:02:33 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.384: +9 -5 lines
Diff to previous 1.384 (colored)

Reorder a new lines.  Comments.

Revision 1.384 / (download) - annotate - [select for diffs], Fri Apr 11 17:28:24 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.383: +9 -3 lines
Diff to previous 1.383 (colored)

execve_runproc: The stack address passed to the newly execve()'ed process,
via the 3rd register argument, always points to the stack base address (==
minsaddr (min stack address) + ssize (stack size)).  Clarify that.

Revision 1.383 / (download) - annotate - [select for diffs], Fri Apr 11 17:06:02 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.382: +41 -25 lines
Diff to previous 1.382 (colored)

execve_runproc: Reorder a few local vars.  Avoid reuse.  No functional changes.

Revision 1.382 / (download) - annotate - [select for diffs], Fri Apr 11 11:49:38 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.381: +17 -3 lines
Diff to previous 1.381 (colored)

Clarify stack size calculation in copyargs().  Comments.

Revision 1.381 / (download) - annotate - [select for diffs], Fri Apr 11 11:32:14 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.380: +6 -16 lines
Diff to previous 1.380 (colored)

Clean up assertions.

Revision 1.380 / (download) - annotate - [select for diffs], Fri Apr 11 11:21:29 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.379: +1 -3 lines
Diff to previous 1.379 (colored)

Protect not only proc::p_flag but also lwp::l_ctxlink and proc::p_acflag with
proc:p_lock.

Revision 1.379 / (download) - annotate - [select for diffs], Fri Apr 11 11:11:06 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.378: +51 -33 lines
Diff to previous 1.378 (colored)

Try to decrypt stack size calculation code in execve_loadvm().

No functional changes.  Two potential miscalculations remain.

Revision 1.378 / (download) - annotate - [select for diffs], Fri Apr 11 02:27:20 2014 UTC (8 years, 9 months ago) by uebayasi
Branch: MAIN
Changes since 1.377: +124 -122 lines
Diff to previous 1.377 (colored)

Cache struct exec_package * for readability.  No functional changes.

Revision 1.339.2.8 / (download) - annotate - [select for diffs], Tue Mar 18 08:17:56 2014 UTC (8 years, 10 months ago) by msaitoh
Branch: netbsd-6
Changes since 1.339.2.7: +6 -2 lines
Diff to previous 1.339.2.7 (colored) to branchpoint 1.339 (colored)

Pull up following revision(s) (requested by manu in ticket #1026):
	share/man/man4/options.4: revision 1.433
	sys/kern/kern_exec.c: revision 1.371- 1.372
Add EMUL_NATIVEROOT so that native binaries can be told to search an
"emulation" directory before the real root. This makes easier to test
an amd64 kernel on the top of an i386 root filesystem prior a full
migration.

Revision 1.377 / (download) - annotate - [select for diffs], Wed Feb 19 15:23:20 2014 UTC (8 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.376: +3 -4 lines
Diff to previous 1.376 (colored)

We need VMCMDs for a binary and its interpreter, so make sure we have
at least one VMCMD. This also prevents the kernel from using an
uninitialized pointer as entry point for the execution.

From me and Christos

ok christos@

Revision 1.376 / (download) - annotate - [select for diffs], Mon Feb 17 19:29:46 2014 UTC (8 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.375: +15 -15 lines
Diff to previous 1.375 (colored)

Cosmetic; just replace whitespaces by tabs

Revision 1.375 / (download) - annotate - [select for diffs], Fri Feb 14 16:35:40 2014 UTC (8 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.374: +12 -2 lines
Diff to previous 1.374 (colored)

explain why the innocent sigaction1 call now works.

Revision 1.339.2.6.2.1 / (download) - annotate - [select for diffs], Mon Feb 3 11:57:24 2014 UTC (8 years, 11 months ago) by sborrill
Branch: netbsd-6-1
CVS Tags: netbsd-6-1-4-RELEASE
Changes since 1.339.2.6: +14 -4 lines
Diff to previous 1.339.2.6 (colored)

Pull up the following revisions(s) (requested by martin in ticket #1023):
	lib/libc/gen/posix_spawn.3:			revision 1.5
	lib/libc/gen/posix_spawn_file_actions_addopen.3:	revision 1.4
	lib/libc/gen/posix_spawn_file_actions_init.3:	revision 1.4
	lib/libc/gen/posix_spawn_fileactions.c:		revision 1.3
	sys/compat/netbsd32/netbsd32_execve.c:		revision 1.38
	sys/kern/kern_exec.c:				revision 1.373

Limit the amount of kernel memory a posix_spawn syscall can use (for
handling the file action list) by limiting the maximum number of file
actions to twice the current file descriptor limit. Fix a few bugs in
the support functions and document the new limit. From Maxime Villard.

Revision 1.339.2.5.4.2 / (download) - annotate - [select for diffs], Mon Feb 3 11:56:20 2014 UTC (8 years, 11 months ago) by sborrill
Branch: netbsd-6-0
CVS Tags: netbsd-6-0-5-RELEASE
Changes since 1.339.2.5.4.1: +14 -4 lines
Diff to previous 1.339.2.5.4.1 (colored) to branchpoint 1.339.2.5 (colored)

Pull up the following revisions(s) (requested by martin in ticket #1023):
	lib/libc/gen/posix_spawn.3:			revision 1.5
	lib/libc/gen/posix_spawn_file_actions_addopen.3:	revision 1.4
	lib/libc/gen/posix_spawn_file_actions_init.3:	revision 1.4
	lib/libc/gen/posix_spawn_fileactions.c:		revision 1.3
	sys/compat/netbsd32/netbsd32_execve.c:		revision 1.38
	sys/kern/kern_exec.c:				revision 1.373

Limit the amount of kernel memory a posix_spawn syscall can use (for
handling the file action list) by limiting the maximum number of file
actions to twice the current file descriptor limit. Fix a few bugs in
the support functions and document the new limit. From Maxime Villard.

Revision 1.339.2.7 / (download) - annotate - [select for diffs], Mon Feb 3 11:54:02 2014 UTC (8 years, 11 months ago) by sborrill
Branch: netbsd-6
Changes since 1.339.2.6: +14 -4 lines
Diff to previous 1.339.2.6 (colored) to branchpoint 1.339 (colored)

Pull up the following revisions(s) (requested by martin in ticket #1023):
	lib/libc/gen/posix_spawn.3:			revision 1.5
	lib/libc/gen/posix_spawn_file_actions_addopen.3:	revision 1.4
	lib/libc/gen/posix_spawn_file_actions_init.3:	revision 1.4
	lib/libc/gen/posix_spawn_fileactions.c:		revision 1.3
	sys/compat/netbsd32/netbsd32_execve.c:		revision 1.38
	sys/kern/kern_exec.c:				revision 1.373

Limit the amount of kernel memory a posix_spawn syscall can use (for
handling the file action list) by limiting the maximum number of file
actions to twice the current file descriptor limit. Fix a few bugs in
the support functions and document the new limit. From Maxime Villard.

Revision 1.374 / (download) - annotate - [select for diffs], Sun Feb 2 14:50:46 2014 UTC (8 years, 11 months ago) by martin
Branch: MAIN
Changes since 1.373: +7 -7 lines
Diff to previous 1.373 (colored)

Cosmetics: return is an operator, not a function: remove ().

Revision 1.373 / (download) - annotate - [select for diffs], Sun Feb 2 14:48:57 2014 UTC (8 years, 11 months ago) by martin
Branch: MAIN
Changes since 1.372: +14 -4 lines
Diff to previous 1.372 (colored)

Limit the amount of kernel memory a posix_spawn syscall can use (for handling
the file action list) by limiting the maximum number of file actions to
twice the current file descriptor limit.
Fix a few bugs in the support functions and document the new limit.
From Maxime Villard.

Revision 1.372 / (download) - annotate - [select for diffs], Sun Feb 2 08:25:23 2014 UTC (8 years, 11 months ago) by dogcow
Branch: MAIN
Changes since 1.371: +2 -3 lines
Diff to previous 1.371 (colored)

Delete duplicate symbol definition introduced in 1.371. Now builds again.

Revision 1.371 / (download) - annotate - [select for diffs], Sun Feb 2 04:28:42 2014 UTC (8 years, 11 months ago) by manu
Branch: MAIN
Changes since 1.370: +7 -2 lines
Diff to previous 1.370 (colored)

Add EMUL_NATIVEROOT so that native binaries can be told to search an
"emulation" directory before the real root. This makes easier to test
an amd64 kernel on the top of an i386 root filesystem prior a full
migration.

Revision 1.370 / (download) - annotate - [select for diffs], Sat Jan 25 19:44:11 2014 UTC (9 years ago) by christos
Branch: MAIN
Changes since 1.369: +3 -3 lines
Diff to previous 1.369 (colored)

__USING_TOPDOWN_VM is no more, __USE_TOPDOWN_VM...

Revision 1.369 / (download) - annotate - [select for diffs], Fri Jan 3 15:49:49 2014 UTC (9 years ago) by christos
Branch: MAIN
Changes since 1.368: +8 -14 lines
Diff to previous 1.368 (colored)

Simplify error path and fix typos. From Maxime Villard and me.

Revision 1.368 / (download) - annotate - [select for diffs], Tue Dec 24 14:47:04 2013 UTC (9 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.367: +5 -8 lines
Diff to previous 1.367 (colored)

replace strcpy with copystr and remove useless strcpy (Maxime Villard)

Revision 1.367 / (download) - annotate - [select for diffs], Sat Nov 23 22:15:16 2013 UTC (9 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.366: +7 -6 lines
Diff to previous 1.366 (colored)

Explain where this will fail.

Revision 1.366 / (download) - annotate - [select for diffs], Fri Nov 22 21:04:11 2013 UTC (9 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.365: +3 -3 lines
Diff to previous 1.365 (colored)

convert vmem, signals, powerhooks from CIRCLEQ -> TAILQ.

Revision 1.365 / (download) - annotate - [select for diffs], Thu Nov 14 16:53:51 2013 UTC (9 years, 2 months ago) by martin
Branch: MAIN
Changes since 1.364: +2 -3 lines
Diff to previous 1.364 (colored)

oops, remove accidently commited debug code

Revision 1.364 / (download) - annotate - [select for diffs], Thu Nov 14 12:07:11 2013 UTC (9 years, 2 months ago) by martin
Branch: MAIN
Changes since 1.363: +16 -4 lines
Diff to previous 1.363 (colored)

As discussed on tech-kern: make TOPDOWN-VM runtime selectable per process
(offer MD code or emulations to override it).

Revision 1.363 / (download) - annotate - [select for diffs], Thu Sep 12 19:01:38 2013 UTC (9 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.362: +3 -3 lines
Diff to previous 1.362 (colored)

What's the point of having a module exec class if exec is not using it?

Revision 1.362 / (download) - annotate - [select for diffs], Tue Sep 10 21:30:21 2013 UTC (9 years, 4 months ago) by matt
Branch: MAIN
Changes since 1.361: +4 -2 lines
Diff to previous 1.361 (colored)

Support an optional MARCH ELF tag.
Store the MACHINE_ARCH of the executable in mdproc and override sysctl
so that value returned.

Revision 1.355.2.2 / (download) - annotate - [select for diffs], Sun Jun 23 06:18:57 2013 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.355.2.1: +6 -5 lines
Diff to previous 1.355.2.1 (colored)

resync from head

Revision 1.361 / (download) - annotate - [select for diffs], Sun Jun 9 01:13:47 2013 UTC (9 years, 7 months ago) by riz
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.360: +5 -5 lines
Diff to previous 1.360 (colored)

Add another field to the SDT_PROBE_DEFINE macro, so our DTrace probes
can named the same as those on other platforms.

For example, proc:::exec-success, not proc:::exec_success.

Implementation follows the same basic principle as FreeBSD's; add
another field to the SDT_PROBE_DEFINE macro which is the name
as exposed to userland.

Revision 1.360 / (download) - annotate - [select for diffs], Sat Apr 20 22:28:58 2013 UTC (9 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: khorben-n900
Changes since 1.359: +3 -6 lines
Diff to previous 1.359 (colored)

revert previous, you can run on mips 64 bit binaries with a 32 bit kernel.

Revision 1.359 / (download) - annotate - [select for diffs], Sat Apr 20 18:04:41 2013 UTC (9 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.358: +6 -2 lines
Diff to previous 1.358 (colored)

don't attempt to load elf64 on 32 bit machines

Revision 1.329.2.3 / (download) - annotate - [select for diffs], Wed Jan 16 05:33:43 2013 UTC (10 years ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.329.2.2: +5 -2 lines
Diff to previous 1.329.2.2 (colored) to branchpoint 1.329 (colored)

sync with (a bit old) head

Revision 1.339.2.5.4.1 / (download) - annotate - [select for diffs], Tue Nov 20 21:32:57 2012 UTC (10 years, 2 months ago) by riz
Branch: netbsd-6-0
CVS Tags: netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE
Changes since 1.339.2.5: +5 -2 lines
Diff to previous 1.339.2.5 (colored)

Pull up following revision(s) (requested by christos in ticket #670):
	sys/kern/kern_exec.c: revision 1.358
If you are going to dick around with p_stat, remember to put it
back so that spawn processes with attributes don't end up starting
up stopped!
XXX: pullup to 6.

Revision 1.339.2.6 / (download) - annotate - [select for diffs], Tue Nov 20 21:32:24 2012 UTC (10 years, 2 months ago) by riz
Branch: netbsd-6
CVS Tags: netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE
Branch point for: netbsd-6-1
Changes since 1.339.2.5: +5 -2 lines
Diff to previous 1.339.2.5 (colored) to branchpoint 1.339 (colored)

Pull up following revision(s) (requested by christos in ticket #670):
	sys/kern/kern_exec.c: revision 1.358
If you are going to dick around with p_stat, remember to put it
back so that spawn processes with attributes don't end up starting
up stopped!
XXX: pullup to 6.

Revision 1.355.2.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:02:42 2012 UTC (10 years, 2 months ago) by tls
Branch: tls-maxphys
Changes since 1.355: +5 -2 lines
Diff to previous 1.355 (colored)

Resync to 2012-11-19 00:00:00 UTC

Revision 1.358 / (download) - annotate - [select for diffs], Thu Nov 8 17:40:46 2012 UTC (10 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, agc-symver-base, agc-symver
Changes since 1.357: +5 -2 lines
Diff to previous 1.357 (colored)

If you are going to dick around with p_stat, remember to put it
back so that spawn processes with attributes don't end up starting
up stopped!
XXX: pullup to 6.

Revision 1.329.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:22:28 2012 UTC (10 years, 2 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.329.2.1: +18 -3 lines
Diff to previous 1.329.2.1 (colored) to branchpoint 1.329 (colored)

sync with head

Revision 1.357 / (download) - annotate - [select for diffs], Sun Oct 14 20:56:55 2012 UTC (10 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base6
Changes since 1.356: +0 -26 lines
Diff to previous 1.356 (colored)

remove KERN_USRSTACK

Revision 1.356 / (download) - annotate - [select for diffs], Sat Oct 13 15:35:55 2012 UTC (10 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.355: +28 -2 lines
Diff to previous 1.355 (colored)

add KERN_USRSTACK (this is not dynamically defined for FreeBSD compatibility)

Revision 1.355 / (download) - annotate - [select for diffs], Wed Aug 29 18:56:39 2012 UTC (10 years, 5 months ago) by dholland
Branch: MAIN
Branch point for: tls-maxphys
Changes since 1.354: +3 -3 lines
Diff to previous 1.354 (colored)

Add missing newline to printf (in the disabled code for $ORIGIN).

Revision 1.354 / (download) - annotate - [select for diffs], Fri Jul 27 20:52:49 2012 UTC (10 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.353: +10 -2 lines
Diff to previous 1.353 (colored)

revert racy vfork() parent-blocking-before-child-execs-or-exits code.
ok rmind

Revision 1.353 / (download) - annotate - [select for diffs], Sun Jul 22 22:40:19 2012 UTC (10 years, 6 months ago) by rmind
Branch: MAIN
Changes since 1.352: +10 -3 lines
Diff to previous 1.352 (colored)

fork1: fix use-after-free problems.  Addresses PR/46128 from Andrew Doran.
Note: PL_PPWAIT should be fully replaced and modificaiton of l_pflag by
other LWP is undesirable, but this is enough for netbsd-6.

Revision 1.352 / (download) - annotate - [select for diffs], Wed May 2 23:33:11 2012 UTC (10 years, 8 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base5, jmcneill-usbmp-base10
Changes since 1.351: +173 -139 lines
Diff to previous 1.351 (colored)

Revert posix_spawn() clean up for now, there are some bugs.

Revision 1.351 / (download) - annotate - [select for diffs], Mon Apr 30 21:19:58 2012 UTC (10 years, 8 months ago) by rmind
Branch: MAIN
Changes since 1.350: +139 -173 lines
Diff to previous 1.350 (colored)

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.

Revision 1.332.2.5 / (download) - annotate - [select for diffs], Sun Apr 29 23:05:04 2012 UTC (10 years, 9 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.332.2.4: +270 -134 lines
Diff to previous 1.332.2.4 (colored) to branchpoint 1.332 (colored) next main 1.333 (colored)

sync to latest -current.

Revision 1.329.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:08:23 2012 UTC (10 years, 9 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.329: +1059 -263 lines
Diff to previous 1.329 (colored)

sync with head

Revision 1.339.2.5 / (download) - annotate - [select for diffs], Mon Apr 16 15:28:19 2012 UTC (10 years, 9 months ago) by riz
Branch: netbsd-6
CVS Tags: netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Branch point for: netbsd-6-0
Changes since 1.339.2.4: +11 -3 lines
Diff to previous 1.339.2.4 (colored) to branchpoint 1.339 (colored)

Pull up following revision(s) (requested by martin in ticket #181):
	sys/kern/kern_exec.c: revision 1.350
Fix leak in a posix_spawn error path, from Greg Oster.

Revision 1.350 / (download) - annotate - [select for diffs], Sun Apr 15 15:35:00 2012 UTC (10 years, 9 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pagecache-base4, jmcneill-usbmp-base9
Changes since 1.349: +11 -3 lines
Diff to previous 1.349 (colored)

Fix leak in a posix_spawn error path, from Greg Oster.

Revision 1.339.2.4 / (download) - annotate - [select for diffs], Thu Apr 12 17:05:36 2012 UTC (10 years, 9 months ago) by riz
Branch: netbsd-6
Changes since 1.339.2.3: +262 -134 lines
Diff to previous 1.339.2.3 (colored) to branchpoint 1.339 (colored)

Pull up following revision(s) (requested by martin in ticket #175):
	sys/kern/kern_exit.c: revision 1.238
	tests/lib/libc/gen/posix_spawn/t_fileactions.c: revision 1.4
	tests/lib/libc/gen/posix_spawn/t_fileactions.c: revision 1.5
	sys/uvm/uvm_extern.h: revision 1.183
	lib/libc/gen/posix_spawn_fileactions.c: revision 1.2
	sys/kern/kern_exec.c: revision 1.348
	sys/kern/kern_exec.c: revision 1.349
	sys/compat/netbsd32/syscalls.master: revision 1.95
	sys/uvm/uvm_glue.c: revision 1.159
	sys/uvm/uvm_map.c: revision 1.317
	sys/compat/netbsd32/netbsd32.h: revision 1.95
	sys/kern/exec_elf.c: revision 1.38
	sys/sys/spawn.h: revision 1.2
	sys/sys/exec.h: revision 1.135
	sys/compat/netbsd32/netbsd32_execve.c: revision 1.34
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
Fix asynchronous posix_spawn child exit status (and test for it).

Revision 1.349 / (download) - annotate - [select for diffs], Mon Apr 9 19:42:06 2012 UTC (10 years, 9 months ago) by martin
Branch: MAIN
Changes since 1.348: +3 -3 lines
Diff to previous 1.348 (colored)

Fix asynchronous posix_spawn child exit status (and test for it).

Revision 1.348 / (download) - annotate - [select for diffs], Sun Apr 8 11:27:44 2012 UTC (10 years, 9 months ago) by martin
Branch: MAIN
Changes since 1.347: +262 -134 lines
Diff to previous 1.347 (colored)

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

Revision 1.332.2.4 / (download) - annotate - [select for diffs], Thu Apr 5 21:33:38 2012 UTC (10 years, 9 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.332.2.3: +12 -5 lines
Diff to previous 1.332.2.3 (colored) to branchpoint 1.332 (colored)

sync to latest -current.

Revision 1.347 / (download) - annotate - [select for diffs], Tue Mar 13 18:40:52 2012 UTC (10 years, 10 months ago) by elad
Branch: MAIN
CVS Tags: jmcneill-usbmp-base8
Changes since 1.346: +14 -7 lines
Diff to previous 1.346 (colored)

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.

Revision 1.332.2.3 / (download) - annotate - [select for diffs], Sun Mar 11 01:52:29 2012 UTC (10 years, 10 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.332.2.2: +10 -4 lines
Diff to previous 1.332.2.2 (colored) to branchpoint 1.332 (colored)

sync to latest -current

Revision 1.339.2.3 / (download) - annotate - [select for diffs], Sat Mar 10 16:49:01 2012 UTC (10 years, 10 months ago) by riz
Branch: netbsd-6
Changes since 1.339.2.2: +12 -6 lines
Diff to previous 1.339.2.2 (colored) to branchpoint 1.339 (colored)

Pull up following revision(s) (requested by martin in ticket #107):
	sys/kern/kern_exec.c: revision 1.345
	sys/kern/kern_exec.c: revision 1.346
Make sure the child of a posix_spawn operation is not preempted during
the times when it does not have any vm_space.
Should fix PR kern/46153.
Remove a KPREEMPT_ENABLE() in an error path I overlooked in the previous
change - pointed out by Manuel Bouyer.
While there, add a KASSERT() to make sure we have preemption enabled in
the success case.

Revision 1.346 / (download) - annotate - [select for diffs], Sat Mar 10 14:35:05 2012 UTC (10 years, 10 months ago) by martin
Branch: MAIN
CVS Tags: jmcneill-usbmp-base7
Changes since 1.345: +4 -3 lines
Diff to previous 1.345 (colored)

Remove a KPREEMPT_ENABLE() in an error path I overlooked in the previous
change - pointed out by Manuel Bouyer.
While there, add a KASSERT() to make sure we have preemption enabled in
the success case.

Revision 1.345 / (download) - annotate - [select for diffs], Sat Mar 10 08:46:45 2012 UTC (10 years, 10 months ago) by martin
Branch: MAIN
Changes since 1.344: +10 -5 lines
Diff to previous 1.344 (colored)

Make sure the child of a posix_spawn operation is not preempted during
the times when it does not have any vm_space.
Should fix PR kern/46153.

Revision 1.332.2.2 / (download) - annotate - [select for diffs], Fri Feb 24 09:11:45 2012 UTC (10 years, 11 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.332.2.1: +113 -114 lines
Diff to previous 1.332.2.1 (colored) to branchpoint 1.332 (colored)

sync to -current.

Revision 1.339.2.2 / (download) - annotate - [select for diffs], Wed Feb 22 18:43:35 2012 UTC (10 years, 11 months ago) by riz
Branch: netbsd-6
Changes since 1.339.2.1: +83 -81 lines
Diff to previous 1.339.2.1 (colored) to branchpoint 1.339 (colored)

Pull up following revision(s) (requested by martin in ticket #17):
	sys/kern/kern_exec.c: revision 1.342
	sys/kern/kern_exec.c: revision 1.343
	sys/kern/kern_exec.c: revision 1.344
Posix spawn fixes:
- split the file actions allocation and freeing into separate functions
- use pnbuf
- don't play games with pointers (partially freeing stuff etc), only check
  fa and sa and free as needed using the same code.
- use copyinstr properly
- KM_SLEEP allocation can't fail
- if path allocation failed midway, we would be possibily freeing
  userland strings.
- use sizeof(*var) instead sizeof(type)
fix fae free'ing, from enami.
keep track of the original array length so we can pass it to kmem_free, from
enami

Revision 1.344 / (download) - annotate - [select for diffs], Tue Feb 21 04:13:22 2012 UTC (10 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3
Changes since 1.343: +11 -14 lines
Diff to previous 1.343 (colored)

keep track of the original array length so we can pass it to kmem_free, from
enami

Revision 1.343 / (download) - annotate - [select for diffs], Tue Feb 21 03:44:54 2012 UTC (10 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.342: +4 -3 lines
Diff to previous 1.342 (colored)

fix fae free'ing, from enami.

Revision 1.339.2.1 / (download) - annotate - [select for diffs], Mon Feb 20 21:54:56 2012 UTC (10 years, 11 months ago) by sborrill
Branch: netbsd-6
Changes since 1.339: +82 -46 lines
Diff to previous 1.339 (colored)

Pull up the following revisions(s) (requested by martin in ticket #14):
	include/spawn.h:		revision 1.2
	sys/kern/kern_exec.c:		revision 1.341
	sys/uvm/uvm_glue.c:		revision 1.157
	tests/lib/libc/gen/posix_spawn/t_fileactions.c:	revision 1.3

posix_spawn: fix kernel bug when passing empty fileactions (PR kern/46038)
and add a test case for this.  Fix potential race condition, doublefreeing
of memory and memory leaks in error cases.

Revision 1.342 / (download) - annotate - [select for diffs], Mon Feb 20 18:18:30 2012 UTC (10 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.341: +85 -81 lines
Diff to previous 1.341 (colored)

Posix spawn fixes:
- split the file actions allocation and freeing into separate functions
- use pnbuf
- don't play games with pointers (partially freeing stuff etc), only check
  fa and sa and free as needed using the same code.
- use copyinstr properly
- KM_SLEEP allocation can't fail
- if path allocation failed midway, we would be possibily freeing
  userland strings.
- use sizeof(*var) instead sizeof(type)

Revision 1.341 / (download) - annotate - [select for diffs], Mon Feb 20 12:19:55 2012 UTC (10 years, 11 months ago) by martin
Branch: MAIN
Changes since 1.340: +82 -46 lines
Diff to previous 1.340 (colored)

More posix_spawn fallout:
Fix a kmem_alloc() call with zero size (PR kern/46038), allow file actions
to be passed, even if empty.
Rearange p_reflock locking for the child, avoid a double free in an
error case, avoid a memory leak in another error case - all pointed out
by yamt.
During blocking operations early in the child borrow the kernel vmspace
(as suggested by yamt).

Revision 1.340 / (download) - annotate - [select for diffs], Sun Feb 19 21:06:49 2012 UTC (10 years, 11 months ago) by rmind
Branch: MAIN
Changes since 1.339: +3 -42 lines
Diff to previous 1.339 (colored)

Remove COMPAT_SA / KERN_SA.  Welcome to 6.99.3!
Approved by core@.

Revision 1.332.2.1 / (download) - annotate - [select for diffs], Sat Feb 18 07:35:28 2012 UTC (10 years, 11 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.332: +856 -217 lines
Diff to previous 1.332 (colored)

merge to -current.

Revision 1.339 / (download) - annotate - [select for diffs], Sun Feb 12 20:11:03 2012 UTC (10 years, 11 months ago) by martin
Branch: MAIN
CVS Tags: netbsd-6-base, jmcneill-usbmp-base2
Branch point for: netbsd-6
Changes since 1.338: +3 -3 lines
Diff to previous 1.338 (colored)

Fix SDT_PROBE macro argument overlooked in argument renaming, noted by <chs>

Revision 1.338 / (download) - annotate - [select for diffs], Sun Feb 12 13:14:37 2012 UTC (10 years, 11 months ago) by martin
Branch: MAIN
Changes since 1.337: +10 -2 lines
Diff to previous 1.337 (colored)

Minor tweaks to posix_spawn error handling.
The standard allows "open" file actions for descriptors that are alreay
open, add support for that.

Revision 1.337 / (download) - annotate - [select for diffs], Sat Feb 11 23:16:17 2012 UTC (10 years, 11 months ago) by martin
Branch: MAIN
Changes since 1.336: +830 -209 lines
Diff to previous 1.336 (colored)

Add a posix_spawn syscall, as discussed on tech-kern.
Based on the summer of code project by Charles Zhang, heavily reworked
later by me - all bugs are likely mine.
Ok: core, releng.

Revision 1.336 / (download) - annotate - [select for diffs], Fri Feb 3 20:11:54 2012 UTC (10 years, 11 months ago) by matt
Branch: MAIN
Changes since 1.335: +17 -4 lines
Diff to previous 1.335 (colored)

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.

Revision 1.335 / (download) - annotate - [select for diffs], Wed Jan 25 18:26:26 2012 UTC (11 years ago) by christos
Branch: MAIN
Changes since 1.334: +3 -3 lines
Diff to previous 1.334 (colored)

Add a macro to align the length of the stack, not the pointer itself, since
we always want the alignment to grow the length.

Revision 1.334 / (download) - annotate - [select for diffs], Tue Jan 24 20:03:36 2012 UTC (11 years ago) by christos
Branch: MAIN
Changes since 1.333: +4 -7 lines
Diff to previous 1.333 (colored)

Use and define ALIGN() ALIGN_POINTER() and STACK_ALIGN() consistently,
and avoid definining them in 10 different places if not needed.

Revision 1.333 / (download) - annotate - [select for diffs], Sun Dec 4 15:12:07 2011 UTC (11 years, 1 month ago) by dholland
Branch: MAIN
Changes since 1.332: +4 -4 lines
Diff to previous 1.332 (colored)

Revert Christos's accidental changes.

Revision 1.332 / (download) - annotate - [select for diffs], Thu Nov 24 19:55:22 2011 UTC (11 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: jmcneill-usbmp-pre-base2, jmcneill-usbmp-base
Branch point for: jmcneill-usbmp
Changes since 1.331: +6 -5 lines
Diff to previous 1.331 (colored)

fix incomplete statement.

Revision 1.331 / (download) - annotate - [select for diffs], Thu Nov 24 17:09:14 2011 UTC (11 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.330: +14 -7 lines
Diff to previous 1.330 (colored)

make the diagnostic messages more informative.

Revision 1.330 / (download) - annotate - [select for diffs], Sat Nov 19 22:51:25 2011 UTC (11 years, 2 months ago) by tls
Branch: MAIN
Changes since 1.329: +4 -3 lines
Diff to previous 1.329 (colored)

First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>.  This change includes
the following:

	An initial cleanup and minor reorganization of the entropy pool
	code in sys/dev/rnd.c and sys/dev/rndpool.c.  Several bugs are
	fixed.  Some effort is made to accumulate entropy more quickly at
	boot time.

	A generic interface, "rndsink", is added, for stream generators to
	request that they be re-keyed with good quality entropy from the pool
	as soon as it is available.

	The arc4random()/arc4randbytes() implementation in libkern is
	adjusted to use the rndsink interface for rekeying, which helps
	address the problem of low-quality keys at boot time.

	An implementation of the FIPS 140-2 statistical tests for random
	number generator quality is provided (libkern/rngtest.c).  This
	is based on Greg Rose's implementation from Qualcomm.

	A new random stream generator, nist_ctr_drbg, is provided.  It is
	based on an implementation of the NIST SP800-90 CTR_DRBG by
	Henric Jungheim.  This generator users AES in a modified counter
	mode to generate a backtracking-resistant random stream.

	An abstraction layer, "cprng", is provided for in-kernel consumers
	of randomness.  The arc4random/arc4randbytes API is deprecated for
	in-kernel use.  It is replaced by "cprng_strong".  The current
	cprng_fast implementation wraps the existing arc4random
	implementation.  The current cprng_strong implementation wraps the
	new CTR_DRBG implementation.  Both interfaces are rekeyed from
	the entropy pool automatically at intervals justifiable from best
	current cryptographic practice.

	In some quick tests, cprng_fast() is about the same speed as
	the old arc4randbytes(), and cprng_strong() is about 20% faster
	than rnd_extract_data().  Performance is expected to improve.

	The AES code in src/crypto/rijndael is no longer an optional
	kernel component, as it is required by cprng_strong, which is
	not an optional kernel component.

	The entropy pool output is subjected to the rngtest tests at
	startup time; if it fails, the system will reboot.  There is
	approximately a 3/10000 chance of a false positive from these
	tests.  Entropy pool _input_ from hardware random numbers is
	subjected to the rngtest tests at attach time, as well as the
	FIPS continuous-output test, to detect bad or stuck hardware
	RNGs; if any are detected, they are detached, but the system
	continues to run.

	A problem with rndctl(8) is fixed -- datastructures with
	pointers in arrays are no longer passed to userspace (this
	was not a security problem, but rather a major issue for
	compat32).  A new kernel will require a new rndctl.

	The sysctl kern.arandom() and kern.urandom() nodes are hooked
	up to the new generators, but the /dev/*random pseudodevices
	are not, yet.

	Manual pages for the new kernel interfaces are forthcoming.

Revision 1.329 / (download) - annotate - [select for diffs], Fri Sep 16 21:02:28 2011 UTC (11 years, 4 months ago) by reinoud
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache
Changes since 1.328: +8 -6 lines
Diff to previous 1.328 (colored)

Improve diagnostics message on entry point too low/high checking

Revision 1.328 / (download) - annotate - [select for diffs], Sat Aug 27 18:11:48 2011 UTC (11 years, 5 months ago) by reinoud
Branch: MAIN
Changes since 1.327: +4 -4 lines
Diff to previous 1.327 (colored)

Also fix DPRINTF()'s for DEBUG_EXEC

Revision 1.327 / (download) - annotate - [select for diffs], Sat Aug 27 18:07:10 2011 UTC (11 years, 5 months ago) by reinoud
Branch: MAIN
Changes since 1.326: +10 -10 lines
Diff to previous 1.326 (colored)

Fix DPRINTF()'s missing the extra parenteses

Revision 1.326 / (download) - annotate - [select for diffs], Sat Aug 27 17:51:38 2011 UTC (11 years, 5 months ago) by reinoud
Branch: MAIN
Changes since 1.325: +32 -5 lines
Diff to previous 1.325 (colored)

Enhance EXEC_DEBUG by also printing the UVM commands

Revision 1.325 / (download) - annotate - [select for diffs], Fri Aug 26 19:07:13 2011 UTC (11 years, 5 months ago) by jmcneill
Branch: MAIN
Changes since 1.324: +3 -2 lines
Diff to previous 1.324 (colored)

defflag DEBUG_EXEC

Revision 1.324 / (download) - annotate - [select for diffs], Fri Aug 26 12:52:01 2011 UTC (11 years, 5 months ago) by jmcneill
Branch: MAIN
Changes since 1.323: +3 -3 lines
Diff to previous 1.323 (colored)

Fix a typo in r1.243: test for STACKALIGN not STACKLALIGN:

"If STACKALIGN is defined, use it instead of ALIGN.  Some arches need a
 stack more aligned that ALIGN will give."

Revision 1.323 / (download) - annotate - [select for diffs], Fri Aug 26 09:29:16 2011 UTC (11 years, 5 months ago) by reinoud
Branch: MAIN
Changes since 1.322: +10 -12 lines
Diff to previous 1.322 (colored)

Provide a better fix for the checks

Revision 1.322 / (download) - annotate - [select for diffs], Fri Aug 26 09:13:08 2011 UTC (11 years, 5 months ago) by reinoud
Branch: MAIN
Changes since 1.321: +11 -5 lines
Diff to previous 1.321 (colored)

Change aprint_verbose() to a normal printf() surrounded by #ifdef DIAGNOSTIC

Revision 1.321 / (download) - annotate - [select for diffs], Fri Aug 26 09:07:48 2011 UTC (11 years, 5 months ago) by reinoud
Branch: MAIN
Changes since 1.320: +3 -3 lines
Diff to previous 1.320 (colored)

Fix check for VM_MIN_ADDRESS since it doesn't need to be a constant

Revision 1.320 / (download) - annotate - [select for diffs], Fri Aug 26 06:56:11 2011 UTC (11 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.319: +4 -2 lines
Diff to previous 1.319 (colored)

fix compilation for VM_MIN_ADDRESS == 0

Revision 1.319 / (download) - annotate - [select for diffs], Thu Aug 25 19:54:30 2011 UTC (11 years, 5 months ago) by reinoud
Branch: MAIN
Changes since 1.318: +3 -3 lines
Diff to previous 1.318 (colored)

Move debug -> verbose

Revision 1.318 / (download) - annotate - [select for diffs], Thu Aug 25 19:14:07 2011 UTC (11 years, 5 months ago) by reinoud
Branch: MAIN
Changes since 1.317: +14 -3 lines
Diff to previous 1.317 (colored)

On a verbose kernel boot show why executables are denied due to their start
adresses. This will hardly ever occure in real-life.

Revision 1.317 / (download) - annotate - [select for diffs], Mon Aug 8 12:08:53 2011 UTC (11 years, 5 months ago) by manu
Branch: MAIN
Changes since 1.316: +15 -2 lines
Diff to previous 1.316 (colored)

First stage of support for Extended API set 2. Most of the think is
unimplemented, except enough of linkat(2) to hardlink to a symlink.

Everything new in headers is guarded #ifdef _INCOMPLETE_XOPEN_C063 since
some software (e.g.: xcvs in our own tree) will assume they can use openat(2)
when AT_FDCWD is defined. _INCOMPLETE_XOPEN_C063 will go away once support
will be completed.

Revision 1.314.2.1 / (download) - annotate - [select for diffs], Thu Jun 23 14:20:18 2011 UTC (11 years, 7 months ago) by cherry
Branch: cherry-xenmp
Changes since 1.314: +9 -2 lines
Diff to previous 1.314 (colored) next main 1.315 (colored)

Catchup with rmind-uvmplock merge.

Revision 1.294.2.6 / (download) - annotate - [select for diffs], Sun Jun 12 00:24:28 2011 UTC (11 years, 7 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.294.2.5: +7 -0 lines
Diff to previous 1.294.2.5 (colored) to branchpoint 1.294 (colored) next main 1.295 (colored)

sync with head

Revision 1.316 / (download) - annotate - [select for diffs], Mon Jun 6 22:04:34 2011 UTC (11 years, 7 months ago) by matt
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base
Changes since 1.315: +5 -2 lines
Diff to previous 1.315 (colored)

Add some more MI hook points for PCU.  Discard the PCU state at lwp_exit and
at exec time.  Before forking, save the PCU state so that cpu_lwp_fork
doesn't have.  Remove MD code which did that before.

Revision 1.304.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:09:27 2011 UTC (11 years, 7 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.304: +109 -52 lines
Diff to previous 1.304 (colored) next main 1.305 (colored)

Sync with HEAD.

Revision 1.315 / (download) - annotate - [select for diffs], Wed Jun 1 21:24:59 2011 UTC (11 years, 7 months ago) by alnsn
Branch: MAIN
Changes since 1.314: +6 -2 lines
Diff to previous 1.314 (colored)

kern/42030 - tracking of file descriptors by ktrace/kdump

Revision 1.294.2.5 / (download) - annotate - [select for diffs], Tue May 31 03:05:01 2011 UTC (11 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.294.2.4: +0 -1 lines
Diff to previous 1.294.2.4 (colored) to branchpoint 1.294 (colored)

sync with head

Revision 1.280.4.3.4.3 / (download) - annotate - [select for diffs], Fri Apr 29 08:20:14 2011 UTC (11 years, 9 months ago) by matt
Branch: matt-nb5-mips64
Changes since 1.280.4.3.4.2: +5 -2 lines
Diff to previous 1.280.4.3.4.2 (colored) to branchpoint 1.280.4.3 (colored) next main 1.280.4.4 (colored)

Pull in lwp_setprivate/cpu_lwp_setprivate from -current.
Also pull in lwp_getpcb

Revision 1.314 / (download) - annotate - [select for diffs], Tue Apr 26 16:36:42 2011 UTC (11 years, 9 months ago) by joerg
Branch: MAIN
CVS Tags: cherry-xenmp-base
Branch point for: cherry-xenmp
Changes since 1.313: +2 -3 lines
Diff to previous 1.313 (colored)

Remove IRIX emulation

Revision 1.294.2.4 / (download) - annotate - [select for diffs], Thu Apr 21 01:42:07 2011 UTC (11 years, 9 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.294.2.3: +39 -28 lines
Diff to previous 1.294.2.3 (colored) to branchpoint 1.294 (colored)

sync with head

Revision 1.232.2.2.6.2 / (download) - annotate - [select for diffs], Sun Mar 20 20:52:01 2011 UTC (11 years, 10 months ago) by bouyer
Branch: netbsd-4-0
Changes since 1.232.2.2.6.1: +25 -3 lines
Diff to previous 1.232.2.2.6.1 (colored) to branchpoint 1.232.2.2 (colored) next main 1.232.2.3 (colored)

Pull up following revision(s) (requested by spz in ticket #1421):
	sys/kern/kern_exec.c: revision 1.269 via patch
Check for number of processes resource violation in execve().

Revision 1.232.2.4 / (download) - annotate - [select for diffs], Sun Mar 20 20:51:52 2011 UTC (11 years, 10 months ago) by bouyer
Branch: netbsd-4
Changes since 1.232.2.3: +25 -3 lines
Diff to previous 1.232.2.3 (colored) to branchpoint 1.232 (colored) next main 1.233 (colored)

Pull up following revision(s) (requested by spz in ticket #1421):
	sys/kern/kern_exec.c: revision 1.269 via patch
Check for number of processes resource violation in execve().

Revision 1.313 / (download) - annotate - [select for diffs], Mon Mar 14 20:12:40 2011 UTC (11 years, 10 months ago) by jakllsch
Branch: MAIN
Changes since 1.312: +5 -5 lines
Diff to previous 1.312 (colored)

Make debugging code compile.

Revision 1.312 / (download) - annotate - [select for diffs], Sun Mar 13 23:44:14 2011 UTC (11 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.311: +41 -30 lines
Diff to previous 1.311 (colored)

fix debugging printfs.

Revision 1.294.2.3 / (download) - annotate - [select for diffs], Sat Mar 5 20:55:14 2011 UTC (11 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.294.2.2: +107 -62 lines
Diff to previous 1.294.2.2 (colored) to branchpoint 1.294 (colored)

sync with head

Revision 1.305.2.2 / (download) - annotate - [select for diffs], Sat Mar 5 15:10:38 2011 UTC (11 years, 10 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.305.2.1: +44 -24 lines
Diff to previous 1.305.2.1 (colored) next main 1.306 (colored)

Sync with HEAD

Revision 1.311 / (download) - annotate - [select for diffs], Fri Mar 4 22:25:31 2011 UTC (11 years, 10 months ago) by joerg
Branch: MAIN
CVS Tags: bouyer-quota2-nbase
Changes since 1.310: +28 -21 lines
Diff to previous 1.310 (colored)

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

Revision 1.310 / (download) - annotate - [select for diffs], Fri Mar 4 04:17:12 2011 UTC (11 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.309: +14 -5 lines
Diff to previous 1.309 (colored)

better debugging messages.

Revision 1.309 / (download) - annotate - [select for diffs], Tue Mar 1 18:53:10 2011 UTC (11 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.308: +5 -2 lines
Diff to previous 1.308 (colored)

Ensure that the LWP private area has a consistent value after exec.

Revision 1.308 / (download) - annotate - [select for diffs], Mon Feb 21 20:23:29 2011 UTC (11 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.307: +3 -2 lines
Diff to previous 1.307 (colored)

Borrow the lwpctl data area from the parent for the vfork() child.
Otherwise the child will incorrectly see it is not running on any
CPU.  Among other things, this fixes crashes from having
LD_PRELOAD=libpthread.so set in the env.

reviewed by tech-kern

Revision 1.305.2.1 / (download) - annotate - [select for diffs], Thu Feb 17 12:00:44 2011 UTC (11 years, 11 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.305: +3 -2 lines
Diff to previous 1.305 (colored)

Sync with HEAD

Revision 1.307 / (download) - annotate - [select for diffs], Tue Feb 15 16:49:54 2011 UTC (11 years, 11 months ago) by pooka
Branch: MAIN
CVS Tags: bouyer-quota2-base
Changes since 1.306: +3 -3 lines
Diff to previous 1.306 (colored)

fix snafu

Revision 1.306 / (download) - annotate - [select for diffs], Tue Feb 15 15:54:28 2011 UTC (11 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.305: +3 -2 lines
Diff to previous 1.305 (colored)

Support FD_CLOEXEC in rump kernels.

Revision 1.305 / (download) - annotate - [select for diffs], Tue Jan 18 08:21:03 2011 UTC (12 years ago) by matt
Branch: MAIN
Branch point for: bouyer-quota2
Changes since 1.304: +37 -15 lines
Diff to previous 1.304 (colored)

Add more detailed debug printfs (one for each error case).

Revision 1.304 / (download) - annotate - [select for diffs], Sat Dec 18 01:36:19 2010 UTC (12 years, 1 month ago) by rmind
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr
Changes since 1.303: +4 -2 lines
Diff to previous 1.303 (colored)

- Fix a few possible locking issues in execve1() and exit1().  Add a note
  that scheduler locks are special in this regard - adaptive locks cannot
  be in the path due to turnstiles.  Randomly spotted/reported by uebayasi@.
- Remove unused lwp_relock() and replace lwp_lock_retry() by simplifying
  lwp_lock() and sleepq_enter() a little.
- Give alllwp its own cache-line and mark lwp_cache pointer as read-mostly.

OK ad@

Revision 1.303 / (download) - annotate - [select for diffs], Tue Nov 30 10:43:05 2010 UTC (12 years, 1 month ago) by dholland
Branch: MAIN
Changes since 1.302: +3 -3 lines
Diff to previous 1.302 (colored)

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.

Revision 1.302 / (download) - annotate - [select for diffs], Tue Nov 30 10:30:02 2010 UTC (12 years, 1 month ago) by dholland
Branch: MAIN
Changes since 1.301: +4 -6 lines
Diff to previous 1.301 (colored)

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.

Revision 1.301 / (download) - annotate - [select for diffs], Fri Nov 19 06:44:42 2010 UTC (12 years, 2 months ago) by dholland
Branch: MAIN
Changes since 1.300: +19 -17 lines
Diff to previous 1.300 (colored)

Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.

Revision 1.293.2.3 / (download) - annotate - [select for diffs], Fri Oct 22 07:22:26 2010 UTC (12 years, 3 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.293.2.2: +0 -4 lines
Diff to previous 1.293.2.2 (colored) to branchpoint 1.293 (colored) next main 1.294 (colored)

Sync with HEAD (-D20101022).

Revision 1.272.2.6 / (download) - annotate - [select for diffs], Sat Oct 9 03:32:31 2010 UTC (12 years, 3 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.272.2.5: +2 -6 lines
Diff to previous 1.272.2.5 (colored) to branchpoint 1.272 (colored) next main 1.273 (colored)

sync with head

Revision 1.300 / (download) - annotate - [select for diffs], Sat Aug 21 13:19:39 2010 UTC (12 years, 5 months ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, uebayasi-xip-base4, uebayasi-xip-base3
Changes since 1.299: +2 -6 lines
Diff to previous 1.299 (colored)

Update the rest of the kernel to conform to the module subsystem's new
locking protocol.

Revision 1.280.4.3.4.2 / (download) - annotate - [select for diffs], Thu Aug 19 07:23:24 2010 UTC (12 years, 5 months ago) by matt
Branch: matt-nb5-mips64
CVS Tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Changes since 1.280.4.3.4.1: +34 -12 lines
Diff to previous 1.280.4.3.4.1 (colored) to branchpoint 1.280.4.3 (colored)

Add some more debug printfs for various failures.

Revision 1.293.2.2 / (download) - annotate - [select for diffs], Tue Aug 17 06:47:26 2010 UTC (12 years, 5 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.293.2.1: +53 -31 lines
Diff to previous 1.293.2.1 (colored) to branchpoint 1.293 (colored)

Sync with HEAD.

Revision 1.272.2.5 / (download) - annotate - [select for diffs], Wed Aug 11 22:54:38 2010 UTC (12 years, 5 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.272.2.4: +55 -33 lines
Diff to previous 1.272.2.4 (colored) to branchpoint 1.272 (colored)

sync with head.

Revision 1.299 / (download) - annotate - [select for diffs], Wed Jul 7 01:30:37 2010 UTC (12 years, 6 months ago) by chs
Branch: MAIN
CVS Tags: yamt-nfs-mp-base10, uebayasi-xip-base2
Changes since 1.298: +10 -6 lines
Diff to previous 1.298 (colored)

many changes for COMPAT_LINUX:
 - update the linux syscall table for each platform.
 - support new-style (NPTL) linux pthreads on all platforms.
   clone() with CLONE_THREAD uses 1 process with many LWPs
   instead of separate processes.
 - move the contents of sys__lwp_setprivate() into a new
   lwp_setprivate() and use that everywhere.
 - update linux_release[] and linux32_release[] to "2.6.18".
 - adjust placement of emul fork/exec/exit hooks as needed
   and adjust other emul code to match.
 - convert all struct emul definitions to use named initializers.
 - change the pid allocator to allow multiple pids to refer to the same proc.
 - remove a few fields from struct proc that are no longer needed.
 - disable the non-functional "vdso" code in linux32/amd64,
   glibc works fine without it.
 - fix a race in the futex code where we could miss a wakeup after
   a requeue operation.
 - redo futex locking to be a little more efficient.

Revision 1.294.2.2 / (download) - annotate - [select for diffs], Sat Jul 3 01:19:53 2010 UTC (12 years, 6 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.294.2.1: +3 -3 lines
Diff to previous 1.294.2.1 (colored) to branchpoint 1.294 (colored)

sync with head

Revision 1.298 / (download) - annotate - [select for diffs], Thu Jun 24 13:03:11 2010 UTC (12 years, 7 months ago) by hannken
Branch: MAIN
Changes since 1.297: +3 -3 lines
Diff to previous 1.297 (colored)

Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.

Revision 1.294.2.1 / (download) - annotate - [select for diffs], Sun May 30 05:17:56 2010 UTC (12 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.294: +46 -28 lines
Diff to previous 1.294 (colored)

sync with head

Revision 1.297 / (download) - annotate - [select for diffs], Wed May 12 03:40:38 2010 UTC (12 years, 8 months ago) by rmind
Branch: MAIN
Changes since 1.296: +7 -5 lines
Diff to previous 1.296 (colored)

execve1: move few PNBUF_PUT() outside the lock paths.

Revision 1.296 / (download) - annotate - [select for diffs], Sun May 2 23:22:51 2010 UTC (12 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.295: +4 -4 lines
Diff to previous 1.295 (colored)

Blanking the path buffer only needs to be done when DIAGNOSTIC.
(I meant to set it back this way before committing but evidently forgot
last night. Thanks to rmind for noticing.)

Revision 1.295 / (download) - annotate - [select for diffs], Sun May 2 05:30:20 2010 UTC (12 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.294: +42 -26 lines
Diff to previous 1.294 (colored)

Remove the nameidata from struct exec_package. It was used only for two
things: passing an argument to check_exec, which is better done explicitly,
and handing back the resolved pathname generated by namei, which we can
make an explicit slot for in struct exec_package instead. While here,
perform some related tidyup, and store the kernel-side copy of the path
to the executable as well as the pointer into userspace. (But the latter
should probably be removed in the future.)

Revision 1.293.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:44:09 2010 UTC (12 years, 9 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.293: +25 -2 lines
Diff to previous 1.293 (colored)

Sync with HEAD.

Revision 1.280.4.3.4.1 / (download) - annotate - [select for diffs], Wed Apr 21 00:28:16 2010 UTC (12 years, 9 months ago) by matt
Branch: matt-nb5-mips64
Changes since 1.280.4.3: +7 -5 lines
Diff to previous 1.280.4.3 (colored)

sync to netbsd-5

Revision 1.272.2.4 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:16 2010 UTC (12 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.272.2.3: +59 -37 lines
Diff to previous 1.272.2.3 (colored) to branchpoint 1.272 (colored)

sync with head

Revision 1.294 / (download) - annotate - [select for diffs], Mon Mar 1 21:10:15 2010 UTC (12 years, 10 months ago) by darran
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base1
Branch point for: rmind-uvmplock
Changes since 1.293: +25 -2 lines
Diff to previous 1.293 (colored)

DTrace: Add an SDT (Statically Defined Tracing) provider framework, and
implement most of the proc provider.  Adds proc:::create, exec,
exec_success, exec_faillure, signal_send, signal_discard, signal_handle,
lwp_create, lwp_start, lwp_exit.

Revision 1.293 / (download) - annotate - [select for diffs], Fri Jan 8 11:35:10 2010 UTC (13 years ago) by pooka
Branch: MAIN
CVS Tags: uebayasi-xip-base
Branch point for: uebayasi-xip
Changes since 1.292: +3 -3 lines
Diff to previous 1.292 (colored)

The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change

Revision 1.292 / (download) - annotate - [select for diffs], Thu Dec 10 14:13:54 2009 UTC (13 years, 1 month ago) by matt
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.291: +4 -4 lines
Diff to previous 1.291 (colored)

Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds).  Should result in no code differences.

Revision 1.291 / (download) - annotate - [select for diffs], Sun Oct 25 01:14:03 2009 UTC (13 years, 3 months ago) by rmind
Branch: MAIN
CVS Tags: jym-xensuspend-nbase
Changes since 1.290: +33 -34 lines
Diff to previous 1.290 (colored)

Initialise struct emul members by name (it is readable now and one can search
them in the tree).

Revision 1.232.2.3 / (download) - annotate - [select for diffs], Sat Sep 5 13:45:43 2009 UTC (13 years, 4 months ago) by bouyer
Branch: netbsd-4
Changes since 1.232.2.2: +7 -3 lines
Diff to previous 1.232.2.2 (colored) to branchpoint 1.232 (colored)

Pull up following revision(s) (requested by dsl in ticket #1352):
	sys/kern/kern_exec.c: patch
Fix ktrace of data from iovec based system calls.
Fixes PR/41819

Revision 1.232.2.2.6.1 / (download) - annotate - [select for diffs], Sat Sep 5 13:45:28 2009 UTC (13 years, 4 months ago) by bouyer
Branch: netbsd-4-0
Changes since 1.232.2.2: +7 -3 lines
Diff to previous 1.232.2.2 (colored)

Pull up following revision(s) (requested by dsl in ticket #1352):
	sys/kern/kern_exec.c: patch
Fix ktrace of data from iovec based system calls.
Fixes PR/41819

Revision 1.272.2.3 / (download) - annotate - [select for diffs], Wed Aug 19 18:48:16 2009 UTC (13 years, 5 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.272.2.2: +3 -2 lines
Diff to previous 1.272.2.2 (colored) to branchpoint 1.272 (colored)

sync with head.

Revision 1.290 / (download) - annotate - [select for diffs], Thu Aug 6 21:33:54 2009 UTC (13 years, 5 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7
Changes since 1.289: +3 -2 lines
Diff to previous 1.289 (colored)

ktrace the arguments to script interpreters that come from the script.
Fixes PR/33021

Revision 1.284.2.2 / (download) - annotate - [select for diffs], Thu Jul 23 23:32:34 2009 UTC (13 years, 6 months ago) by jym
Branch: jym-xensuspend
Changes since 1.284.2.1: +3 -6 lines
Diff to previous 1.284.2.1 (colored) to branchpoint 1.284 (colored) next main 1.285 (colored)

Sync with HEAD.

Revision 1.272.2.2 / (download) - annotate - [select for diffs], Sat Jun 20 07:20:31 2009 UTC (13 years, 7 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.272.2.1: +3 -6 lines
Diff to previous 1.272.2.1 (colored) to branchpoint 1.272 (colored)

sync with head

Revision 1.289 / (download) - annotate - [select for diffs], Tue Jun 2 23:21:38 2009 UTC (13 years, 7 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base6, yamt-nfs-mp-base5, jymxensuspend-base
Changes since 1.288: +3 -6 lines
Diff to previous 1.288 (colored)

Declare extern syscallnames in a header.

Revision 1.284.2.1 / (download) - annotate - [select for diffs], Wed May 13 17:21:56 2009 UTC (13 years, 8 months ago) by jym
Branch: jym-xensuspend
Changes since 1.284: +7 -5 lines
Diff to previous 1.284 (colored)

Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.272.2.1 / (download) - annotate - [select for diffs], Mon May 4 08:13:46 2009 UTC (13 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.272: +293 -362 lines
Diff to previous 1.272 (colored)

sync with head.

Revision 1.280.2.3 / (download) - annotate - [select for diffs], Tue Apr 28 07:36:59 2009 UTC (13 years, 9 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.280.2.2: +6 -5 lines
Diff to previous 1.280.2.2 (colored) to branchpoint 1.280 (colored) next main 1.281 (colored)

Sync with HEAD.

Revision 1.280.4.3 / (download) - annotate - [select for diffs], Wed Apr 1 21:03:04 2009 UTC (13 years, 9 months ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b
Branch point for: netbsd-5-2, netbsd-5-1, matt-nb5-mips64
Changes since 1.280.4.2: +5 -5 lines
Diff to previous 1.280.4.2 (colored) to branchpoint 1.280 (colored)

Pull up following revision(s) (requested by christos in ticket #573):
	sys/kern/kern_exec.c: revision 1.286
don't enforce maxproc resource limits for root.

Revision 1.280.4.2 / (download) - annotate - [select for diffs], Wed Apr 1 00:25:22 2009 UTC (13 years, 9 months ago) by snj
Branch: netbsd-5
Changes since 1.280.4.1: +3 -2 lines
Diff to previous 1.280.4.1 (colored) to branchpoint 1.280 (colored)

Pull up following revision(s) (requested by mrg in ticket #622):
	bin/csh/csh.1: revision 1.46
	bin/csh/func.c: revision 1.37
	bin/ps/print.c: revision 1.111
	bin/ps/ps.c: revision 1.74
	bin/sh/miscbltin.c: revision 1.38
	bin/sh/sh.1: revision 1.92 via patch
	external/bsd/top/dist/machine/m_netbsd.c: revision 1.7
	lib/libkvm/kvm_proc.c: revision 1.82
	sys/arch/mips/mips/cpu_exec.c: revision 1.55
	sys/compat/darwin/darwin_exec.c: revision 1.57
	sys/compat/ibcs2/ibcs2_exec.c: revision 1.73
	sys/compat/irix/irix_resource.c: revision 1.15
	sys/compat/linux/arch/amd64/linux_exec_machdep.c: revision 1.16
	sys/compat/linux/arch/i386/linux_exec_machdep.c: revision 1.12
	sys/compat/linux/common/linux_limit.h: revision 1.5
	sys/compat/osf1/osf1_resource.c: revision 1.14
	sys/compat/svr4/svr4_resource.c: revision 1.18
	sys/compat/svr4_32/svr4_32_resource.c: revision 1.17
	sys/kern/exec_subr.c: revision 1.62
	sys/kern/init_sysctl.c: revision 1.160
	sys/kern/kern_exec.c: revision 1.288
	sys/kern/kern_resource.c: revision 1.151
	sys/sys/param.h: patch
	sys/sys/resource.h: revision 1.31
	sys/sys/sysctl.h: revision 1.184
	sys/uvm/uvm_extern.h: revision 1.153
	sys/uvm/uvm_glue.c: revision 1.136
	sys/uvm/uvm_mmap.c: revision 1.128
	usr.bin/systat/ps.c: revision 1.32
- - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes.  this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.
- - adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.
- - add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)
- - patch sh, and csh to notice RLIMIT_AS.  (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)
- - patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.
- - update irix, svr4, svr4_32, linux and osf1 emulations to support
this information.  (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)
this addresses PR 7897.  it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.
tested on i386 and sparc64, build tested on several other platforms.
thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)

Revision 1.288 / (download) - annotate - [select for diffs], Sun Mar 29 01:02:50 2009 UTC (13 years, 10 months ago) by mrg
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jym-xensuspend-base
Changes since 1.287: +3 -2 lines
Diff to previous 1.287 (colored)

- add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes.  this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS.  (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information.  (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897.  it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)

Revision 1.287 / (download) - annotate - [select for diffs], Tue Mar 24 21:00:05 2009 UTC (13 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.286: +5 -5 lines
Diff to previous 1.286 (colored)

use kauth instead of uid != 0

Revision 1.286 / (download) - annotate - [select for diffs], Sat Mar 7 19:23:02 2009 UTC (13 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.285: +5 -5 lines
Diff to previous 1.285 (colored)

don't enforce maxproc resource limits for root.

Revision 1.280.2.2 / (download) - annotate - [select for diffs], Tue Mar 3 18:32:55 2009 UTC (13 years, 10 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.280.2.1: +3 -2 lines
Diff to previous 1.280.2.1 (colored) to branchpoint 1.280 (colored)

Sync with HEAD.

Revision 1.285 / (download) - annotate - [select for diffs], Fri Feb 13 22:41:04 2009 UTC (13 years, 11 months ago) by apb
Branch: MAIN
CVS Tags: nick-hppapmap-base2
Changes since 1.284: +3 -2 lines
Diff to previous 1.284 (colored)

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.

Revision 1.280.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:19:38 2009 UTC (14 years ago) by skrll
Branch: nick-hppapmap
Changes since 1.280: +179 -340 lines
Diff to previous 1.280 (colored)

Sync with HEAD.

Revision 1.268.6.6 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:18 2009 UTC (14 years ago) by mjf
Branch: mjf-devfs2
Changes since 1.268.6.5: +216 -339 lines
Diff to previous 1.268.6.5 (colored) to branchpoint 1.268 (colored) next main 1.269 (colored)

Sync with HEAD.

Revision 1.284 / (download) - annotate - [select for diffs], Wed Dec 17 20:51:36 2008 UTC (14 years, 1 month ago) by cegger
Branch: MAIN
CVS Tags: mjf-devfs2-base
Branch point for: jym-xensuspend
Changes since 1.283: +3 -3 lines
Diff to previous 1.283 (colored)

kill MALLOC and FREE macros.

Revision 1.277.2.2 / (download) - annotate - [select for diffs], Sat Dec 13 01:15:08 2008 UTC (14 years, 1 month ago) by haad
Branch: haad-dm
Changes since 1.277.2.1: +184 -343 lines
Diff to previous 1.277.2.1 (colored) to branchpoint 1.277 (colored) next main 1.278 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.283 / (download) - annotate - [select for diffs], Fri Nov 28 10:55:10 2008 UTC (14 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Changes since 1.282: +8 -4 lines
Diff to previous 1.282 (colored)

exec_add, exec_remove: allow zero entries in case a module provides nothing.

Revision 1.282 / (download) - annotate - [select for diffs], Wed Nov 19 18:36:06 2008 UTC (14 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.281: +175 -288 lines
Diff to previous 1.281 (colored)

Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime

Revision 1.280.4.1 / (download) - annotate - [select for diffs], Tue Nov 18 17:11:52 2008 UTC (14 years, 2 months ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1
Changes since 1.280: +4 -11 lines
Diff to previous 1.280 (colored)

Apply patch (requested by ad in ticket #83):
Expose exec_lock for the changes in ticket #75.

Revision 1.281 / (download) - annotate - [select for diffs], Wed Nov 12 12:36:16 2008 UTC (14 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.280: +2 -54 lines
Diff to previous 1.280 (colored)

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.

Revision 1.280 / (download) - annotate - [select for diffs], Tue Oct 21 20:52:11 2008 UTC (14 years, 3 months ago) by matt
Branch: MAIN
CVS Tags: netbsd-5-base, matt-mips64-base2
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.279: +8 -6 lines
Diff to previous 1.279 (colored)

Only define/use saemul_netbsd if KERN_SA is defined.  (maybe this should be
moved to compat_sa.c)

Revision 1.277.2.1 / (download) - annotate - [select for diffs], Sun Oct 19 22:17:27 2008 UTC (14 years, 3 months ago) by haad
Branch: haad-dm
Changes since 1.277: +40 -4 lines
Diff to previous 1.277 (colored)

Sync with HEAD.

Revision 1.279 / (download) - annotate - [select for diffs], Wed Oct 15 06:51:20 2008 UTC (14 years, 3 months ago) by wrstuden
Branch: MAIN
CVS Tags: haad-dm-base1
Changes since 1.278: +39 -3 lines
Diff to previous 1.278 (colored)

Merge wrstuden-revivesa into HEAD.

Revision 1.278 / (download) - annotate - [select for diffs], Sat Oct 11 13:40:57 2008 UTC (14 years, 3 months ago) by pooka
Branch: MAIN
Changes since 1.277: +3 -3 lines
Diff to previous 1.277 (colored)

Move uidinfo to its own module in kern_uidinfo.c and include in rump.
No functional change to uidinfo.

Revision 1.272.4.7 / (download) - annotate - [select for diffs], Thu Sep 18 04:31:42 2008 UTC (14 years, 4 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.272.4.6: +70 -18 lines
Diff to previous 1.272.4.6 (colored) to branchpoint 1.272 (colored) next main 1.273 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.272.4.6 / (download) - annotate - [select for diffs], Mon Jul 21 19:13:45 2008 UTC (14 years, 6 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.272.4.5: +9 -2 lines
Diff to previous 1.272.4.5 (colored) to branchpoint 1.272 (colored)

Add support for compiling SA as an option. Implied by COMPAT_40.

i386 kernels both with COMPAT_40 and with no compat options (and thus
no SA) compile.

No functional changes intended.

Revision 1.274.2.3 / (download) - annotate - [select for diffs], Thu Jul 3 18:38:11 2008 UTC (14 years, 6 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.274.2.2: +63 -11 lines
Diff to previous 1.274.2.2 (colored) next main 1.275 (colored)

Sync with head.

Revision 1.268.6.5 / (download) - annotate - [select for diffs], Wed Jul 2 19:08:20 2008 UTC (14 years, 6 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.268.6.4: +61 -9 lines
Diff to previous 1.268.6.4 (colored) to branchpoint 1.268 (colored)

Sync with HEAD.

Revision 1.277 / (download) - annotate - [select for diffs], Wed Jul 2 17:28:57 2008 UTC (14 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base
Branch point for: haad-dm
Changes since 1.276: +63 -11 lines
Diff to previous 1.276 (colored)

Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.

Revision 1.268.6.4 / (download) - annotate - [select for diffs], Sun Jun 29 09:33:14 2008 UTC (14 years, 7 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.268.6.3: +15 -16 lines
Diff to previous 1.268.6.3 (colored) to branchpoint 1.268 (colored)

Sync with HEAD.

Revision 1.274.2.2 / (download) - annotate - [select for diffs], Fri Jun 27 15:11:38 2008 UTC (14 years, 7 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.274.2.1: +10 -10 lines
Diff to previous 1.274.2.1 (colored)

Sync with head.

Revision 1.272.4.5 / (download) - annotate - [select for diffs], Fri Jun 27 01:34:26 2008 UTC (14 years, 7 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.272.4.4: +3 -3 lines
Diff to previous 1.272.4.4 (colored) to branchpoint 1.272 (colored)

Add getucontext32_sa() and getucontext_sa(), and use them. They
are sa-specific versions of getucontext{,32}(). The main difference
is that they do NOT require the p_lock be held. We report an empty
signal mask, both to avoid needing p_lock and because the process
signal mask is almost always 0 for SA.

Revision 1.276 / (download) - annotate - [select for diffs], Tue Jun 24 18:04:52 2008 UTC (14 years, 7 months ago) by ad
Branch: MAIN
Changes since 1.275: +10 -10 lines
Diff to previous 1.275 (colored)

execve1:

- Properly terminate the fake argument list.
- Fix two double-frees.

Revision 1.272.4.4 / (download) - annotate - [select for diffs], Tue Jun 24 02:14:43 2008 UTC (14 years, 7 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.272.4.3: +6 -5 lines
Diff to previous 1.272.4.3 (colored) to branchpoint 1.272 (colored)

Fix conflict as part of recent sync with -current.

Revision 1.272.4.3 / (download) - annotate - [select for diffs], Mon Jun 23 04:31:50 2008 UTC (14 years, 7 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.272.4.2: +6 -7 lines
Diff to previous 1.272.4.2 (colored) to branchpoint 1.272 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.274.2.1 / (download) - annotate - [select for diffs], Wed Jun 18 16:33:35 2008 UTC (14 years, 7 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.274: +5 -7 lines
Diff to previous 1.274 (colored)

Sync with head.

Revision 1.270.2.2 / (download) - annotate - [select for diffs], Tue Jun 17 09:15:02 2008 UTC (14 years, 7 months ago) by yamt
Branch: yamt-pf42
Changes since 1.270.2.1: +10 -10 lines
Diff to previous 1.270.2.1 (colored) to branchpoint 1.270 (colored) next main 1.271 (colored)

sync with head.

Revision 1.275 / (download) - annotate - [select for diffs], Mon Jun 16 09:51:14 2008 UTC (14 years, 7 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Changes since 1.274: +5 -7 lines
Diff to previous 1.274 (colored)

- PPWAIT is need only be locked by proc_lock, so move it to proc::p_lflag.
- Remove a few needless lock acquires from exec/fork/exit.
- Sprinkle branch hints.

No functional change.

Revision 1.274 / (download) - annotate - [select for diffs], Fri Jun 6 22:21:11 2008 UTC (14 years, 7 months ago) by ad
Branch: MAIN
Branch point for: simonb-wapbl
Changes since 1.273: +6 -5 lines
Diff to previous 1.273 (colored)

PR kern/38881 execve(2) panic: lock error, with path argument > PATH_MAX

Revision 1.268.6.3 / (download) - annotate - [select for diffs], Thu Jun 5 19:14:36 2008 UTC (14 years, 7 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.268.6.2: +1 -0 lines
Diff to previous 1.268.6.2 (colored) to branchpoint 1.268 (colored)

Sync with HEAD.

Also fix build.

Revision 1.273 / (download) - annotate - [select for diffs], Wed Jun 4 12:16:06 2008 UTC (14 years, 7 months ago) by ad
Branch: MAIN
Changes since 1.272: +3 -2 lines
Diff to previous 1.272 (colored)

Make sure the PAX flags are copied/zeroed correctly.

Revision 1.268.6.2 / (download) - annotate - [select for diffs], Mon Jun 2 13:24:08 2008 UTC (14 years, 7 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.268.6.1: +19 -20 lines
Diff to previous 1.268.6.1 (colored) to branchpoint 1.268 (colored)

Sync with HEAD.

Revision 1.272.4.2 / (download) - annotate - [select for diffs], Thu May 22 06:22:20 2008 UTC (14 years, 8 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.272.4.1: +18 -3 lines
Diff to previous 1.272.4.1 (colored) to branchpoint 1.272 (colored)

Put back SA-clearing flags in execve1. Now use lwp_{un,}lock() for
locking.

Revision 1.270.2.1 / (download) - annotate - [select for diffs], Sun May 18 12:35:07 2008 UTC (14 years, 8 months ago) by yamt
Branch: yamt-pf42
Changes since 1.270: +21 -22 lines
Diff to previous 1.270 (colored)

sync with head.

Revision 1.272.4.1 / (download) - annotate - [select for diffs], Sat May 10 23:49:03 2008 UTC (14 years, 8 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.272: +16 -2 lines
Diff to previous 1.272 (colored)

Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.

Revision 1.272 / (download) - annotate - [select for diffs], Thu Apr 24 18:39:24 2008 UTC (14 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, yamt-nfs-mp-base, hpcarm-cleanup-nbase
Branch point for: yamt-nfs-mp, wrstuden-revivesa
Changes since 1.271: +14 -15 lines
Diff to previous 1.271 (colored)

Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.

Revision 1.271 / (download) - annotate - [select for diffs], Thu Apr 24 15:35:29 2008 UTC (14 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.270: +9 -9 lines
Diff to previous 1.270 (colored)

Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.

Revision 1.268.6.1 / (download) - annotate - [select for diffs], Thu Apr 3 12:43:01 2008 UTC (14 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.268: +26 -5 lines
Diff to previous 1.268 (colored)

Sync with HEAD.

Revision 1.201.2.11 / (download) - annotate - [select for diffs], Mon Mar 24 09:39:01 2008 UTC (14 years, 10 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201.2.10: +5 -5 lines
Diff to previous 1.201.2.10 (colored) next main 1.202 (colored)

sync with head.

Revision 1.268.2.1 / (download) - annotate - [select for diffs], Mon Mar 24 07:16:13 2008 UTC (14 years, 10 months ago) by keiichi
Branch: keiichi-mipv6
Changes since 1.268: +23 -2 lines
Diff to previous 1.268 (colored) next main 1.269 (colored)

sync with head.

Revision 1.247.2.4 / (download) - annotate - [select for diffs], Sun Mar 23 02:04:58 2008 UTC (14 years, 10 months ago) by matt
Branch: matt-armv6
Changes since 1.247.2.3: +40 -13 lines
Diff to previous 1.247.2.3 (colored) to branchpoint 1.247 (colored) next main 1.248 (colored)

sync with HEAD

Revision 1.270 / (download) - annotate - [select for diffs], Fri Mar 21 21:55:00 2008 UTC (14 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, ad-socklock-base1
Branch point for: yamt-pf42
Changes since 1.269: +5 -5 lines
Diff to previous 1.269 (colored)

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.

Revision 1.201.2.10 / (download) - annotate - [select for diffs], Wed Feb 27 08:36:55 2008 UTC (14 years, 11 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201.2.9: +23 -2 lines
Diff to previous 1.201.2.9 (colored)

sync with head.

Revision 1.269 / (download) - annotate - [select for diffs], Sun Feb 24 21:46:04 2008 UTC (14 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, hpcarm-cleanup-base
Changes since 1.268: +23 -2 lines
Diff to previous 1.268 (colored)

Check for number of processes resource violation in execve().

Revision 1.251.2.4 / (download) - annotate - [select for diffs], Mon Feb 18 21:06:45 2008 UTC (14 years, 11 months ago) by mjf
Branch: mjf-devfs
Changes since 1.251.2.3: +87 -82 lines
Diff to previous 1.251.2.3 (colored) to branchpoint 1.251 (colored) next main 1.252 (colored)

Sync with HEAD.

Revision 1.201.2.9 / (download) - annotate - [select for diffs], Mon Feb 4 09:24:10 2008 UTC (14 years, 11 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201.2.8: +4 -5 lines
Diff to previous 1.201.2.8 (colored)

sync with head.

Revision 1.268 / (download) - annotate - [select for diffs], Sat Feb 2 20:42:18 2008 UTC (14 years, 11 months ago) by elad
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.267: +4 -5 lines
Diff to previous 1.267 (colored)

KTRFAC_ROOT -> KTRFAC_PERSISTENT, and update comments.

Discussed with christos@ and yamt@.

Revision 1.201.2.8 / (download) - annotate - [select for diffs], Mon Jan 21 09:46:03 2008 UTC (15 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201.2.7: +89 -83 lines
Diff to previous 1.201.2.7 (colored)

sync with head

Revision 1.257.4.3 / (download) - annotate - [select for diffs], Sun Jan 20 17:51:42 2008 UTC (15 years ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.257.4.2: +15 -8 lines
Diff to previous 1.257.4.2 (colored) to branchpoint 1.257 (colored) next main 1.258 (colored)

Sync with HEAD

Revision 1.267 / (download) - annotate - [select for diffs], Sun Jan 20 10:15:50 2008 UTC (15 years ago) by dsl
Branch: MAIN
CVS Tags: bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.266: +17 -10 lines
Diff to previous 1.266 (colored)

Don't allocated the stackgap during exec (but do allocate 32 bytes
for 'stack grows up' systems for the _rtld interface).

Revision 1.247.2.3 / (download) - annotate - [select for diffs], Wed Jan 9 01:56:01 2008 UTC (15 years ago) by matt
Branch: matt-armv6
Changes since 1.247.2.2: +123 -90 lines
Diff to previous 1.247.2.2 (colored) to branchpoint 1.247 (colored)

sync with HEAD

Revision 1.257.4.2 / (download) - annotate - [select for diffs], Tue Jan 8 22:11:32 2008 UTC (15 years ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.257.4.1: +9 -13 lines
Diff to previous 1.257.4.1 (colored) to branchpoint 1.257 (colored)

Sync with HEAD

Revision 1.266 / (download) - annotate - [select for diffs], Thu Jan 3 14:36:58 2008 UTC (15 years ago) by yamt
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.265: +11 -15 lines
Diff to previous 1.265 (colored)

- malloc -> kmem_alloc
- kill M_EXEC.

Revision 1.257.4.1 / (download) - annotate - [select for diffs], Wed Jan 2 21:55:48 2008 UTC (15 years ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.257: +64 -61 lines
Diff to previous 1.257 (colored)

Sync with HEAD

Revision 1.265 / (download) - annotate - [select for diffs], Wed Jan 2 19:44:37 2008 UTC (15 years ago) by yamt
Branch: MAIN
Changes since 1.264: +13 -12 lines
Diff to previous 1.264 (colored)

use kmem_alloc instead of malloc.

Revision 1.264 / (download) - annotate - [select for diffs], Wed Jan 2 11:48:49 2008 UTC (15 years ago) by ad
Branch: MAIN
Changes since 1.263: +3 -2 lines
Diff to previous 1.263 (colored)

Merge vmlocking2 to head.

Revision 1.263 / (download) - annotate - [select for diffs], Mon Dec 31 15:32:10 2007 UTC (15 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.262: +3 -27 lines
Diff to previous 1.262 (colored)

Remove systrace. Ok core@.

Revision 1.262 / (download) - annotate - [select for diffs], Fri Dec 28 17:14:50 2007 UTC (15 years, 1 month ago) by elad
Branch: MAIN
Changes since 1.261: +7 -7 lines
Diff to previous 1.261 (colored)

Provide 8 more bits of stack randomization, from the PaX author.

While here, don't make too much use of one random value, and call
arc4random() directly. Allows for the removal of 'ep_random' from the
exec_package.

Prompted by and okay christos@.

Revision 1.251.2.3 / (download) - annotate - [select for diffs], Thu Dec 27 00:45:58 2007 UTC (15 years, 1 month ago) by mjf
Branch: mjf-devfs
Changes since 1.251.2.2: +6 -6 lines
Diff to previous 1.251.2.2 (colored) to branchpoint 1.251 (colored)

Sync with HEAD.

Revision 1.261 / (download) - annotate - [select for diffs], Wed Dec 26 22:49:19 2007 UTC (15 years, 1 month ago) by xtraeme
Branch: MAIN
Changes since 1.260: +4 -3 lines
Diff to previous 1.260 (colored)

Fix build without debug enabled:

/usr/src/sys/kern/kern_exec.c: In function 'execve1':
/usr/src/sys/kern/kern_exec.c:505: warning: empty body in an if-statement

Revision 1.260 / (download) - annotate - [select for diffs], Wed Dec 26 22:11:49 2007 UTC (15 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.259: +20 -8 lines
Diff to previous 1.259 (colored)

Add PaX ASLR (Address Space Layout Randomization) [from elad and myself]

For regular (non PIE) executables randomization is enabled for:
    1. The data segment
    2. The stack

For PIE executables(*) randomization is enabled for:
    1. The program itself
    2. All shared libraries
    3. The data segment
    4. The stack

(*) To generate a PIE executable:
    - compile everything with -fPIC
    - link with -shared-libgcc -Wl,-pie

This feature is experimental, and might change. To use selectively add
    options PAX_ASLR=0
in your kernel.

Currently we are using 12 bits for the stack, program, and data segment and
16 or 24 bits for mmap, depending on __LP64__.

Revision 1.256.2.3 / (download) - annotate - [select for diffs], Wed Dec 26 21:39:38 2007 UTC (15 years, 1 month ago) by ad
Branch: vmlocking2
Changes since 1.256.2.2: +6 -6 lines
Diff to previous 1.256.2.2 (colored) to branchpoint 1.256 (colored) next main 1.257 (colored)

Sync with head.

Revision 1.259 / (download) - annotate - [select for diffs], Wed Dec 26 16:01:35 2007 UTC (15 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.258: +29 -17 lines
Diff to previous 1.258 (colored)

Merge more changes from vmlocking2, mainly:

- Locking improvements.
- Use pool_cache for more items.

Revision 1.256.2.2 / (download) - annotate - [select for diffs], Fri Dec 21 12:53:39 2007 UTC (15 years, 1 month ago) by ad
Branch: vmlocking2
Changes since 1.256.2.1: +25 -17 lines
Diff to previous 1.256.2.1 (colored) to branchpoint 1.256 (colored)

Use a mutex to serialize sigobject init.

Revision 1.258 / (download) - annotate - [select for diffs], Thu Dec 20 23:03:08 2007 UTC (15 years, 1 month ago) by dsl
Branch: MAIN
Changes since 1.257: +5 -5 lines
Diff to previous 1.257 (colored)

Convert all the system call entry points from:
    int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.

Revision 1.256.2.1 / (download) - annotate - [select for diffs], Sat Dec 15 03:16:55 2007 UTC (15 years, 1 month ago) by ad
Branch: vmlocking2
Changes since 1.256: +7 -2 lines
Diff to previous 1.256 (colored)

- Use pool_cache for a few more items and make those caches static.
- Mark another 10 syscalls MPSAFE including execve(). A small bit of
  work is required to fix a couple of issues (tty, kqueue).

Revision 1.246.4.9 / (download) - annotate - [select for diffs], Sun Dec 9 19:38:16 2007 UTC (15 years, 1 month ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.246.4.8: +3 -3 lines
Diff to previous 1.246.4.8 (colored) to branchpoint 1.246 (colored) next main 1.247 (colored)

Sync with HEAD.

Revision 1.257 / (download) - annotate - [select for diffs], Sat Dec 8 19:29:47 2007 UTC (15 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, jmcneill-pm-base, cube-autoconf-base, cube-autoconf
Branch point for: bouyer-xeni386
Changes since 1.256: +3 -3 lines
Diff to previous 1.256 (colored)

Remove cn_lwp from struct componentname.  curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.

Revision 1.251.2.2 / (download) - annotate - [select for diffs], Sat Dec 8 18:20:27 2007 UTC (15 years, 1 month ago) by mjf
Branch: mjf-devfs
Changes since 1.251.2.1: +49 -20 lines
Diff to previous 1.251.2.1 (colored) to branchpoint 1.251 (colored)

Sync with HEAD.

Revision 1.201.2.7 / (download) - annotate - [select for diffs], Fri Dec 7 17:32:40 2007 UTC (15 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201.2.6: +49 -20 lines
Diff to previous 1.201.2.6 (colored)

sync with head

Revision 1.246.4.8 / (download) - annotate - [select for diffs], Mon Dec 3 16:14:48 2007 UTC (15 years, 1 month ago) by joerg
Branch: jmcneill-pm
Changes since 1.246.4.7: +43 -14 lines
Diff to previous 1.246.4.7 (colored) to branchpoint 1.246 (colored)

Sync with HEAD.

Revision 1.256 / (download) - annotate - [select for diffs], Mon Dec 3 02:20:24 2007 UTC (15 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base
Branch point for: vmlocking2
Changes since 1.255: +3 -3 lines
Diff to previous 1.255 (colored)

kill a diagnostic for now.

Revision 1.255 / (download) - annotate - [select for diffs], Mon Dec 3 02:06:58 2007 UTC (15 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.254: +43 -14 lines
Diff to previous 1.254 (colored)

- add an elf aux vector entry for implementing $ORIGIN.
- the code to convert from a vnode to a path is commented out now until
  a better solution is implemented. Only absolute paths work for now
  (which is most of the cases).

requested by core

Revision 1.246.4.7 / (download) - annotate - [select for diffs], Tue Nov 27 19:38:02 2007 UTC (15 years, 2 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.246.4.6: +8 -8 lines
Diff to previous 1.246.4.6 (colored) to branchpoint 1.246 (colored)

Sync with HEAD. amd64 Xen support needs testing.

Revision 1.254 / (download) - annotate - [select for diffs], Mon Nov 26 19:02:01 2007 UTC (15 years, 2 months ago) by pooka
Branch: MAIN
Changes since 1.253: +8 -8 lines
Diff to previous 1.253 (colored)

Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern

Revision 1.251.2.1 / (download) - annotate - [select for diffs], Mon Nov 19 00:48:36 2007 UTC (15 years, 2 months ago) by mjf
Branch: mjf-devfs
Changes since 1.251: +13 -19 lines
Diff to previous 1.251 (colored)

Sync with HEAD.

Revision 1.201.2.6 / (download) - annotate - [select for diffs], Thu Nov 15 11:44:40 2007 UTC (15 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201.2.5: +13 -19 lines
Diff to previous 1.201.2.5 (colored)

sync with head.

Revision 1.246.4.6 / (download) - annotate - [select for diffs], Wed Nov 14 19:04:39 2007 UTC (15 years, 2 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.246.4.5: +7 -2 lines
Diff to previous 1.246.4.5 (colored) to branchpoint 1.246 (colored)

Sync with HEAD.

Revision 1.249.2.2 / (download) - annotate - [select for diffs], Tue Nov 13 16:02:00 2007 UTC (15 years, 2 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.249.2.1: +12 -18 lines
Diff to previous 1.249.2.1 (colored) to branchpoint 1.249 (colored) next main 1.250 (colored)

Sync with HEAD

Revision 1.253 / (download) - annotate - [select for diffs], Mon Nov 12 23:11:58 2007 UTC (15 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: bouyer-xenamd64-base2, bouyer-xenamd64-base
Changes since 1.252: +7 -2 lines
Diff to previous 1.252 (colored)

Add _lwp_ctl() system call: provides a bidirectional, per-LWP communication
area between processes and the kernel.

Revision 1.246.4.5 / (download) - annotate - [select for diffs], Sun Nov 11 16:48:01 2007 UTC (15 years, 2 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.246.4.4: +8 -19 lines
Diff to previous 1.246.4.4 (colored) to branchpoint 1.246 (colored)

Sync with HEAD.

Revision 1.247.2.2 / (download) - annotate - [select for diffs], Thu Nov 8 11:00:00 2007 UTC (15 years, 2 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.247.2.1: +8 -19 lines
Diff to previous 1.247.2.1 (colored) to branchpoint 1.247 (colored)

sync with -HEAD

Revision 1.252 / (download) - annotate - [select for diffs], Wed Nov 7 00:23:20 2007 UTC (15 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.251: +8 -19 lines
Diff to previous 1.251 (colored)

Merge from vmlocking:

- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.

Revision 1.247.2.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:31:33 2007 UTC (15 years, 2 months ago) by matt
Branch: matt-armv6
Changes since 1.247: +30 -18 lines
Diff to previous 1.247 (colored)

sync with HEAD

Revision 1.246.4.4 / (download) - annotate - [select for diffs], Sun Oct 28 20:11:10 2007 UTC (15 years, 3 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.246.4.3: +3 -3 lines
Diff to previous 1.246.4.3 (colored) to branchpoint 1.246 (colored)

Sync with HEAD.

Revision 1.201.2.5 / (download) - annotate - [select for diffs], Sat Oct 27 11:35:22 2007 UTC (15 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201.2.4: +30 -18 lines
Diff to previous 1.201.2.4 (colored)

sync with head.

Revision 1.246.4.3 / (download) - annotate - [select for diffs], Fri Oct 26 15:48:30 2007 UTC (15 years, 3 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.246.4.2: +3 -3 lines
Diff to previous 1.246.4.2 (colored) to branchpoint 1.246 (colored)

Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.249.2.1 / (download) - annotate - [select for diffs], Thu Oct 25 22:39:59 2007 UTC (15 years, 3 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.249: +3 -3 lines
Diff to previous 1.249 (colored)

Sync with HEAD.

Revision 1.243.2.5 / (download) - annotate - [select for diffs], Thu Oct 25 19:43:08 2007 UTC (15 years, 3 months ago) by ad
Branch: vmlocking
Changes since 1.243.2.4: +8 -19 lines
Diff to previous 1.243.2.4 (colored) to branchpoint 1.243 (colored) next main 1.244 (colored)

- Simplify debugger/procfs reference counting of processes. Use a per-proc
  rwlock: rw_tryenter(RW_READER) to gain a reference, and rw_enter(RW_WRITER)
  by the process itself to drain out reference holders before major changes
  like exiting.
- Fix numerous bugs and locking issues in procfs.
- Mark procfs MPSAFE.

Revision 1.251 / (download) - annotate - [select for diffs], Wed Oct 24 14:50:40 2007 UTC (15 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: jmcneill-base
Branch point for: mjf-devfs
Changes since 1.250: +3 -3 lines
Diff to previous 1.250 (colored)

Make ras_lookup() lockless.

Revision 1.243.2.4 / (download) - annotate - [select for diffs], Tue Oct 23 20:17:09 2007 UTC (15 years, 3 months ago) by ad
Branch: vmlocking
Changes since 1.243.2.3: +3 -3 lines
Diff to previous 1.243.2.3 (colored) to branchpoint 1.243 (colored)

Sync with head.

Revision 1.250 / (download) - annotate - [select for diffs], Fri Oct 19 12:16:42 2007 UTC (15 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.249: +3 -3 lines
Diff to previous 1.249 (colored)

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h

Revision 1.243.2.3 / (download) - annotate - [select for diffs], Tue Oct 9 13:44:24 2007 UTC (15 years, 3 months ago) by ad
Branch: vmlocking
Changes since 1.243.2.2: +28 -16 lines
Diff to previous 1.243.2.2 (colored) to branchpoint 1.243 (colored)

Sync with head.

Revision 1.248.2.1 / (download) - annotate - [select for diffs], Sat Oct 6 15:28:41 2007 UTC (15 years, 3 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.248: +4 -2 lines
Diff to previous 1.248 (colored) next main 1.249 (colored)

sync with head.

Revision 1.246.4.2 / (download) - annotate - [select for diffs], Tue Oct 2 18:28:58 2007 UTC (15 years, 3 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.246.4.1: +28 -16 lines
Diff to previous 1.246.4.1 (colored) to branchpoint 1.246 (colored)

Sync with HEAD.

Revision 1.249 / (download) - annotate - [select for diffs], Tue Oct 2 12:01:17 2007 UTC (15 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, vmlocking-base
Branch point for: bouyer-xenamd64
Changes since 1.248: +4 -2 lines
Diff to previous 1.248 (colored)

Add a comment clarifying that in the succesful case the function
returns from the middle of the loop.

Revision 1.248 / (download) - annotate - [select for diffs], Thu Sep 20 20:51:38 2007 UTC (15 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-x86pmap-base
Branch point for: yamt-x86pmap
Changes since 1.247: +26 -16 lines
Diff to previous 1.247 (colored)

- add debugging info to the remaining failure cases in execve1.
- use size_t where appropriate.

Revision 1.201.2.4 / (download) - annotate - [select for diffs], Mon Sep 3 14:40:45 2007 UTC (15 years, 4 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201.2.3: +93 -65 lines
Diff to previous 1.201.2.3 (colored)

sync with head.

Revision 1.245.2.2 / (download) - annotate - [select for diffs], Mon Sep 3 10:22:58 2007 UTC (15 years, 4 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.245.2.1: +7 -16 lines
Diff to previous 1.245.2.1 (colored) to branchpoint 1.245 (colored) next main 1.246 (colored)

Sync with HEAD.

Revision 1.243.2.2 / (download) - annotate - [select for diffs], Mon Aug 20 21:27:29 2007 UTC (15 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.243.2.1: +7 -17 lines
Diff to previous 1.243.2.1 (colored) to branchpoint 1.243 (colored)

Sync with HEAD.

Revision 1.246.4.1 / (download) - annotate - [select for diffs], Thu Aug 16 11:03:29 2007 UTC (15 years, 5 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.246: +7 -16 lines
Diff to previous 1.246 (colored)

Sync with HEAD.

Revision 1.245.2.1 / (download) - annotate - [select for diffs], Wed Aug 15 13:49:07 2007 UTC (15 years, 5 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.245: +2 -3 lines
Diff to previous 1.245 (colored)

Sync with HEAD.

Revision 1.247 / (download) - annotate - [select for diffs], Wed Aug 15 12:07:32 2007 UTC (15 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: nick-csl-alignment-base5
Branch point for: matt-armv6
Changes since 1.246: +7 -16 lines
Diff to previous 1.246 (colored)

Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.

Revision 1.246.6.2 / (download) - annotate - [select for diffs], Sun Jul 22 19:16:06 2007 UTC (15 years, 6 months ago) by pooka
Branch: matt-mips64
Changes since 1.246.6.1: +1536 -0 lines
Diff to previous 1.246.6.1 (colored) to branchpoint 1.246 (colored) next main 1.247 (colored)

Retire uvn_attach() - it abuses VXLOCK and its functionality,
setting vnode sizes, is handled elsewhere: file system vnode creation
or spec_open() for regular files or block special files, respectively.

Add a call to VOP_MMAP() to the pagedvn exec path, since the vnode
is being memory mapped.

reviewed by tech-kern & wrstuden

Revision 1.246.6.1, Sun Jul 22 19:16:05 2007 UTC (15 years, 6 months ago) by pooka
Branch: matt-mips64
Changes since 1.246: +0 -1536 lines
FILE REMOVED

file kern_exec.c was added on branch matt-mips64 on 2007-07-22 19:16:06 +0000

Revision 1.246 / (download) - annotate - [select for diffs], Sun Jul 22 19:16:05 2007 UTC (15 years, 6 months ago) by pooka
Branch: MAIN
CVS Tags: matt-mips64-base, hpcarm-cleanup
Branch point for: matt-mips64, jmcneill-pm
Changes since 1.245: +2 -3 lines
Diff to previous 1.245 (colored)

Retire uvn_attach() - it abuses VXLOCK and its functionality,
setting vnode sizes, is handled elsewhere: file system vnode creation
or spec_open() for regular files or block special files, respectively.

Add a call to VOP_MMAP() to the pagedvn exec path, since the vnode
is being memory mapped.

reviewed by tech-kern & wrstuden

Revision 1.243.4.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:09:45 2007 UTC (15 years, 6 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.243: +76 -42 lines
Diff to previous 1.243 (colored) next main 1.244 (colored)

Sync with head.

Revision 1.243.2.1 / (download) - annotate - [select for diffs], Fri Jun 8 14:17:17 2007 UTC (15 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.243: +76 -42 lines
Diff to previous 1.243 (colored)

Sync with head.

Revision 1.245 / (download) - annotate - [select for diffs], Thu May 17 14:51:38 2007 UTC (15 years, 8 months ago) by yamt
Branch: MAIN
CVS Tags: nick-csl-alignment-base, mjf-ufs-trans-base
Branch point for: nick-csl-alignment
Changes since 1.244: +3 -3 lines
Diff to previous 1.244 (colored)

merge yamt-idlelwp branch.  asked by core@.  some ports still needs work.

from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.

Revision 1.237.2.4 / (download) - annotate - [select for diffs], Mon May 7 10:55:45 2007 UTC (15 years, 8 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.237.2.3: +75 -41 lines
Diff to previous 1.237.2.3 (colored) to branchpoint 1.237 (colored) next main 1.238 (colored)

sync with head.

Revision 1.244 / (download) - annotate - [select for diffs], Sun Apr 22 08:30:00 2007 UTC (15 years, 9 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-idlelwp-base8
Changes since 1.243: +75 -41 lines
Diff to previous 1.243 (colored)

Change the way that emulations locate files within the emulation root to
  avoid having to allocate space in the 'stackgap'
  - which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
  the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
  during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
  search for absolute pathnames in the emulation root, if that fails it will
  retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
  of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
  relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
  inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
  the real root is returned instead (matching the behaviour of emul_lookup,
  but being a cheap comparison here) so that programs that scan "../.."
  looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
  CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
  TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.

Revision 1.237.2.3 / (download) - annotate - [select for diffs], Mon Mar 12 05:58:33 2007 UTC (15 years, 10 months ago) by rmind
Branch: yamt-idlelwp
Changes since 1.237.2.2: +14 -10 lines
Diff to previous 1.237.2.2 (colored) to branchpoint 1.237 (colored)

Sync with HEAD.

Revision 1.243 / (download) - annotate - [select for diffs], Fri Mar 9 22:25:56 2007 UTC (15 years, 10 months ago) by matt
Branch: MAIN
CVS Tags: thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: vmlocking, mjf-ufs-trans
Changes since 1.242: +6 -2 lines
Diff to previous 1.242 (colored)

If STACKALIGN is defined, use it instead of ALIGN.  Some arches need a
stack more aligned that ALIGN will give.

Revision 1.237.2.2 / (download) - annotate - [select for diffs], Fri Mar 9 15:16:23 2007 UTC (15 years, 10 months ago) by rmind
Branch: yamt-idlelwp
Changes since 1.237.2.1: +3 -3 lines
Diff to previous 1.237.2.1 (colored) to branchpoint 1.237 (colored)

Checkpoint:

- Addition of scheduler-specific pointers in the struct proc, lwp and
  schedstate_percpu.
- Addition of sched_lwp_fork(), sched_lwp_exit() and sched_slept() hooks.
- mi_switch() now has only one argument.
- sched_nextlwp(void) becomes sched_switch(struct lwp *) and does an
  enqueueing of LWP.
- Addition of general kern.sched sysctl node.
- Remove twice called uvmexp.swtch++, other cleanups.

Discussed on tech-kern@

Revision 1.242 / (download) - annotate - [select for diffs], Fri Mar 9 14:11:24 2007 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.241: +6 -6 lines
Diff to previous 1.241 (colored)

- Make the proclist_lock a mutex. The write:read ratio is unfavourable,
  and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.

Revision 1.241 / (download) - annotate - [select for diffs], Mon Mar 5 04:59:20 2007 UTC (15 years, 10 months ago) by dogcow
Branch: MAIN
Changes since 1.240: +6 -6 lines
Diff to previous 1.240 (colored)

die, caddr_t, die.

Revision 1.237.2.1 / (download) - annotate - [select for diffs], Tue Feb 27 16:54:20 2007 UTC (15 years, 11 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.237: +11 -10 lines
Diff to previous 1.237 (colored)

- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.201.2.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:11:05 2007 UTC (15 years, 11 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201.2.2: +122 -90 lines
Diff to previous 1.201.2.2 (colored)

sync with head.

Revision 1.240 / (download) - annotate - [select for diffs], Thu Feb 22 06:34:43 2007 UTC (15 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.239: +4 -4 lines
Diff to previous 1.239 (colored)

TRUE -> true, FALSE -> false

Revision 1.239 / (download) - annotate - [select for diffs], Mon Feb 19 15:10:04 2007 UTC (15 years, 11 months ago) by cube
Branch: MAIN
Changes since 1.238: +3 -2 lines
Diff to previous 1.238 (colored)

Introduce a new member to struct emul, e_startlwp, to be used by
sys__lwp_create.  It allows using the said syscall under COMPAT_NETBSD32.

The libpthread regression tests now pass on amd64 and sparc64.

Revision 1.238 / (download) - annotate - [select for diffs], Sat Feb 17 22:31:42 2007 UTC (15 years, 11 months ago) by pavel
Branch: MAIN
Changes since 1.237: +8 -8 lines
Diff to previous 1.237 (colored)

Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.

Revision 1.237 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:30 2007 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: post-newlock2-merge
Branch point for: yamt-idlelwp
Changes since 1.236: +110 -80 lines
Diff to previous 1.236 (colored)

Merge newlock2 to head.

Revision 1.227.4.10 / (download) - annotate - [select for diffs], Fri Feb 9 21:03:53 2007 UTC (15 years, 11 months ago) by ad
Branch: newlock2
Changes since 1.227.4.9: +6 -5 lines
Diff to previous 1.227.4.9 (colored) to branchpoint 1.227 (colored) next main 1.228 (colored)

Sync with HEAD.

Revision 1.236 / (download) - annotate - [select for diffs], Thu Feb 8 00:26:50 2007 UTC (15 years, 11 months ago) by elad
Branch: MAIN
CVS Tags: newlock2-nbase, newlock2-base
Changes since 1.235: +5 -4 lines
Diff to previous 1.235 (colored)

style nit

Revision 1.227.4.9 / (download) - annotate - [select for diffs], Mon Feb 5 16:44:40 2007 UTC (15 years, 11 months ago) by ad
Branch: newlock2
Changes since 1.227.4.8: +4 -4 lines
Diff to previous 1.227.4.8 (colored) to branchpoint 1.227 (colored)

IPL_STATCLOCK needs to be >= IPL_CLOCK, so assume that proc::p_stmutex is
always a spinlock.

Revision 1.235 / (download) - annotate - [select for diffs], Mon Feb 5 14:34:29 2007 UTC (15 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.234: +3 -3 lines
Diff to previous 1.234 (colored)

typo.

Revision 1.227.4.8 / (download) - annotate - [select for diffs], Mon Feb 5 13:16:48 2007 UTC (15 years, 11 months ago) by ad
Branch: newlock2
Changes since 1.227.4.7: +10 -6 lines
Diff to previous 1.227.4.7 (colored) to branchpoint 1.227 (colored)

- When clearing signals dequeue siginfo first and free later, once
  outside the lock permiter.
- Push kernel_lock back in a a couple of places.
- Adjust limcopy() to be MP safe (this needs redoing).
- Fix a couple of bugs noticed along the way.
- Catch up with condvar changes.

Revision 1.227.4.7 / (download) - annotate - [select for diffs], Wed Jan 31 19:56:38 2007 UTC (15 years, 11 months ago) by ad
Branch: newlock2
Changes since 1.227.4.6: +11 -4 lines
Diff to previous 1.227.4.6 (colored) to branchpoint 1.227 (colored)

- Have callers to mi_switch() drop the kernel lock.
- Fix a deadlock and some typos.
- Unbreak ptrace().

Revision 1.227.4.6 / (download) - annotate - [select for diffs], Tue Jan 30 13:51:40 2007 UTC (16 years ago) by ad
Branch: newlock2
Changes since 1.227.4.5: +4 -29 lines
Diff to previous 1.227.4.5 (colored) to branchpoint 1.227 (colored)

Remove support for SA. Ok core@.

Revision 1.227.4.5 / (download) - annotate - [select for diffs], Fri Jan 12 01:04:06 2007 UTC (16 years ago) by ad
Branch: newlock2
Changes since 1.227.4.4: +18 -13 lines
Diff to previous 1.227.4.4 (colored) to branchpoint 1.227 (colored)

Sync with head.

Revision 1.201.2.2 / (download) - annotate - [select for diffs], Sat Dec 30 20:50:05 2006 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201.2.1: +68 -40 lines
Diff to previous 1.201.2.1 (colored)

sync with head.

Revision 1.232.2.2 / (download) - annotate - [select for diffs], Sat Dec 30 05:22:43 2006 UTC (16 years, 1 month ago) by riz
Branch: netbsd-4
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, matt-nb4-arm-base, matt-nb4-arm
Branch point for: netbsd-4-0
Changes since 1.232.2.1: +5 -4 lines
Diff to previous 1.232.2.1 (colored) to branchpoint 1.232 (colored)

Pull up following revision(s) (requested by elad in ticket #299):
	sys/kern/kern_exec.c: revision 1.234
Use ndp->ni_cnd.cn_pnbuf, not epp->ep_ndp->ni_dirp, for the pathname
for Veriexec/PaX purposes.
(this is safe here because the nameiop is LOOKUP.)
Fixes part of PR/35278.

Revision 1.227.4.4 / (download) - annotate - [select for diffs], Fri Dec 29 20:27:43 2006 UTC (16 years, 1 month ago) by ad
Branch: newlock2
Changes since 1.227.4.3: +28 -23 lines
Diff to previous 1.227.4.3 (colored) to branchpoint 1.227 (colored)

Checkpoint work in progress.

Revision 1.234 / (download) - annotate - [select for diffs], Sat Dec 23 17:23:51 2006 UTC (16 years, 1 month ago) by elad
Branch: MAIN
Changes since 1.233: +7 -6 lines
Diff to previous 1.233 (colored)

Use ndp->ni_cnd.cn_pnbuf, not epp->ep_ndp->ni_dirp, for the pathname
for Veriexec/PaX purposes.

(this is safe here because the nameiop is LOOKUP.)

Fixes part of PR/35278.

Revision 1.227.6.3 / (download) - annotate - [select for diffs], Thu Dec 21 15:07:59 2006 UTC (16 years, 1 month ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.227.6.2: +6 -11 lines
Diff to previous 1.227.6.2 (colored) to branchpoint 1.227 (colored) next main 1.228 (colored)

sync with head.

Revision 1.232.2.1 / (download) - annotate - [select for diffs], Thu Dec 21 14:25:45 2006 UTC (16 years, 1 month ago) by tron
Branch: netbsd-4
Changes since 1.232: +6 -11 lines
Diff to previous 1.232 (colored)

Pull up following revision(s) (requested by elad in ticket #294):
	sys/kern/exec_script.c: revision 1.53
	sys/kern/kern_exec.c: revision 1.233
	sys/sys/exec.h: revision 1.115
Remove the third argument from check_exec() and just check for ep_flags
in the exec_package to know if we need to use VERIEXEC_DIRECT or
VERIEXEC_INDIRECT.
Suggested by and okay yamt@

Revision 1.233 / (download) - annotate - [select for diffs], Wed Dec 20 11:35:29 2006 UTC (16 years, 1 month ago) by elad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5
Changes since 1.232: +6 -11 lines
Diff to previous 1.232 (colored)

Remove the third argument from check_exec() and just check for ep_flags
in the exec_package to know if we need to use VERIEXEC_DIRECT or
VERIEXEC_INDIRECT.

Suggested by and okay yamt@

Revision 1.227.6.2 / (download) - annotate - [select for diffs], Sun Dec 10 07:18:44 2006 UTC (16 years, 1 month ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.227.6.1: +16 -7 lines
Diff to previous 1.227.6.1 (colored) to branchpoint 1.227 (colored)

sync with head.

Revision 1.232 / (download) - annotate - [select for diffs], Wed Nov 22 02:02:51 2006 UTC (16 years, 2 months ago) by elad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base4, yamt-splraiseipl-base3, netbsd-4-base
Branch point for: netbsd-4
Changes since 1.231: +12 -3 lines
Diff to previous 1.231 (colored)

Initial implementation of PaX Segvguard (this is still work-in-progress,
it's just to get it out of my local tree).

Revision 1.227.4.3 / (download) - annotate - [select for diffs], Fri Nov 17 16:34:36 2006 UTC (16 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.227.4.2: +70 -37 lines
Diff to previous 1.227.4.2 (colored) to branchpoint 1.227 (colored)

Checkpoint work in progress.

Revision 1.231 / (download) - annotate - [select for diffs], Wed Nov 1 10:17:58 2006 UTC (16 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.230: +6 -6 lines
Diff to previous 1.230 (colored)

remove some __unused from function parameters.

Revision 1.227.6.1 / (download) - annotate - [select for diffs], Sun Oct 22 06:07:10 2006 UTC (16 years, 3 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.227: +6 -6 lines
Diff to previous 1.227 (colored)

sync with head

Revision 1.227.4.2 / (download) - annotate - [select for diffs], Sat Oct 21 15:20:46 2006 UTC (16 years, 3 months ago) by ad
Branch: newlock2
Changes since 1.227.4.1: +20 -14 lines
Diff to previous 1.227.4.1 (colored) to branchpoint 1.227 (colored)

Checkpoint work in progress on locking and per-LWP signals. Very much a
a work in progress and there is still a lot to do.

Revision 1.230 / (download) - annotate - [select for diffs], Tue Oct 17 18:21:29 2006 UTC (16 years, 3 months ago) by dogcow
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.229: +2 -4 lines
Diff to previous 1.229 (colored)

now that we have -Wno-unused-parameter, back out all the tremendously ugly
code to gratuitously access said parameters.

Revision 1.229 / (download) - annotate - [select for diffs], Fri Oct 13 16:53:36 2006 UTC (16 years, 3 months ago) by dogcow
Branch: MAIN
Changes since 1.228: +4 -2 lines
Diff to previous 1.228 (colored)

More -Wunused fallout. sprinkle __unused when possible; otherwise, use the
	do { if (&x) {} } while (/* CONSTCOND */ 0);
construct as suggested by uwe in <20061012224845.GA9449@snark.ptc.spbu.ru>.

Revision 1.228 / (download) - annotate - [select for diffs], Thu Oct 12 01:32:14 2006 UTC (16 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.227: +6 -6 lines
Diff to previous 1.227 (colored)

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.227.4.1 / (download) - annotate - [select for diffs], Mon Sep 11 18:07:25 2006 UTC (16 years, 4 months ago) by ad
Branch: newlock2
Changes since 1.227: +18 -18 lines
Diff to previous 1.227 (colored)

- Convert some lockmgr() locks to mutexes and RW locks.
- Acquire proclist_lock and p_crmutex in some obvious places.

Revision 1.212.4.1 / (download) - annotate - [select for diffs], Sat Sep 9 02:57:16 2006 UTC (16 years, 4 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.212: +78 -37 lines
Diff to previous 1.212 (colored) next main 1.213 (colored)

sync with head

Revision 1.214.2.4 / (download) - annotate - [select for diffs], Fri Aug 11 15:45:46 2006 UTC (16 years, 5 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.214.2.3: +56 -33 lines
Diff to previous 1.214.2.3 (colored) to branchpoint 1.214 (colored) next main 1.215 (colored)

sync with head

Revision 1.227 / (download) - annotate - [select for diffs], Sun Jul 30 21:58:11 2006 UTC (16 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, rpaulo-netinet-merge-pcb-base, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.226: +12 -4 lines
Diff to previous 1.226 (colored)

Single-thread updates to the process credential.

Revision 1.226 / (download) - annotate - [select for diffs], Wed Jul 26 09:33:57 2006 UTC (16 years, 6 months ago) by dogcow
Branch: MAIN
Changes since 1.225: +1 -1 lines
Diff to previous 1.225 (colored)

at the request of elad, as veriexec.h has returned, revert the changes
from 2006-07-25.

Revision 1.225 / (download) - annotate - [select for diffs], Tue Jul 25 00:23:06 2006 UTC (16 years, 6 months ago) by dogcow
Branch: MAIN
Changes since 1.224: +3 -3 lines
Diff to previous 1.224 (colored)

mechanically go through and
 s,include "veriexec.h",include <sys/verified_exec.h>,
as the former has apparently gone away.

Revision 1.224 / (download) - annotate - [select for diffs], Mon Jul 24 16:37:28 2006 UTC (16 years, 6 months ago) by elad
Branch: MAIN
Changes since 1.223: +3 -3 lines
Diff to previous 1.223 (colored)

some fixes:
  - adapt to NVERIEXEC in init_sysctl.c.
  - we now need "veriexec.h" for NVERIEXEC.
  - "opt_verified_exec.h" -> "opt_veriexec.h", and include it only where
    it is needed.

Revision 1.223 / (download) - annotate - [select for diffs], Sun Jul 23 22:06:11 2006 UTC (16 years, 6 months ago) by ad
Branch: MAIN
Changes since 1.222: +10 -12 lines
Diff to previous 1.222 (colored)

Use the LWP cached credentials where sane.

Revision 1.222 / (download) - annotate - [select for diffs], Sat Jul 22 10:34:26 2006 UTC (16 years, 6 months ago) by elad
Branch: MAIN
Changes since 1.221: +8 -8 lines
Diff to previous 1.221 (colored)

deprecate the VERIFIED_EXEC option; now we only need the pseudo-device to
enable it. while here, some config file tweaks.

tons of input from cube@ (thanks!) and okay blymn@.

Revision 1.221 / (download) - annotate - [select for diffs], Wed Jul 19 21:11:37 2006 UTC (16 years, 6 months ago) by ad
Branch: MAIN
Changes since 1.220: +20 -15 lines
Diff to previous 1.220 (colored)

- Hold a reference to the process credentials in each struct lwp.
- Update the reference on syscall and user trap if p_cred has changed.
- Collect accounting flags in the LWP, and collate on LWP exit.

Revision 1.220 / (download) - annotate - [select for diffs], Mon Jul 17 15:29:06 2006 UTC (16 years, 6 months ago) by ad
Branch: MAIN
Changes since 1.219: +22 -10 lines
Diff to previous 1.219 (colored)

- Always make p->p_cred a private copy before modifying.
- Share credentials among processes when forking.

Revision 1.219 / (download) - annotate - [select for diffs], Fri Jul 14 18:41:40 2006 UTC (16 years, 6 months ago) by elad
Branch: MAIN
Changes since 1.218: +4 -4 lines
Diff to previous 1.218 (colored)

okay, since there was no way to divide this to two commits, here it goes..

introduce fileassoc(9), a kernel interface for associating meta-data with
files using in-kernel memory. this is very similar to what we had in
veriexec till now, only abstracted so it can be used more easily by more
consumers.

this also prompted the redesign of the interface, making it work on vnodes
and mounts and not directly on devices and inodes. internally, we still
use file-id but that's gonna change soon... the interface will remain
consistent.

as a result, veriexec went under some heavy changes to conform to the new
interface. since we no longer use device numbers to identify file-systems,
the veriexec sysctl stuff changed too: kern.veriexec.count.dev_N is now
kern.veriexec.tableN.* where 'N' is NOT the device number but rather a
way to distinguish several mounts.

also worth noting is the plugging of unmount/delete operations
wrt/fileassoc and veriexec.

tons of input from yamt@, wrstuden@, martin@, and christos@.

Revision 1.201.2.1 / (download) - annotate - [select for diffs], Wed Jun 21 15:09:37 2006 UTC (16 years, 7 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.201: +104 -65 lines
Diff to previous 1.201 (colored)

sync with head.

Revision 1.212.6.2 / (download) - annotate - [select for diffs], Thu Jun 1 22:38:07 2006 UTC (16 years, 7 months ago) by kardel
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.212.6.1: +20 -18 lines
Diff to previous 1.212.6.1 (colored) next main 1.213 (colored)

Sync with head.

Revision 1.214.6.3 / (download) - annotate - [select for diffs], Wed May 24 15:50:40 2006 UTC (16 years, 8 months ago) by tron
Branch: peter-altq
Changes since 1.214.6.2: +20 -16 lines
Diff to previous 1.214.6.2 (colored) to branchpoint 1.214 (colored) next main 1.215 (colored)

Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.214.2.3 / (download) - annotate - [select for diffs], Wed May 24 10:58:40 2006 UTC (16 years, 8 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.214.2.2: +22 -18 lines
Diff to previous 1.214.2.2 (colored) to branchpoint 1.214 (colored)

sync with head.

Revision 1.218 / (download) - annotate - [select for diffs], Sun May 14 21:15:11 2006 UTC (16 years, 8 months ago) by elad
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, chap-midi
Changes since 1.217: +20 -18 lines
Diff to previous 1.217 (colored)

integrate kauth.

Revision 1.214.4.5 / (download) - annotate - [select for diffs], Sat May 6 23:31:30 2006 UTC (16 years, 8 months ago) by christos
Branch: elad-kernelauth
Changes since 1.214.4.4: +3 -2 lines
Diff to previous 1.214.4.4 (colored) to branchpoint 1.214 (colored) next main 1.215 (colored)

- Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
  that need it.

Approved by core.

Revision 1.212.6.1 / (download) - annotate - [select for diffs], Sat Apr 22 11:39:58 2006 UTC (16 years, 9 months ago) by simonb
Branch: simonb-timecounters
Changes since 1.212: +23 -7 lines
Diff to previous 1.212 (colored)

Sync with head.

Revision 1.214.4.4 / (download) - annotate - [select for diffs], Wed Apr 19 05:13:59 2006 UTC (16 years, 9 months ago) by elad
Branch: elad-kernelauth
Changes since 1.214.4.3: +19 -4 lines
Diff to previous 1.214.4.3 (colored) to branchpoint 1.214 (colored)

sync with head.

Revision 1.217 / (download) - annotate - [select for diffs], Fri Apr 14 23:54:21 2006 UTC (16 years, 9 months ago) by elad
Branch: MAIN
CVS Tags: elad-kernelauth-base
Changes since 1.216: +4 -2 lines
Diff to previous 1.216 (colored)

Coverity CID 1739: Plug leak.

Revision 1.214.2.2 / (download) - annotate - [select for diffs], Sat Apr 1 12:07:39 2006 UTC (16 years, 10 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.214.2.1: +1435 -0 lines
Diff to previous 1.214.2.1 (colored) to branchpoint 1.214 (colored)

sync with head.

Revision 1.214.6.2 / (download) - annotate - [select for diffs], Fri Mar 31 09:45:27 2006 UTC (16 years, 10 months ago) by tron
Branch: peter-altq
Changes since 1.214.6.1: +15 -2 lines
Diff to previous 1.214.6.1 (colored) to branchpoint 1.214 (colored)

Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.

Revision 1.216 / (download) - annotate - [select for diffs], Wed Mar 29 23:02:31 2006 UTC (16 years, 10 months ago) by cube
Branch: MAIN
CVS Tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3
Changes since 1.215: +15 -2 lines
Diff to previous 1.215 (colored)

Rework the _lwp* and sa_* families of syscalls so some details can be
handled differently depending on the emulation.  This paves the way for
COMPAT_NETBSD32 support of our pthread system.

Revision 1.214.6.1 / (download) - annotate - [select for diffs], Tue Mar 28 09:42:26 2006 UTC (16 years, 10 months ago) by tron
Branch: peter-altq
Changes since 1.214: +4 -4 lines
Diff to previous 1.214 (colored)

Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.

Revision 1.215 / (download) - annotate - [select for diffs], Wed Mar 22 01:14:46 2006 UTC (16 years, 10 months ago) by matt
Branch: MAIN
Changes since 1.214: +4 -4 lines
Diff to previous 1.214 (colored)

There is no need to use MALLOC/FREE when rebuilding the execsw array
due to LKM loading/unloading.  This is not performance critical.

Revision 1.214.4.3 / (download) - annotate - [select for diffs], Fri Mar 10 00:11:55 2006 UTC (16 years, 10 months ago) by elad
Branch: elad-kernelauth
Changes since 1.214.4.2: +3 -4 lines
Diff to previous 1.214.4.2 (colored) to branchpoint 1.214 (colored)

Remove unnecessary call to kauth_cred_setrefcnt().
Also remove an XXX comment.

Revision 1.214.4.2 / (download) - annotate - [select for diffs], Wed Mar 8 22:12:35 2006 UTC (16 years, 10 months ago) by elad
Branch: elad-kernelauth
Changes since 1.214.4.1: +4 -3 lines
Diff to previous 1.214.4.1 (colored) to branchpoint 1.214 (colored)

Fix some issues with set-id binaries.

Revision 1.214.4.1 / (download) - annotate - [select for diffs], Wed Mar 8 00:53:40 2006 UTC (16 years, 10 months ago) by elad
Branch: elad-kernelauth
Changes since 1.214: +19 -18 lines
Diff to previous 1.214 (colored)

Adapt to kernel authorization KPI.

Revision 1.214.2.1, Sun Mar 5 07:21:38 2006 UTC (16 years, 10 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.214: +0 -1422 lines
FILE REMOVED

file kern_exec.c was added on branch yamt-pdpolicy on 2006-04-01 12:07:39 +0000

Revision 1.214 / (download) - annotate - [select for diffs], Sun Mar 5 07:21:38 2006 UTC (16 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, peter-altq, elad-kernelauth
Changes since 1.213: +3 -3 lines
Diff to previous 1.213 (colored)

implement PT_SYSCALL

Revision 1.212.2.1 / (download) - annotate - [select for diffs], Sat Feb 18 15:39:18 2006 UTC (16 years, 11 months ago) by yamt
Branch: yamt-uio_vmspace
Changes since 1.212: +5 -4 lines
Diff to previous 1.212 (colored) next main 1.213 (colored)

sync with head.

Revision 1.213 / (download) - annotate - [select for diffs], Thu Feb 9 19:18:57 2006 UTC (16 years, 11 months ago) by manu
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5
Changes since 1.212: +5 -4 lines
Diff to previous 1.212 (colored)

Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64

Revision 1.212 / (download) - annotate - [select for diffs], Sun Dec 11 12:24:29 2005 UTC (17 years, 1 month ago) by christos
Branch: MAIN
Branch point for: yamt-uio_vmspace, simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.211: +27 -25 lines
Diff to previous 1.211 (colored)

merge ktrace-lwp.

Revision 1.169.2.10 / (download) - annotate - [select for diffs], Thu Nov 10 14:09:44 2005 UTC (17 years, 2 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.169.2.9: +94 -36 lines
Diff to previous 1.169.2.9 (colored) next main 1.170 (colored)

Sync with HEAD. Here we go again...

Revision 1.209.2.1 / (download) - annotate - [select for diffs], Wed Nov 2 11:58:11 2005 UTC (17 years, 2 months ago) by yamt
Branch: yamt-vop
Changes since 1.209: +7 -4 lines
Diff to previous 1.209 (colored) next main 1.210 (colored)

sync with head.

Revision 1.185.2.2.2.1 / (download) - annotate - [select for diffs], Mon Oct 31 21:01:45 2005 UTC (17 years, 2 months ago) by tron
Branch: netbsd-2
Changes since 1.185.2.2: +7 -4 lines
Diff to previous 1.185.2.2 (colored) next main 1.185.2.3 (colored)

Apply patch (requested by dan in ticket #5955):
Don't clear unconditionally P_SUGID when we exec. Clear it only when
the real and effective user and group ids match. From Tavis Ormandy.

Revision 1.185.2.2.4.1 / (download) - annotate - [select for diffs], Mon Oct 31 21:00:23 2005 UTC (17 years, 2 months ago) by tron
Branch: netbsd-2-1
Changes since 1.185.2.2: +7 -4 lines
Diff to previous 1.185.2.2 (colored) next main 1.185.2.3 (colored)

Apply patch (requested by dan in ticket #5955):
Don't clear unconditionally P_SUGID when we exec. Clear it only when
the real and effective user and group ids match. From Tavis Ormandy.

Revision 1.185.2.3 / (download) - annotate - [select for diffs], Mon Oct 31 20:53:02 2005 UTC (17 years, 2 months ago) by tron
Branch: netbsd-2-0
Changes since 1.185.2.2: +7 -4 lines
Diff to previous 1.185.2.2 (colored) to branchpoint 1.185 (colored) next main 1.186 (colored)

Apply patch (requested by dan in ticket #5955):
Don't clear unconditionally P_SUGID when we exec. Clear it only when
the real and effective user and group ids match. From Tavis Ormandy.

Revision 1.152.4.1 / (download) - annotate - [select for diffs], Mon Oct 31 20:46:24 2005 UTC (17 years, 2 months ago) by tron
Branch: netbsd-1-6
Changes since 1.152: +7 -4 lines
Diff to previous 1.152 (colored) next main 1.153 (colored)

Apply patch (requested by dan in ticket #5924):
Don't clear unconditionally P_SUGID when we exec. Clear it only when
the real and effective user and group ids match. From Tavis Ormandy.

Revision 1.194.4.11 / (download) - annotate - [select for diffs], Mon Oct 31 13:25:31 2005 UTC (17 years, 3 months ago) by tron
Branch: netbsd-3
CVS Tags: netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0
Changes since 1.194.4.10: +7 -4 lines
Diff to previous 1.194.4.10 (colored) to branchpoint 1.194 (colored) next main 1.195 (colored)

Apply patch (requested by dan in ticket #922):
Don't clear unconditionally P_SUGID when we exec. Clear it only when
the real and effective user and group ids match. From Tavis Ormandy.

Revision 1.211 / (download) - annotate - [select for diffs], Mon Oct 31 04:39:41 2005 UTC (17 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, ktrace-lwp-base
Changes since 1.210: +23 -24 lines
Diff to previous 1.210 (colored)

back out the lwp portion of the previous commit which is not ready yet to
be committed.

Revision 1.210 / (download) - annotate - [select for diffs], Mon Oct 31 04:31:58 2005 UTC (17 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.209: +31 -27 lines
Diff to previous 1.209 (colored)

Don't clear unconditionally P_SUGID when we exec. Clear it only when the
real and effective user and group ids match. From Tavis Ormandy.

Revision 1.194.4.10 / (download) - annotate - [select for diffs], Sun Sep 18 20:09:50 2005 UTC (17 years, 4 months ago) by tron
Branch: netbsd-3
Changes since 1.194.4.9: +6 -3 lines
Diff to previous 1.194.4.9 (colored) to branchpoint 1.194 (colored)

Pull up following revision(s) (requested by fvdl in ticket #798):
	sys/compat/sunos/sunos_exec.c: revision 1.47
	sys/compat/pecoff/pecoff_emul.c: revision 1.11
	sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.45
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.12
	sys/sys/proc.h: revision 1.198
	sys/compat/mach/mach_exec.c: revision 1.56
	sys/compat/freebsd/freebsd_exec.c: revision 1.27
	sys/arch/sparc64/include/vmparam.h: revision 1.27
	sys/kern/kern_resource.c: revision 1.91
	sys/compat/netbsd32/netbsd32_netbsd.c: revision 1.88
	sys/compat/osf1/osf1_exec.c: revision 1.39
	sys/compat/svr4_32/svr4_32_resource.c: revision 1.5
	sys/compat/ultrix/ultrix_misc.c: revision 1.99
	sys/compat/svr4_32/svr4_32_exec.h: revision 1.9
	sys/kern/exec_elf32.c: revision 1.103
	sys/compat/aoutm68k/aoutm68k_exec.c: revision 1.19
	sys/compat/sunos32/sunos32_exec.c: revision 1.20
	sys/compat/hpux/hpux_exec.c: revision 1.46
	sys/compat/darwin/darwin_exec.c: revision 1.40
	sys/kern/sysv_shm.c: revision 1.83
	sys/uvm/uvm_extern.h: revision 1.99
	sys/uvm/uvm_mmap.c: revision 1.89
	sys/kern/kern_exec.c: revision 1.195
	sys/compat/netbsd32/netbsd32.h: revision 1.31
	sys/arch/sparc64/sparc64/svr4_32_machdep.c: revision 1.20
	sys/compat/svr4/svr4_exec.c: revision 1.56
	sys/compat/irix/irix_exec.c: revision 1.41
	sys/compat/ibcs2/ibcs2_exec.c: revision 1.63
	sys/compat/svr4_32/svr4_32_exec.c: revision 1.16
	sys/arch/amd64/include/vmparam.h: revision 1.8
	sys/compat/linux/common/linux_exec.c: revision 1.73
Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.
* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
  that will return the default VM map address. The default function
  is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
  macro. This gives emulations control over the default map address,
  and allows things to be mapped at the right address (in 32bit range)
  for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
  or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
  instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2
Tested on amd64, compile-tested on sparc64.

Revision 1.194.4.9 / (download) - annotate - [select for diffs], Thu Sep 8 21:06:31 2005 UTC (17 years, 4 months ago) by tron
Branch: netbsd-3
Changes since 1.194.4.8: +5 -7 lines
Diff to previous 1.194.4.8 (colored) to branchpoint 1.194 (colored)

Apply patch (requested by elad in ticket #740):
Defopt VERIFIED_EXEC.

Revision 1.194.4.8 / (download) - annotate - [select for diffs], Tue Aug 23 14:45:20 2005 UTC (17 years, 5 months ago) by tron
Branch: netbsd-3
Changes since 1.194.4.7: +7 -5 lines
Diff to previous 1.194.4.7 (colored) to branchpoint 1.194 (colored)

Backout ticket 685. It causes build failures.

Revision 1.194.4.7 / (download) - annotate - [select for diffs], Tue Aug 23 13:43:48 2005 UTC (17 years, 5 months ago) by tron
Branch: netbsd-3
Changes since 1.194.4.6: +5 -7 lines
Diff to previous 1.194.4.6 (colored) to branchpoint 1.194 (colored)

Pull up revision 1.205 (requested by elad in ticket #685):
defopt verified_exec.

Revision 1.209 / (download) - annotate - [select for diffs], Fri Aug 19 02:04:03 2005 UTC (17 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: yamt-vop-base2, yamt-vop-base, thorpej-vnode-attr-base, thorpej-vnode-attr
Branch point for: yamt-vop
Changes since 1.208: +8 -4 lines
Diff to previous 1.208 (colored)

Better debugging info on failure

Revision 1.208 / (download) - annotate - [select for diffs], Fri Aug 5 11:14:32 2005 UTC (17 years, 5 months ago) by junyoung
Branch: MAIN
Changes since 1.207: +3 -3 lines
Diff to previous 1.207 (colored)

Use NULL where appropriate.

Revision 1.194.4.6 / (download) - annotate - [select for diffs], Thu Aug 4 18:16:13 2005 UTC (17 years, 5 months ago) by tron
Branch: netbsd-3
Changes since 1.194.4.5: +3 -5 lines
Diff to previous 1.194.4.5 (colored) to branchpoint 1.194 (colored)

Pull up revision 1.207 (requested by elad in ticket #633):
Simplify previous commit.

Revision 1.194.4.5 / (download) - annotate - [select for diffs], Thu Aug 4 18:14:56 2005 UTC (17 years, 5 months ago) by tron
Branch: netbsd-3
Changes since 1.194.4.4: +3 -2 lines
Diff to previous 1.194.4.4 (colored) to branchpoint 1.194 (colored)

Pull up revision 1.206 (requested by elad in ticket #633):
Use real executed program in logs instead of the script that was executed.
For example, this used to give false logs of matching fingerprint for
foo.sh while foo.sh don't have an entry, and the program executed (and
matching the fingerprint) is the interpreter - /bin/sh.

Revision 1.207 / (download) - annotate - [select for diffs], Fri Jul 29 22:57:34 2005 UTC (17 years, 6 months ago) by elad
Branch: MAIN
Changes since 1.206: +3 -5 lines
Diff to previous 1.206 (colored)

Simplify previous commit.

Revision 1.206 / (download) - annotate - [select for diffs], Fri Jul 29 22:37:11 2005 UTC (17 years, 6 months ago) by elad
Branch: MAIN
Changes since 1.205: +5 -4 lines
Diff to previous 1.205 (colored)

Use real executed program in logs instead of the script that was executed.

For example, this used to give false logs of matching fingerprint for
foo.sh while foo.sh don't have an entry, and the program executed (and
matching the fingerprint) is the interpreter - /bin/sh.

Revision 1.205 / (download) - annotate - [select for diffs], Sat Jul 16 22:47:18 2005 UTC (17 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.204: +5 -7 lines
Diff to previous 1.204 (colored)

defopt verified_exec.

Revision 1.204 / (download) - annotate - [select for diffs], Mon Jul 11 20:15:26 2005 UTC (17 years, 6 months ago) by cube
Branch: MAIN
Changes since 1.203: +30 -14 lines
Diff to previous 1.203 (colored)

Split sys_execve() and add execve1() that does most of the work, and takes
as an argument a function that will retrieve an element of the pointer
arrays in user space.  This allows COMPAT_NETBSD32 to share the code for
the emulated version of execve(2), and fixes various issues that came from
the slow drift between the two implementations.

Note:  when splitting up a syscall function, I'll use two different ways
       of naming the resulting helper function.  If it stills does
       copyin/out operations, it will be named <syscall>1().  If it does
       not (as it was the case for get/setitimer), it will be named
       do<syscall>.

Revision 1.203 / (download) - annotate - [select for diffs], Sun Jul 10 04:20:34 2005 UTC (17 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.202: +6 -2 lines
Diff to previous 1.202 (colored)

define syscall here.

Revision 1.202 / (download) - annotate - [select for diffs], Sun Jul 10 00:54:54 2005 UTC (17 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.201: +2 -7 lines
Diff to previous 1.201 (colored)

don't declare syscall and syscall_intern.

Revision 1.194.4.4 / (download) - annotate - [select for diffs], Sat Jul 2 18:50:06 2005 UTC (17 years, 6 months ago) by tron
Branch: netbsd-3
Changes since 1.194.4.3: +1 -33 lines
Diff to previous 1.194.4.3 (colored) to branchpoint 1.194 (colored)

Backout revision (requested by elad in ticket #487):
Backout systrace related changes. Only the the verified exec subsystem
fix which was accidentally committed with these changes should have been
pulled up.

Revision 1.194.4.3 / (download) - annotate - [select for diffs], Sat Jul 2 17:53:32 2005 UTC (17 years, 6 months ago) by tron
Branch: netbsd-3
Changes since 1.194.4.2: +37 -5 lines
Diff to previous 1.194.4.2 (colored) to branchpoint 1.194 (colored)

Pull up revision 1.200 (requested by elad in ticket #487):
From marius@openbsd:
Add an exec message so that whenever a set-uid/gid process executes a new
image which we may control, the exec does not go by unnoticed.

Revision 1.201 / (download) - annotate - [select for diffs], Mon Jun 27 17:11:21 2005 UTC (17 years, 7 months ago) by elad
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.200: +6 -3 lines
Diff to previous 1.200 (colored)

From marius@openbsd:

Fix an issue when scripts are executed under systrace where the argv[0]
would be normalized, and hence break scripts that depend on how they were
called.

Revision 1.200 / (download) - annotate - [select for diffs], Sun Jun 26 19:58:29 2005 UTC (17 years, 7 months ago) by elad
Branch: MAIN
Changes since 1.199: +39 -7 lines
Diff to previous 1.199 (colored)

From marius@openbsd:

Add an exec message so that whenever a set-uid/gid process executes a new
image which we may control, the exec does not go by unnoticed.

Revision 1.194.4.2 / (download) - annotate - [select for diffs], Sat Jun 11 08:53:53 2005 UTC (17 years, 7 months ago) by tron
Branch: netbsd-3
Changes since 1.194.4.1: +1 -2 lines
Diff to previous 1.194.4.1 (colored) to branchpoint 1.194 (colored)

Pull up revision 1.199 (requested by elad in ticket #443):
Use the defined VERIEXEC_DIRECT instead of the (incorrect) 0 magic number.

Revision 1.199 / (download) - annotate - [select for diffs], Fri Jun 10 23:32:16 2005 UTC (17 years, 7 months ago) by elad
Branch: MAIN
Changes since 1.198: +3 -4 lines
Diff to previous 1.198 (colored)

Use the defined VERIEXEC_DIRECT instead of the (incorrect) 0 magic number.

Revision 1.194.4.1 / (download) - annotate - [select for diffs], Fri Jun 10 14:48:28 2005 UTC (17 years, 7 months ago) by tron
Branch: netbsd-3
Changes since 1.194: +7 -3 lines
Diff to previous 1.194 (colored)

Pull up revision 1.197 (requested by elad in ticket #389):
Rototill of the verified exec functionality.
* We now use hash tables instead of a list to store the in kernel
fingerprints.
* Fingerprint methods handling has been made more flexible, it is now
even simpler to add new methods.
* the loader no longer passes in magic numbers representing the
fingerprint method so veriexecctl is not longer kernel specific.
* fingerprint methods can be tailored out using options in the kernel
config file.
* more fingerprint methods added - rmd160, sha256/384/512
* veriexecctl can now report the fingerprint methods supported by the
running kernel.
* regularised the naming of some portions of veriexec.

Revision 1.198 / (download) - annotate - [select for diffs], Sun May 29 22:24:15 2005 UTC (17 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.197: +4 -3 lines
Diff to previous 1.197 (colored)

- add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.

Revision 1.191.4.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:29:23 2005 UTC (17 years, 9 months ago) by kent
Branch: kent-audio2
Changes since 1.191: +18 -10 lines
Diff to previous 1.191 (colored) next main 1.192 (colored)

sync with -current

Revision 1.197 / (download) - annotate - [select for diffs], Wed Apr 20 13:44:46 2005 UTC (17 years, 9 months ago) by blymn
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.196: +7 -3 lines
Diff to previous 1.196 (colored)

Rototill of the verified exec functionality.
  * We now use hash tables instead of a list to store the in kernel
    fingerprints.
  * Fingerprint methods handling has been made more flexible, it is now
    even simpler to add new methods.
  * the loader no longer passes in magic numbers representing the
    fingerprint method so veriexecctl is not longer kernel specific.
  * fingerprint methods can be tailored out using options in the kernel
    config file.
  * more fingerprint methods added - rmd160, sha256/384/512
  * veriexecctl can now report the fingerprint methods supported by the
    running kernel.
  * regularised the naming of some portions of veriexec.

Revision 1.169.2.9 / (download) - annotate - [select for diffs], Fri Apr 1 14:30:56 2005 UTC (17 years, 10 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.169.2.8: +11 -7 lines
Diff to previous 1.169.2.8 (colored)

Sync with HEAD.

Revision 1.196 / (download) - annotate - [select for diffs], Fri Apr 1 11:59:37 2005 UTC (17 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.195: +7 -6 lines
Diff to previous 1.195 (colored)

merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.

Revision 1.191.6.4 / (download) - annotate - [select for diffs], Sat Mar 26 18:19:20 2005 UTC (17 years, 10 months ago) by yamt
Branch: yamt-km
Changes since 1.191.6.3: +6 -3 lines
Diff to previous 1.191.6.3 (colored) to branchpoint 1.191 (colored) next main 1.192 (colored)

sync with head.

Revision 1.195 / (download) - annotate - [select for diffs], Sat Mar 26 05:12:36 2005 UTC (17 years, 10 months ago) by fvdl
Branch: MAIN
CVS Tags: yamt-km-base4
Changes since 1.194: +6 -3 lines
Diff to previous 1.194 (colored)

Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.

* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
  that will return the default VM map address. The default function
  is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
  macro. This gives emulations control over the default map address,
  and allows things to be mapped at the right address (in 32bit range)
  for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
  or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
  instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2

Tested on amd64, compile-tested on sparc64.

Revision 1.191.6.3 / (download) - annotate - [select for diffs], Sat Mar 19 08:36:11 2005 UTC (17 years, 10 months ago) by yamt
Branch: yamt-km
Changes since 1.191.6.2: +3 -3 lines
Diff to previous 1.191.6.2 (colored) to branchpoint 1.191 (colored)

sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.169.2.8 / (download) - annotate - [select for diffs], Fri Mar 4 16:51:58 2005 UTC (17 years, 10 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.169.2.7: +3 -3 lines
Diff to previous 1.169.2.7 (colored)

Sync with HEAD.

Hi Perry!

Revision 1.194 / (download) - annotate - [select for diffs], Fri Feb 18 00:21:37 2005 UTC (17 years, 11 months ago) by peter
Branch: MAIN
CVS Tags: yamt-km-base3, netbsd-3-base
Branch point for: netbsd-3
Changes since 1.193: +3 -3 lines
Diff to previous 1.193 (colored)

Remove one repeated word.  From Martin Vٻiard.

Revision 1.169.2.7 / (download) - annotate - [select for diffs], Tue Feb 15 21:33:29 2005 UTC (17 years, 11 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.169.2.6: +3 -3 lines
Diff to previous 1.169.2.6 (colored)

Sync with HEAD.

Revision 1.191.6.2 / (download) - annotate - [select for diffs], Sat Feb 12 18:17:52 2005 UTC (17 years, 11 months ago) by yamt
Branch: yamt-km
Changes since 1.191.6.1: +3 -3 lines
Diff to previous 1.191.6.1 (colored) to branchpoint 1.191 (colored)

sync with head.

Revision 1.193 / (download) - annotate - [select for diffs], Sat Feb 12 09:38:25 2005 UTC (17 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: yamt-km-base2
Changes since 1.192: +3 -3 lines
Diff to previous 1.192 (colored)

vm_map_max needs a struct pointer, so add a missing deref here

Revision 1.192 / (download) - annotate - [select for diffs], Fri Feb 11 02:12:03 2005 UTC (17 years, 11 months ago) by chs
Branch: MAIN
Changes since 1.191: +3 -3 lines
Diff to previous 1.191 (colored)

use vm_map_{min,max}() instead of dereferencing the vm_map pointer directly.
define and use vm_map_set{min,max}() for modifying these values.
remove the {min,max}_offset aliases for these vm_map fields to be more
namespace-friendly.  PR 26475.

Revision 1.191.6.1 / (download) - annotate - [select for diffs], Tue Jan 25 12:59:35 2005 UTC (18 years ago) by yamt
Branch: yamt-km
Changes since 1.191: +7 -6 lines
Diff to previous 1.191 (colored)

convert to new apis.

Revision 1.169.2.6 / (download) - annotate - [select for diffs], Mon Jan 24 08:59:40 2005 UTC (18 years ago) by skrll
Branch: ktrace-lwp
Changes since 1.169.2.5: +4 -4 lines
Diff to previous 1.169.2.5 (colored)

Adapt to branch.

Revision 1.169.2.5 / (download) - annotate - [select for diffs], Tue Oct 19 15:58:03 2004 UTC (18 years, 3 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.169.2.4: +3 -3 lines
Diff to previous 1.169.2.4 (colored)

Sync with HEAD

Revision 1.191 / (download) - annotate - [select for diffs], Fri Oct 1 16:30:52 2004 UTC (18 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Changes since 1.190: +3 -3 lines
Diff to previous 1.190 (colored)

introduce a function, proclist_foreach_call, to iterate all procs on
a proclist and call the specified function for each of them.
primarily to fix a procfs locking problem, but i think that it's useful for
others as well.

while i'm here, introduce PROCLIST_FOREACH macro, which is similar to
LIST_FOREACH but skips marker entries which are used by proclist_foreach_call.

Revision 1.169.2.4 / (download) - annotate - [select for diffs], Tue Sep 21 13:35:03 2004 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.169.2.3: +24 -22 lines
Diff to previous 1.169.2.3 (colored)

Fix the sync with head I botched.

Revision 1.169.2.3 / (download) - annotate - [select for diffs], Sat Sep 18 14:53:02 2004 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.169.2.2: +27 -29 lines
Diff to previous 1.169.2.2 (colored)

Sync with HEAD.

Revision 1.190 / (download) - annotate - [select for diffs], Fri Sep 17 14:11:25 2004 UTC (18 years, 4 months ago) by skrll
Branch: MAIN
Changes since 1.189: +3 -3 lines
Diff to previous 1.189 (colored)

There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe

Revision 1.189 / (download) - annotate - [select for diffs], Fri Sep 10 06:09:15 2004 UTC (18 years, 4 months ago) by jdolecek
Branch: MAIN
Changes since 1.188: +4 -4 lines
Diff to previous 1.188 (colored)

fix/adjust comment a little

Revision 1.169.2.2 / (download) - annotate - [select for diffs], Tue Aug 3 10:52:44 2004 UTC (18 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.169.2.1: +155 -63 lines
Diff to previous 1.169.2.1 (colored)

Sync with HEAD

Revision 1.188 / (download) - annotate - [select for diffs], Sun Jul 18 21:29:26 2004 UTC (18 years, 6 months ago) by chs
Branch: MAIN
Changes since 1.187: +15 -6 lines
Diff to previous 1.187 (colored)

add support for hppa to the MI scheduler activations kernel code:
 - on hppa the stack grows up, so handle that using the STACK_* macros.

Revision 1.185.2.2 / (download) - annotate - [select for diffs], Sun Jun 27 13:33:52 2004 UTC (18 years, 7 months ago) by he
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE
Branch point for: netbsd-2-1, netbsd-2
Changes since 1.185.2.1: +14 -2 lines
Diff to previous 1.185.2.1 (colored) to branchpoint 1.185 (colored)

Pull up revision 1.187 (requested by chs in ticket #558):
  Add a workaround for PR#25664, which describes a failure
  to map sigcode for Tru64 binaries.

Revision 1.185.2.1 / (download) - annotate - [select for diffs], Sun Jun 27 13:28:00 2004 UTC (18 years, 7 months ago) by he
Branch: netbsd-2-0
Changes since 1.185: +12 -14 lines
Diff to previous 1.185 (colored)

Pull up revision 1.186 (requested by chs in ticket #557):
  Rearrange the handling of p_textvp so that the ref-counting
  is correct.  Fixes PR#35663.

Revision 1.187 / (download) - annotate - [select for diffs], Sun Jun 27 00:55:08 2004 UTC (18 years, 7 months ago) by chs
Branch: MAIN
Changes since 1.186: +14 -2 lines
Diff to previous 1.186 (colored)

add a workaround for PR 25664 (failure to map sigcode for Tru64 binaries).

Revision 1.186 / (download) - annotate - [select for diffs], Sun Jun 27 00:41:03 2004 UTC (18 years, 7 months ago) by chs
Branch: MAIN
Changes since 1.185: +12 -14 lines
Diff to previous 1.185 (colored)

rearrange the handling of p_textvp so that the ref-counting is correct.
fixes PR 25663.

Revision 1.185 / (download) - annotate - [select for diffs], Fri Mar 26 17:13:37 2004 UTC (18 years, 10 months ago) by drochner
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.184: +4 -4 lines
Diff to previous 1.184 (colored)

all ports define __HAVE_SIGINFO now, so remove the CPP conditionals

Revision 1.184 / (download) - annotate - [select for diffs], Thu Mar 25 18:29:24 2004 UTC (18 years, 10 months ago) by drochner
Branch: MAIN
Changes since 1.183: +5 -4 lines
Diff to previous 1.183 (colored)

In exec_sigcode_map(), do nothing if the sigcode is of
size 0.
This way, individual ports can circumvent sigcode mapping
by setting sigcode/esigcode.
(would be better to clean up the __HAVE_SIGINFO/COMPAT_XX
stuff, but it is not a good moment now)

Revision 1.183 / (download) - annotate - [select for diffs], Fri Mar 5 11:30:50 2004 UTC (18 years, 10 months ago) by junyoung
Branch: MAIN
Changes since 1.182: +19 -19 lines
Diff to previous 1.182 (colored)

Drop trailing spaces.

Revision 1.182 / (download) - annotate - [select for diffs], Fri Feb 6 08:02:59 2004 UTC (18 years, 11 months ago) by junyoung
Branch: MAIN
Changes since 1.181: +6 -6 lines
Diff to previous 1.181 (colored)

Rename es_check in struct execsw to es_makecmds.

Revision 1.181 / (download) - annotate - [select for diffs], Thu Feb 5 22:26:52 2004 UTC (18 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.180: +3 -3 lines
Diff to previous 1.180 (colored)

Don't use uao_reference, directly use the pgops instead. XXX: we should
prolly make all the uao_ functions used in pgops static.

Revision 1.180 / (download) - annotate - [select for diffs], Sat Dec 20 19:01:30 2003 UTC (19 years, 1 month ago) by fvdl
Branch: MAIN
Changes since 1.179: +3 -2 lines
Diff to previous 1.179 (colored)

Put back Emmanuel's sigfilter hooks, as decided by Core.

Revision 1.179 / (download) - annotate - [select for diffs], Sat Dec 20 18:22:17 2003 UTC (19 years, 1 month ago) by manu
Branch: MAIN
Changes since 1.178: +4 -2 lines
Diff to previous 1.178 (colored)

Introduce lwp_emuldata and the associated hooks. No hook is provided for the
exec case, as the emulation already has the ability to intercept that
with the e_proc_exec hook. It is the responsability of the emulation to
take appropriaye action about lwp_emuldata in e_proc_exec.

Patch reviewed by Christos.

Revision 1.178 / (download) - annotate - [select for diffs], Fri Dec 5 21:12:43 2003 UTC (19 years, 1 month ago) by jdolecek
Branch: MAIN
Changes since 1.177: +0 -1 lines
Diff to previous 1.177 (colored)

back the sigfilter emulation hook change off

Revision 1.177 / (download) - annotate - [select for diffs], Wed Dec 3 20:24:51 2003 UTC (19 years, 1 month ago) by manu
Branch: MAIN
Changes since 1.176: +3 -2 lines
Diff to previous 1.176 (colored)

Add a sigfilter emulation hook. It is used at the beginning of kpsignal2()
so that a specific emulation has the oportunity to filter out some signals.

if sigfilter returns 0, then no signal is sent by kpsignal2().

There is another place where signals can be generated: trapsignal. Since this
function is already an emulation hook, no call to the sigfilter hook was
introduced in trapsignal.

This is needed to emulate the softsignal feature in COMPAT_DARWIN (signals
sent as Mach exception messages)

Revision 1.176 / (download) - annotate - [select for diffs], Mon Nov 17 22:52:09 2003 UTC (19 years, 2 months ago) by cl
Branch: MAIN
Changes since 1.175: +4 -8 lines
Diff to previous 1.175 (colored)

- use list to keep track of free stacks.
- use splay tree for the pagefault check if the thread was running on
  an upcall stack.

=> removes the limitation that all upcall stacks need to be
   adjoining and that all upcall stacks have to be loaded with the
   1st sys_sa_stacks call.
=> enables keeping information associated with a stack in the kernel
   which makes it simpler to find out which LWP is using a stack.
=> allows increasing the SA_MAXNUMSTACKS without having to
   allocate an array of that size.

Revision 1.175 / (download) - annotate - [select for diffs], Wed Nov 12 21:07:38 2003 UTC (19 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.174: +3 -2 lines
Diff to previous 1.174 (colored)

- Count number of zombies and stopped children and requeue them at the top
  of the sibling list so that find_stopped_child can be optimised to avoid
  traversing the entire sibling list - helps when a process has a lot of
  children.
- Modify locking in pfind() and pgfind() to that the caller can rely on the
  result being valid, allow caller to request that zombies be findable.
- Rename pfind() to p_find() to ensure we break binary compatibility.
- Remove svr4_pfind since p_find willnow do the job.
- Modify some of the SMP locking of the proc lists - signals are still stuffed.

Welcome to 1.6ZF

Revision 1.174 / (download) - annotate - [select for diffs], Mon Sep 15 00:33:35 2003 UTC (19 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.173: +3 -2 lines
Diff to previous 1.173 (colored)

include opt_compat_netbsd.h, otherwise we don't get the right signal
trampoline code in compat code.

Revision 1.173 / (download) - annotate - [select for diffs], Wed Sep 10 16:43:35 2003 UTC (19 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.172: +12 -4 lines
Diff to previous 1.172 (colored)

we don't need sigreturn and sigcode glue if we are not compat_16 anymore.

Revision 1.172 / (download) - annotate - [select for diffs], Fri Aug 29 13:29:32 2003 UTC (19 years, 5 months ago) by enami
Branch: MAIN
Changes since 1.171: +4 -4 lines
Diff to previous 1.171 (colored)

Use VM_DEFAULT_ADDRESS as a hint to map sigcode instead of an equivalent
value of !TOPDOWN_VM case.

Revision 1.171 / (download) - annotate - [select for diffs], Sun Aug 24 17:52:47 2003 UTC (19 years, 5 months ago) by chs
Branch: MAIN
Changes since 1.170: +73 -18 lines
Diff to previous 1.170 (colored)

add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default.  the changes
fall into two basic catagories:

 - pmap and trap-handler changes.  these are all MD:
   = alpha: we already track per-page execute permission with the (software)
	PG_EXEC bit, so just have the trap handler pay attention to it.
   = i386: use a new GDT segment for %cs for processes that have no
	executable mappings above a certain threshold (currently the
	bottom of the stack).  track per-page execute permission with
	the last unused PTE bit.
   = powerpc/ibm4xx: just use the hardware exec bit.
   = powerpc/oea: we already track per-page exec bits, but the hardware only
	implements non-exec mappings at the segment level.  so track the
	number of executable mappings in each segment and turn on the no-exec
	segment bit iff the count is 0.  adjust the trap handler to deal.
   = sparc (sun4m): fix our use of the hardware protection bits.
	fix the trap handler to recognize text faults.
   = sparc64: split the existing unified TSB into data and instruction TSBs,
	and only load TTEs into the appropriate TSB(s) for the permissions.
	fix the trap handler to check for execute permission.
   = not yet implemented: amd64, hppa, sh5

 - changes in all the emulations that put a signal trampoline on the stack.
   instead, we now put the trampoline into a uvm_aobj and map that into
   the process separately.

originally from openbsd, adapted for netbsd by me.

Revision 1.170 / (download) - annotate - [select for diffs], Wed Jul 16 22:42:48 2003 UTC (19 years, 6 months ago) by dsl
Branch: MAIN
Changes since 1.169: +10 -2 lines
Diff to previous 1.169 (colored)

Add ktrace of env and args during exec.

Revision 1.169.2.1 / (download) - annotate - [select for diffs], Wed Jul 2 15:26:36 2003 UTC (19 years, 7 months ago) by darrenr
Branch: ktrace-lwp
Changes since 1.169: +26 -24 lines
Diff to previous 1.169 (colored)

Apply the aborted ktrace-lwp changes to a specific branch.  This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it.  This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.

Revision 1.169 / (download) - annotate - [select for diffs], Sun Jun 29 22:31:19 2003 UTC (19 years, 7 months ago) by fvdl
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.168: +22 -24 lines
Diff to previous 1.168 (colored)

Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.

Revision 1.168 / (download) - annotate - [select for diffs], Sat Jun 28 14:21:53 2003 UTC (19 years, 7 months ago) by darrenr
Branch: MAIN
Changes since 1.167: +26 -24 lines
Diff to previous 1.167 (colored)

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V

Revision 1.167 / (download) - annotate - [select for diffs], Thu Apr 10 20:57:01 2003 UTC (19 years, 9 months ago) by manu
Branch: MAIN
Changes since 1.166: +3 -3 lines
Diff to previous 1.166 (colored)

typo

Revision 1.166 / (download) - annotate - [select for diffs], Thu Apr 10 19:38:26 2003 UTC (19 years, 9 months ago) by manu
Branch: MAIN
Changes since 1.165: +3 -3 lines
Diff to previous 1.165 (colored)

Prefer C comments instead of C++ like comments

Revision 1.165 / (download) - annotate - [select for diffs], Sat Feb 1 06:23:43 2003 UTC (19 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.164: +4 -2 lines
Diff to previous 1.164 (colored)

Add extensible malloc types, adapted from FreeBSD.  This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.

Revision 1.164 / (download) - annotate - [select for diffs], Sat Jan 18 10:06:25 2003 UTC (20 years ago) by thorpej
Branch: MAIN
Changes since 1.163: +44 -9 lines
Diff to previous 1.163 (colored)

Merge the nathanw_sa branch.

Revision 1.163.2.2 / (download) - annotate - [select for diffs], Thu Dec 19 05:22:11 2002 UTC (20 years, 1 month ago) by gmcgarry
Branch: gmcgarry_ucred
Changes since 1.163.2.1: +14 -17 lines
Diff to previous 1.163.2.1 (colored) to branchpoint 1.163 (colored) next main 1.164 (colored)

Try harder to share credentials on exec.  From David Laight.

Revision 1.163.2.1 / (download) - annotate - [select for diffs], Wed Dec 18 01:06:06 2002 UTC (20 years, 1 month ago) by gmcgarry
Branch: gmcgarry_ucred
Changes since 1.163: +9 -5 lines
Diff to previous 1.163 (colored)

Merge pcred and ucred, and poolify.  TBD: check backward compatibility
and factor-out some higher-level functionality.

Revision 1.138.2.20 / (download) - annotate - [select for diffs], Wed Dec 11 06:43:02 2002 UTC (20 years, 1 month ago) by thorpej
Branch: nathanw_sa
CVS Tags: nathanw_sa_end
Changes since 1.138.2.19: +38 -8 lines
Diff to previous 1.138.2.19 (colored) to branchpoint 1.138 (colored) next main 1.139 (colored)

Sync with HEAD.

Revision 1.163 / (download) - annotate - [select for diffs], Sun Nov 17 22:53:46 2002 UTC (20 years, 2 months ago) by chs
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Branch point for: gmcgarry_ucred
Changes since 1.162: +38 -8 lines
Diff to previous 1.162 (colored)

add support for __MACHINE_STACK_GROWS_UP platforms.  from fredette@

Revision 1.138.2.19 / (download) - annotate - [select for diffs], Tue Nov 12 20:11:04 2002 UTC (20 years, 2 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.18: +6 -3 lines
Diff to previous 1.138.2.18 (colored) to branchpoint 1.138 (colored)

LWPify P_STOPEXEC code.

Revision 1.138.2.18 / (download) - annotate - [select for diffs], Mon Nov 11 22:13:39 2002 UTC (20 years, 2 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.17: +35 -2 lines
Diff to previous 1.138.2.17 (colored) to branchpoint 1.138 (colored)

Catch up to -current

Revision 1.162 / (download) - annotate - [select for diffs], Thu Nov 7 00:22:30 2002 UTC (20 years, 2 months ago) by manu
Branch: MAIN
Changes since 1.161: +14 -2 lines
Diff to previous 1.161 (colored)

Added two sysctl-able flags: proc.curproc.stopfork and proc.curproc.stopexec
that can be used to block a process after fork(2) or exec(2) calls. The
new process is created in the SSTOP state and is never scheduled for running.

This feature is designed so that it is esay to attach the process using gdb
before it has done anything.

It works also with sproc, kthread_create, clone...

Revision 1.161 / (download) - annotate - [select for diffs], Fri Nov 1 19:27:05 2002 UTC (20 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.160: +3 -3 lines
Diff to previous 1.160 (colored)

set emul_netbsd's e_nsysent to SYS_NSYSENT, not SYS_MAXSYSCALL

Revision 1.160 / (download) - annotate - [select for diffs], Tue Oct 29 12:31:23 2002 UTC (20 years, 3 months ago) by blymn
Branch: MAIN
Changes since 1.159: +21 -3 lines
Diff to previous 1.159 (colored)

Added support for fingerprinted executables aka verified exec

Revision 1.159 / (download) - annotate - [select for diffs], Wed Oct 23 09:14:15 2002 UTC (20 years, 3 months ago) by jdolecek
Branch: MAIN
CVS Tags: kqueue-aftermerge
Changes since 1.158: +5 -2 lines
Diff to previous 1.158 (colored)

merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe

Revision 1.138.2.17 / (download) - annotate - [select for diffs], Fri Oct 18 02:44:51 2002 UTC (20 years, 3 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.16: +9 -7 lines
Diff to previous 1.138.2.16 (colored) to branchpoint 1.138 (colored)

Catch up to -current.

Revision 1.142.2.7 / (download) - annotate - [select for diffs], Thu Oct 10 18:43:05 2002 UTC (20 years, 3 months ago) by jdolecek
Branch: kqueue
Changes since 1.142.2.6: +6 -4 lines
Diff to previous 1.142.2.6 (colored) next main 1.143 (colored)

sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.158 / (download) - annotate - [select for diffs], Tue Oct 8 15:50:11 2002 UTC (20 years, 3 months ago) by junyoung
Branch: MAIN
CVS Tags: kqueue-beforemerge
Changes since 1.157: +7 -7 lines
Diff to previous 1.157 (colored)

- char * -> caddr_t
- Fix typo.

Revision 1.157 / (download) - annotate - [select for diffs], Fri Sep 27 15:37:43 2002 UTC (20 years, 4 months ago) by provos
Branch: MAIN
CVS Tags: kqueue-base
Changes since 1.156: +4 -4 lines
Diff to previous 1.156 (colored)

remove trailing \n in panic().  approved perry.

Revision 1.156 / (download) - annotate - [select for diffs], Sat Sep 21 21:15:02 2002 UTC (20 years, 4 months ago) by manu
Branch: MAIN
Changes since 1.155: +4 -2 lines
Diff to previous 1.155 (colored)

- Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.

- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports

- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));

- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.

Revision 1.138.2.16 / (download) - annotate - [select for diffs], Tue Sep 17 21:22:01 2002 UTC (20 years, 4 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.15: +8 -0 lines
Diff to previous 1.138.2.15 (colored) to branchpoint 1.138 (colored)

Catch up to -current.

Revision 1.142.2.6 / (download) - annotate - [select for diffs], Fri Sep 6 08:47:46 2002 UTC (20 years, 4 months ago) by jdolecek
Branch: kqueue
Changes since 1.142.2.5: +17 -7 lines
Diff to previous 1.142.2.5 (colored)

sync kqueue branch with HEAD

Revision 1.152.2.1 / (download) - annotate - [select for diffs], Thu Aug 29 05:23:06 2002 UTC (20 years, 5 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.152: +17 -7 lines
Diff to previous 1.152 (colored) next main 1.153 (colored)

catch up with -current.

Revision 1.155 / (download) - annotate - [select for diffs], Wed Aug 28 07:16:35 2002 UTC (20 years, 5 months ago) by gmcgarry
Branch: MAIN
CVS Tags: gehenna-devsw-base
Changes since 1.154: +10 -2 lines
Diff to previous 1.154 (colored)

MI kernel support for user-level Restartable Atomic Sequences (RAS).

Revision 1.138.2.15 / (download) - annotate - [select for diffs], Tue Aug 27 23:47:22 2002 UTC (20 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.14: +9 -7 lines
Diff to previous 1.138.2.14 (colored) to branchpoint 1.138 (colored)

Catch up to -current.

Revision 1.154 / (download) - annotate - [select for diffs], Mon Aug 26 21:07:39 2002 UTC (20 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.153: +4 -4 lines
Diff to previous 1.153 (colored)

- Implement passing AT_{R,E}{U,G}ID in the elf aux vector.
- Pass struct proc to copyargs
- fix svr4_copyargs functions

Revision 1.153 / (download) - annotate - [select for diffs], Sun Aug 25 21:18:15 2002 UTC (20 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.152: +7 -5 lines
Diff to previous 1.152 (colored)

Fix some signed/unsigned comparison warnings from GCC 3.3.

Revision 1.138.2.14 / (download) - annotate - [select for diffs], Sat Jul 13 23:27:02 2002 UTC (20 years, 6 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.13: +2 -6 lines
Diff to previous 1.138.2.13 (colored) to branchpoint 1.138 (colored)

Remove comment; this function's head has now been examined.

Revision 1.138.2.13 / (download) - annotate - [select for diffs], Fri Jul 12 03:09:57 2002 UTC (20 years, 6 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.12: +30 -2 lines
Diff to previous 1.138.2.12 (colored) to branchpoint 1.138 (colored)

On exec(), clean up POSIX timers, scheduler activations state, and LWPs
other than the caller.

Revision 1.138.2.12 / (download) - annotate - [select for diffs], Fri Jul 12 01:40:14 2002 UTC (20 years, 6 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.11: +2 -3 lines
Diff to previous 1.138.2.11 (colored) to branchpoint 1.138 (colored)

No longer need to pull in lwp.h; proc.h pulls it in for us.

Revision 1.142.2.5 / (download) - annotate - [select for diffs], Sun Jun 23 17:49:27 2002 UTC (20 years, 7 months ago) by jdolecek
Branch: kqueue
Changes since 1.142.2.4: +8 -4 lines
Diff to previous 1.142.2.4 (colored)

catch up with -current on kqueue branch

Revision 1.138.2.11 / (download) - annotate - [select for diffs], Thu Jun 20 03:47:11 2002 UTC (20 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.10: +6 -2 lines
Diff to previous 1.138.2.10 (colored) to branchpoint 1.138 (colored)

Catch up to -current.

Revision 1.138.2.10 / (download) - annotate - [select for diffs], Wed May 29 21:33:10 2002 UTC (20 years, 8 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.9: +3 -2 lines
Diff to previous 1.138.2.9 (colored) to branchpoint 1.138 (colored)

#include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)

Revision 1.110.4.8 / (download) - annotate - [select for diffs], Fri Apr 26 17:51:39 2002 UTC (20 years, 9 months ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003
Changes since 1.110.4.7: +5 -1 lines
Diff to previous 1.110.4.7 (colored) to branchpoint 1.110 (colored) next main 1.111 (colored)

Pull up revision 1.152 (requested by christos):
  If a set{u,g}id binary is invoked with fd < 3 closed, open those
  file desciptors to /dev/null.

Revision 1.152 / (download) - annotate - [select for diffs], Tue Apr 23 15:11:25 2002 UTC (20 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Branch point for: netbsd-1-6, gehenna-devsw
Changes since 1.151: +6 -2 lines
Diff to previous 1.151 (colored)

From OpenBSD, via FreeBSD: If a set{u,g}id binary is invoked with fd < 3
closed, open those fds to /dev/null.

XXX: This needs to be fixed in a better way. The kernel should not need to
know about /dev/null or special case 0, 1, 2.

Revision 1.138.2.9 / (download) - annotate - [select for diffs], Wed Apr 17 00:06:17 2002 UTC (20 years, 9 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.8: +4 -4 lines
Diff to previous 1.138.2.8 (colored) to branchpoint 1.138 (colored)

Catch up to -current.

Revision 1.151 / (download) - annotate - [select for diffs], Tue Apr 2 20:18:07 2002 UTC (20 years, 10 months ago) by jdolecek
Branch: MAIN
Changes since 1.150: +4 -4 lines
Diff to previous 1.150 (colored)

expose emul_search()

Revision 1.150.4.1 / (download) - annotate - [select for diffs], Sun Mar 17 06:37:51 2002 UTC (20 years, 10 months ago) by thorpej
Branch: newlock
Changes since 1.150: +18 -17 lines
Diff to previous 1.150 (colored) next main 1.151 (colored)

Make the exec_lock an rwlock, and rename it to exec_rwlock.

Revision 1.138.2.8 / (download) - annotate - [select for diffs], Thu Feb 28 04:14:44 2002 UTC (20 years, 11 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.7: +4 -2 lines
Diff to previous 1.138.2.7 (colored) to branchpoint 1.138 (colored)

Catch up to -current.

Revision 1.142.2.4 / (download) - annotate - [select for diffs], Mon Feb 11 20:10:23 2002 UTC (20 years, 11 months ago) by jdolecek
Branch: kqueue
Changes since 1.142.2.3: +15 -3 lines
Diff to previous 1.142.2.3 (colored)

Sync w/ -current.

Revision 1.100.2.5 / (download) - annotate - [select for diffs], Mon Jan 14 15:18:47 2002 UTC (21 years ago) by he
Branch: netbsd-1-4
Changes since 1.100.2.4: +14 -1 lines
Diff to previous 1.100.2.4 (colored) to branchpoint 1.100 (colored) next main 1.101 (colored)

Pull up revisions 1.149-1.150 (via patch, requested by he):
  Fix a ptrace/execve race condition which could be used to modify
  the child process' image during execve.  This would be a security
  issue due to setuid programs.

Revision 1.110.4.7 / (download) - annotate - [select for diffs], Mon Jan 14 10:49:30 2002 UTC (21 years ago) by he
Branch: netbsd-1-5
Changes since 1.110.4.6: +3 -1 lines
Diff to previous 1.110.4.6 (colored) to branchpoint 1.110 (colored)

Pull up revision 1.150 (via patch, requested by christos):
  Fix a ptrace/execve race condition which could be used to modify
  the child process' image during execve.  This would be a security
  issue due to setuid programs.

Revision 1.150 / (download) - annotate - [select for diffs], Sat Jan 12 14:20:30 2002 UTC (21 years ago) by christos
Branch: MAIN
CVS Tags: newlock-base, ifpoll-base, eeh-devprop-base, eeh-devprop
Branch point for: newlock
Changes since 1.149: +4 -2 lines
Diff to previous 1.149 (colored)

Clear the P_INEXEC flag in other labels. Pointed out by he@netbsd.org

Revision 1.110.4.6 / (download) - annotate - [select for diffs], Sat Jan 12 01:02:48 2002 UTC (21 years ago) by he
Branch: netbsd-1-5
Changes since 1.110.4.5: +12 -1 lines
Diff to previous 1.110.4.5 (colored) to branchpoint 1.110 (colored)

Pull up revision 1.149 (via patch, requested by christos):
  Fix a ptrace/execve race condition which could be used to modify
  the child process' image during execve.  This would be a security
  issue due to setuid programs.

Revision 1.138.2.7 / (download) - annotate - [select for diffs], Fri Jan 11 23:39:38 2002 UTC (21 years ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.6: +13 -3 lines
Diff to previous 1.138.2.6 (colored) to branchpoint 1.138 (colored)

More catchup.

Revision 1.149 / (download) - annotate - [select for diffs], Fri Jan 11 21:16:27 2002 UTC (21 years ago) by christos
Branch: MAIN
Changes since 1.148: +13 -3 lines
Diff to previous 1.148 (colored)

Fix a ptrace/execve race that could be used to modify the child process's
image during execve. This is a security issue because one can
do that to setuid programs... From FreeBSD.

Revision 1.142.2.3 / (download) - annotate - [select for diffs], Thu Jan 10 19:59:46 2002 UTC (21 years ago) by thorpej
Branch: kqueue
Changes since 1.142.2.2: +22 -6 lines
Diff to previous 1.142.2.2 (colored)

Sync kqueue branch with -current.

Revision 1.138.2.6 / (download) - annotate - [select for diffs], Tue Jan 8 00:32:32 2002 UTC (21 years ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.5: +16 -6 lines
Diff to previous 1.138.2.5 (colored) to branchpoint 1.138 (colored)

Catch up to -current.

Revision 1.148 / (download) - annotate - [select for diffs], Sat Dec 8 00:35:30 2001 UTC (21 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.147: +6 -2 lines
Diff to previous 1.147 (colored)

Make the coredump routine exec-format/emulation specific.  Split
out traditional NetBSD coredump routines into core_netbsd.c and
netbsd32_core.c (for COMPAT_NETBSD32).

Revision 1.147 / (download) - annotate - [select for diffs], Fri Nov 23 22:02:39 2001 UTC (21 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.146: +12 -6 lines
Diff to previous 1.146 (colored)

if the LKM support is not compiled in, don't bother using exec_lock
at all, it's only needed in LKM case

use #if defined(LKM) || defined(_LKM) condition for netbsd32_execve.c,
to DTRT when either compiled statically into kernel with LKM support,
or compiled as a LKM

Revision 1.138.2.5 / (download) - annotate - [select for diffs], Wed Nov 14 19:16:34 2001 UTC (21 years, 2 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.4: +4 -1 lines
Diff to previous 1.138.2.4 (colored) to branchpoint 1.138 (colored)

Catch up to -current.

Revision 1.145.2.1 / (download) - annotate - [select for diffs], Mon Nov 12 21:18:46 2001 UTC (21 years, 2 months ago) by thorpej
Branch: thorpej-mips-cache
Changes since 1.145: +4 -1 lines
Diff to previous 1.145 (colored) next main 1.146 (colored)

Sync the thorpej-mips-cache branch with -current.

Revision 1.146 / (download) - annotate - [select for diffs], Mon Nov 12 15:25:08 2001 UTC (21 years, 2 months ago) by lukem
Branch: MAIN
CVS Tags: thorpej-mips-cache-base
Changes since 1.145: +4 -1 lines
Diff to previous 1.145 (colored)

add RCSIDs

Revision 1.144.2.2 / (download) - annotate - [select for diffs], Mon Oct 1 12:46:49 2001 UTC (21 years, 4 months ago) by fvdl
Branch: thorpej-devvp
Changes since 1.144.2.1: +5 -2 lines
Diff to previous 1.144.2.1 (colored) to branchpoint 1.144 (colored) next main 1.145 (colored)

Catch up with -current.

Revision 1.138.2.4 / (download) - annotate - [select for diffs], Fri Sep 21 22:36:24 2001 UTC (21 years, 4 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.3: +5 -2 lines
Diff to previous 1.138.2.3 (colored) to branchpoint 1.138 (colored)

Catch up to -current.

Revision 1.145 / (download) - annotate - [select for diffs], Tue Sep 18 19:36:33 2001 UTC (21 years, 4 months ago) by jdolecek
Branch: MAIN
CVS Tags: thorpej-devvp-base3, thorpej-devvp-base2
Branch point for: thorpej-mips-cache
Changes since 1.144: +5 -2 lines
Diff to previous 1.144 (colored)

Make the setregs hook emulation-specific, rather than executable
format specific.
Struct emul has a e_setregs hook back, which points to emulation-specific
setregs function. es_setregs of struct execsw now only points to
optional executable-specific setup function (this is only used for
ECOFF).

Revision 1.144.2.1 / (download) - annotate - [select for diffs], Tue Sep 18 19:13:53 2001 UTC (21 years, 4 months ago) by fvdl
Branch: thorpej-devvp
Changes since 1.144: +2 -2 lines
Diff to previous 1.144 (colored)

Various changes to make cloning devices possible:

	* Add an extra argument (struct vnode **) to VOP_OPEN. If it is
	  not NULL, specfs will create a cloned (aliased) vnode during
	  the call, and return it there. The caller should release and
	  unlock the original vnode if a new vnode was returned. The
	  new vnode is returned locked.

	* Add a flag field to the cdevsw and bdevsw structures.
	  DF_CLONING indicates that it wants a new vnode for each
	  open (XXX is there a better way? devprop?)

	* If a device is cloning, always call the close entry
	  point for a VOP_CLOSE.


Also, rewrite cons.c to do the right thing with vnodes. Use VOPs
rather then direct device entry calls. Suggested by mycroft@

Light to moderate testing done an i386 system (arch doesn't matter
though, these are MI changes).

Revision 1.138.2.3 / (download) - annotate - [select for diffs], Fri Aug 24 00:11:27 2001 UTC (21 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.2: +49 -44 lines
Diff to previous 1.138.2.2 (colored) to branchpoint 1.138 (colored)

Catch up with -current.

Revision 1.142.2.2 / (download) - annotate - [select for diffs], Fri Aug 3 04:13:40 2001 UTC (21 years, 5 months ago) by lukem
Branch: kqueue
Changes since 1.142.2.1: +49 -44 lines
Diff to previous 1.142.2.1 (colored)

update to -current

Revision 1.144 / (download) - annotate - [select for diffs], Sun Jul 29 21:22:42 2001 UTC (21 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-devvp
Changes since 1.143: +29 -24 lines
Diff to previous 1.143 (colored)

- make copyargs function return the reason it failed and pass a pointer to
  the stack, so that it can be modified.
- pass the error code in the exit code in addition to aborting.
- kill the second exit1() call; it does not make any sense.

Revision 1.100.2.4 / (download) - annotate - [select for diffs], Thu Jul 19 13:36:19 2001 UTC (21 years, 6 months ago) by perry
Branch: netbsd-1-4
Changes since 1.100.2.3: +14 -6 lines
Diff to previous 1.100.2.3 (colored) to branchpoint 1.100 (colored)

Pull-up patch requested by Luke Mewburn.

Original commit message:

	In check_exec(), don't bother checking P_TRACED along with
	MNT_NOSUID, just check MNT_NOSUID to clear the S{U,G}ID bits
	in the attributes for the vnode we're about to exec.

	We now check P_TRACED right before we would actually perform
	the s{u,g}id function in the exec code.

	This closes a race condition between exec of a setuid binary
	and ptrace(2).

Revision 1.143 / (download) - annotate - [select for diffs], Sun Jul 15 20:49:40 2001 UTC (21 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.142: +22 -22 lines
Diff to previous 1.142 (colored)

Use DPRINTF, and print all exec_vmcmds when we are debugging.
Don't use DEBUG, use DEBUG_EXEC to turn all that on.

Revision 1.142.2.1 / (download) - annotate - [select for diffs], Tue Jul 10 13:52:09 2001 UTC (21 years, 6 months ago) by lukem
Branch: kqueue
Changes since 1.142: +4 -1 lines
Diff to previous 1.142 (colored)

add calls to KNOTE(9) as appropriate

Revision 1.138.2.2 / (download) - annotate - [select for diffs], Thu Jun 21 20:06:47 2001 UTC (21 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138.2.1: +17 -6 lines
Diff to previous 1.138.2.1 (colored) to branchpoint 1.138 (colored)

Catch up to -current.

Revision 1.142 / (download) - annotate - [select for diffs], Mon Jun 18 02:00:55 2001 UTC (21 years, 7 months ago) by christos
Branch: MAIN
Branch point for: kqueue
Changes since 1.141: +2 -1 lines
Diff to previous 1.141 (colored)

Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.

Revision 1.110.4.5 / (download) - annotate - [select for diffs], Sat Jun 16 20:19:30 2001 UTC (21 years, 7 months ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH002, netbsd-1-5-PATCH001
Changes since 1.110.4.4: +16 -6 lines
Diff to previous 1.110.4.4 (colored) to branchpoint 1.110 (colored)

Pull up revision 1.141 (requested by thorpej):
  Close a race condition between exec of a setuid binary and
  ptrace(2): check P_TRACED right before adjusting the privilege
  settings in the exec code.

Revision 1.141 / (download) - annotate - [select for diffs], Fri Jun 15 17:24:19 2001 UTC (21 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.140: +16 -6 lines
Diff to previous 1.140 (colored)

In check_exec(), don't bother checking P_TRACED along with
MNT_NOSUID, just check MNT_NOSUID to clear the S{U,G}ID bits
in the attributes for the vnode we're about to exec.

We now check P_TRACED right before we would actually perform
the s{u,g}id function in the exec code.

This closes a race condition between exec of a setuid binary
and ptrace(2).

Revision 1.140 / (download) - annotate - [select for diffs], Mon May 7 09:55:14 2001 UTC (21 years, 8 months ago) by manu
Branch: MAIN
Changes since 1.139: +2 -2 lines
Diff to previous 1.139 (colored)

Changed EMUL_BSD_ASYNCIO_PIPE to EMUL_NO_BSD_ASYNCIO_PIPE, so that
the native emulation (NetBSD) does not have a flag.

Revision 1.139 / (download) - annotate - [select for diffs], Sun May 6 19:09:54 2001 UTC (21 years, 8 months ago) by manu
Branch: MAIN
Changes since 1.138: +2 -2 lines
Diff to previous 1.138 (colored)

Added two flags to emulation packages:

EMUL_BSD_ASYNCIO_PIPE notes that the emulated binaries expect the original
BSD pipe behavior for asynchronous I/O, which is to fire SIGIO on read() and
write(). OSes without this flag do not expect any SIGIO to be fired on
read() and write() for pipes, even when async I/O was requested. As far as
we know, the OSes that need EMUL_BSD_ASYNCIO_PIPE are NetBSD, OSF/1 and
Darwin.

EMUL_NO_SIGIO_ON_READ notes that the emulated binaries that requested
asynchrnous I/O expect the reader process to be notified by a SIGIO, but
not the writer process. OSes without this flag expect the reader and the
writer to be notified when some data has arrived or when some data have been
read. As far as we know, the OSes that need EMUL_NO_SIGIO_ON_READ are Linux
and SunOS.

Revision 1.103.2.7 / (download) - annotate - [select for diffs], Mon Mar 12 13:31:35 2001 UTC (21 years, 10 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.103.2.6: +96 -97 lines
Diff to previous 1.103.2.6 (colored) to branchpoint 1.103 (colored) next main 1.104 (colored)

Sync with HEAD.

Revision 1.138.2.1 / (download) - annotate - [select for diffs], Mon Mar 5 22:49:39 2001 UTC (21 years, 10 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.138: +15 -7 lines
Diff to previous 1.138 (colored)

Initial commit of scheduler activations and lightweight process support.

Revision 1.138 / (download) - annotate - [select for diffs], Mon Feb 26 20:43:25 2001 UTC (21 years, 11 months ago) by lukem
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa
Changes since 1.137: +85 -87 lines
Diff to previous 1.137 (colored)

convert to ANSI KNF

Revision 1.137 / (download) - annotate - [select for diffs], Wed Feb 21 00:47:21 2001 UTC (21 years, 11 months ago) by eeh
Branch: MAIN
Changes since 1.136: +1 -9 lines
Diff to previous 1.136 (colored)

Remove old compatibility hack.  Should no longer be needed.

Revision 1.136 / (download) - annotate - [select for diffs], Wed Feb 14 18:21:43 2001 UTC (21 years, 11 months ago) by eeh
Branch: MAIN
Changes since 1.135: +12 -3 lines
Diff to previous 1.135 (colored)

Support flexible process address space limits and bump kernel version number.

Revision 1.103.2.6 / (download) - annotate - [select for diffs], Sun Feb 11 19:16:45 2001 UTC (21 years, 11 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.103.2.5: +2 -2 lines
Diff to previous 1.103.2.5 (colored) to branchpoint 1.103 (colored)

Sync with HEAD.

Revision 1.135 / (download) - annotate - [select for diffs], Tue Feb 6 17:01:53 2001 UTC (21 years, 11 months ago) by eeh
Branch: MAIN
Changes since 1.134: +2 -2 lines
Diff to previous 1.134 (colored)

Specify a process' address space limits for uvmspace_exec().

Revision 1.103.2.5 / (download) - annotate - [select for diffs], Fri Jan 5 17:36:37 2001 UTC (22 years ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.103.2.4: +2 -2 lines
Diff to previous 1.103.2.4 (colored) to branchpoint 1.103 (colored)

Sync with HEAD

Revision 1.134 / (download) - annotate - [select for diffs], Fri Dec 22 22:58:59 2000 UTC (22 years, 1 month ago) by jdolecek
Branch: MAIN
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored)

split off thread specific stuff from struct sigacts to struct sigctx, leaving
    only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.

Revision 1.103.2.4 / (download) - annotate - [select for diffs], Wed Dec 13 15:50:20 2000 UTC (22 years, 1 month ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.103.2.3: +436 -21 lines
Diff to previous 1.103.2.3 (colored) to branchpoint 1.103 (colored)

Sync with HEAD (for UBC fixes).

Revision 1.133 / (download) - annotate - [select for diffs], Mon Dec 11 05:29:02 2000 UTC (22 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.132: +17 -5 lines
Diff to previous 1.132 (colored)

Introduce 2 new flags in types.h:
* __HAVE_SYSCALL_INTERN.  If this is defined, e_syscall is replaced by
  e_syscall_intern, which is called at key places in the kernel.  This can be
  used to set a MD syscall handler pointer.  This obsoletes and replaces the
  *_HAS_SEPARATED_SYSCALL flags.
* __HAVE_MINIMAL_EMUL.  If this is defined, certain (deprecated) elements in
  struct emul are omitted.

Revision 1.132 / (download) - annotate - [select for diffs], Sun Dec 10 12:42:30 2000 UTC (22 years, 1 month ago) by jdolecek
Branch: MAIN
Changes since 1.131: +2 -2 lines
Diff to previous 1.131 (colored)

emul_unregister(): fix incorrect loop condition - execsw[] is not NULL
terminated

Revision 1.131 / (download) - annotate - [select for diffs], Sat Dec 9 12:38:23 2000 UTC (22 years, 1 month ago) by jdolecek
Branch: MAIN
Changes since 1.130: +3 -1 lines
Diff to previous 1.130 (colored)

always fill in e_syscall in respective emul_*; if the emulation doesn't
have it's own separated *_syscall() function, use syscall()

Revision 1.130 / (download) - annotate - [select for diffs], Fri Dec 8 19:42:12 2000 UTC (22 years, 1 month ago) by jdolecek
Branch: MAIN
Changes since 1.129: +420 -19 lines
Diff to previous 1.129 (colored)

add infrastructure to load emulations and their executable support dynamically
via LKM

Revision 1.103.2.3 / (download) - annotate - [select for diffs], Fri Dec 8 09:13:53 2000 UTC (22 years, 1 month ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.103.2.2: +21 -9 lines
Diff to previous 1.103.2.2 (colored) to branchpoint 1.103 (colored)

Sync with HEAD.

Revision 1.129 / (download) - annotate - [select for diffs], Thu Dec 7 16:14:35 2000 UTC (22 years, 1 month ago) by jdolecek
Branch: MAIN
Changes since 1.128: +8 -3 lines
Diff to previous 1.128 (colored)

update comment about the sense of placement of NDINIT()

Revision 1.128 / (download) - annotate - [select for diffs], Fri Dec 1 19:41:49 2000 UTC (22 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.127: +5 -1 lines
Diff to previous 1.127 (colored)

set the EMUL_HAS_SYS___syscall flag for emul_netbsd

Revision 1.127 / (download) - annotate - [select for diffs], Fri Dec 1 12:28:31 2000 UTC (22 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.126: +2 -1 lines
Diff to previous 1.126 (colored)

add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now

Revision 1.126 / (download) - annotate - [select for diffs], Tue Nov 28 12:24:34 2000 UTC (22 years, 2 months ago) by mrg
Branch: MAIN
Changes since 1.125: +9 -8 lines
Diff to previous 1.125 (colored)

wrap newly introduced >80 char lines.

Revision 1.125 / (download) - annotate - [select for diffs], Mon Nov 27 08:39:43 2000 UTC (22 years, 2 months ago) by chs
Branch: MAIN
Changes since 1.124: +2 -1 lines
Diff to previous 1.124 (colored)

Initial integration of the Unified Buffer Cache project.

Revision 1.103.2.2 / (download) - annotate - [select for diffs], Wed Nov 22 16:05:18 2000 UTC (22 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.103.2.1: +62 -12 lines
Diff to previous 1.103.2.1 (colored) to branchpoint 1.103 (colored)

Sync with HEAD.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Nov 21 00:37:56 2000 UTC (22 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.123: +43 -15 lines
Diff to previous 1.123 (colored)

restructure struct emul and execsw, in preparation to make emulations LKMable:
* move all exec-type specific information from struct emul to execsw[] and
  provide single struct emul per emulation
* elf:
  - kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry
    per emulation and contains pointer to respective probe function
  - interp is allocated via MALLOC() rather than on stack
  - elf_args structure is allocated via MALLOC() rather than malloc()
* ecoff: the per-emulation hooks moved from alpha and mips specific code
  to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per
  emulation supporting ecoff with appropriate probe function
* the makecmds/probe functions don't set emulation, pointer to emulation is
  part of appropriate execsw[] entry
* constify couple of structures

Revision 1.103.2.1 / (download) - annotate - [select for diffs], Mon Nov 20 18:08:59 2000 UTC (22 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.103: +94 -39 lines
Diff to previous 1.103 (colored)

Update thorpej_scsipi to -current as of a month ago

Revision 1.123 / (download) - annotate - [select for diffs], Thu Nov 16 20:04:33 2000 UTC (22 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.122: +6 -2 lines
Diff to previous 1.122 (colored)

pass pointer to used exec_package to emulation-specific exec hook -
emulation code may make decisions based on e.g. exec format

Revision 1.122 / (download) - annotate - [select for diffs], Tue Nov 7 12:41:52 2000 UTC (22 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.121: +20 -2 lines
Diff to previous 1.121 (colored)

add void *p_emuldata into struct proc - this can be used to hold per-process
	emulation-specific data
add process exit, exec and fork function hooks into struct emul:
* e_proc_fork() - called in fork1() after the new forked process is setup
* e_proc_exec() - called in sys_execve() after the executed process is setup
* e_proc_exit() - called in exit1() after all the other process cleanups are
  done, right before machine-dependant switch to new context; also called
  for "old" emulation from sys_execve() if emulation of executed program and
  the original process is different

This was discussed on tech-kern.

Revision 1.110.4.4 / (download) - annotate - [select for diffs], Fri Nov 3 19:59:41 2000 UTC (22 years, 2 months ago) by tv
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-RELEASE, netbsd-1-5-BETA2
Changes since 1.110.4.3: +23 -1 lines
Diff to previous 1.110.4.3 (colored) to branchpoint 1.110 (colored)

Pullup 1.114 by patcxh [matt]:
Extend the vmcmd stuff a bit.  Add a flags field and define
VMCMD_BASE & VMCMD_RELATIVE.  This allows one to add vmcmds
which are relative to previous entries.  This is needed for
loading the VAX ld.elf_so
[releng: fixes problems with new i386 ld.elf_so too]

Revision 1.110.4.3 / (download) - annotate - [select for diffs], Wed Oct 18 16:23:59 2000 UTC (22 years, 3 months ago) by tv
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-BETA
Changes since 1.110.4.2: +19 -5 lines
Diff to previous 1.110.4.2 (colored) to branchpoint 1.110 (colored)

Pullup by patch [eeh]:
Support userspace at multiple addresses by making PSSTRINGS variable (using
p_psstr), and fix stackgap_init() appropriately.

Revision 1.121 / (download) - annotate - [select for diffs], Thu Sep 28 19:05:07 2000 UTC (22 years, 4 months ago) by eeh
Branch: MAIN
Changes since 1.120: +13 -11 lines
Diff to previous 1.120 (colored)

Add support for variable end of user stacks needed to support COMPAT_NETBSD32:

	`struct vmspace' has a new field `vm_minsaddr' which is the user TOS.

	PS_STRINGS is deprecated in favor of curproc->p_pstr which is derived
	from `vm_minsaddr'.

	Bump the kernel version number.

Revision 1.120 / (download) - annotate - [select for diffs], Thu Aug 3 20:41:22 2000 UTC (22 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.119: +6 -6 lines
Diff to previous 1.119 (colored)

Convert namei pathname buffer allocation to use the pool allocator.

Revision 1.119 / (download) - annotate - [select for diffs], Wed Aug 2 20:36:33 2000 UTC (22 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.118: +6 -6 lines
Diff to previous 1.118 (colored)

MALLOC()/FREE() should not be used for variable sized allocations.
(A few remain here -- need to fix exec_script.c)

Revision 1.118 / (download) - annotate - [select for diffs], Tue Aug 1 04:57:29 2000 UTC (22 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.117: +5 -13 lines
Diff to previous 1.117 (colored)

ANSI'ify.

Revision 1.110.4.2 / (download) - annotate - [select for diffs], Mon Jul 31 02:41:26 2000 UTC (22 years, 6 months ago) by mrg
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-ALPHA2
Changes since 1.110.4.1: +6 -2 lines
Diff to previous 1.110.4.1 (colored) to branchpoint 1.110 (colored)

pull up 1.117 (approved by thorpej):
>Fix the sparc_v9 hack...

Revision 1.117 / (download) - annotate - [select for diffs], Thu Jul 27 13:45:59 2000 UTC (22 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.116: +6 -2 lines
Diff to previous 1.116 (colored)

Fix the sparc_v9 hack...

Revision 1.110.4.1 / (download) - annotate - [select for diffs], Wed Jul 26 23:10:28 2000 UTC (22 years, 6 months ago) by mycroft
Branch: netbsd-1-5
Changes since 1.110: +7 -3 lines
Diff to previous 1.110 (colored)

Approved by thorpej:
Store argc as a long, per ELF ABI.

syssrc/sys/kern/kern_exec.c				1.115 -> 1.116

Revision 1.116 / (download) - annotate - [select for diffs], Wed Jul 26 15:42:09 2000 UTC (22 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.115: +7 -3 lines
Diff to previous 1.115 (colored)

The ELF ABI declares that argc must fill an `argument slot'.  Make it so.
For __sparc_v9__ only, do a hack to make old executables continue to work --
for now.

Revision 1.115 / (download) - annotate - [select for diffs], Thu Jul 13 02:33:36 2000 UTC (22 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.114: +1 -4 lines
Diff to previous 1.114 (colored)

remove a debugging printf.

Revision 1.114 / (download) - annotate - [select for diffs], Thu Jul 13 01:24:05 2000 UTC (22 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.113: +16 -1 lines
Diff to previous 1.113 (colored)

Extend the vmcmd stuff a bit.  Add a flags field and define
VMCMD_BASE & VMCMD_RELATIVE.  This allows one to add vmcmds
which are relative to previous entries.  This is needed for
loading the VAX ld.elf_so

Revision 1.113 / (download) - annotate - [select for diffs], Tue Jun 27 17:41:17 2000 UTC (22 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.112: +1 -3 lines
Diff to previous 1.112 (colored)

remove include of <vm/vm.h>

Revision 1.112 / (download) - annotate - [select for diffs], Mon Jun 26 14:21:14 2000 UTC (22 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.111: +1 -2 lines
Diff to previous 1.111 (colored)

remove/move more mach vm header files:

	<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.

Revision 1.111 / (download) - annotate - [select for diffs], Wed Jun 21 05:43:33 2000 UTC (22 years, 7 months ago) by matt
Branch: MAIN
Changes since 1.110: +31 -5 lines
Diff to previous 1.110 (colored)

Add some kernel printfs (under DEBUG) to print messages when bad things
happen in a exec.

Revision 1.110 / (download) - annotate - [select for diffs], Sat May 27 00:40:45 2000 UTC (22 years, 8 months ago) by sommerfeld
Branch: MAIN
CVS Tags: netbsd-1-5-base, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: netbsd-1-5
Changes since 1.109: +2 -2 lines
Diff to previous 1.109 (colored)

Reduce use of curproc in several places:

 - Change ktrace interface to pass in the current process, rather than
p->p_tracep, since the various ktr* function need curproc anyway.

 - Add curproc as a parameter to mi_switch() since all callers had it
handy anyway.

 - Add a second proc argument for inferior() since callers all had
curproc handy.

Also, miscellaneous cleanups in ktrace:

 - ktrace now always uses file-based, rather than vnode-based I/O
(simplifies, increases type safety); eliminate KTRFLAG_FD & KTRFAC_FD.
Do non-blocking I/O, and yield a finite number of times when receiving
EWOULDBLOCK before giving up.

 - move code duplicated between sys_fktrace and sys_ktrace into ktrace_common.

 - simplify interface to ktrwrite()

Revision 1.109 / (download) - annotate - [select for diffs], Fri May 26 02:24:37 2000 UTC (22 years, 8 months ago) by simonb
Branch: MAIN
Changes since 1.108: +8 -1 lines
Diff to previous 1.108 (colored)

Fill in locators for process argv/envp data after ps_strings is built.

Revision 1.108 / (download) - annotate - [select for diffs], Thu Mar 30 09:27:11 2000 UTC (22 years, 10 months ago) by augustss
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored)

Get rid of register declarations.

Revision 1.100.2.3 / (download) - annotate - [select for diffs], Tue Feb 1 22:55:07 2000 UTC (23 years ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003, netbsd-1-4-PATCH002
Changes since 1.100.2.2: +3 -1 lines
Diff to previous 1.100.2.2 (colored) to branchpoint 1.100 (colored)

Pull up revision 1.107 (requested by fvdl):
  Close procfs security hole.  Fixes SA#2000-001.

Revision 1.107 / (download) - annotate - [select for diffs], Tue Jan 25 01:15:14 2000 UTC (23 years ago) by fvdl
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.106: +3 -1 lines
Diff to previous 1.106 (colored)

Add an exec hook mechanism, where kernel subsystem can register to
execute certain functions when a process does an exec(). Currently
uses a global list. Could possibly be done using a per-process list,
but this needs more thought.

Revision 1.106 / (download) - annotate - [select for diffs], Wed Jan 5 08:11:31 2000 UTC (23 years ago) by mrg
Branch: MAIN
Changes since 1.105: +3 -3 lines
Diff to previous 1.105 (colored)

reverse (and fix) the logic of the other change; it cause semi-random alpha SIGABRT for longer command lines

Revision 1.105 / (download) - annotate - [select for diffs], Thu Dec 30 15:59:26 1999 UTC (23 years, 1 month ago) by eeh
Branch: MAIN
Changes since 1.104: +9 -4 lines
Diff to previous 1.104 (colored)

Handle args for 32-bit emulation processes properly.

Revision 1.103.8.1 / (download) - annotate - [select for diffs], Mon Dec 27 18:35:51 1999 UTC (23 years, 1 month ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.103: +5 -1 lines
Diff to previous 1.103 (colored) next main 1.104 (colored)

Pull up to last week's -current.

Revision 1.100.6.1 / (download) - annotate - [select for diffs], Tue Nov 30 13:34:41 1999 UTC (23 years, 2 months ago) by itojun
Branch: kame
CVS Tags: kame_141_19991130
Changes since 1.100: +2 -1 lines