OpenBSD CVS

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


[BACK] Up to [local] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.82 / (download) - annotate - [select for diffs], Mon Jan 9 02:12:13 2023 UTC (17 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.81: +3 -1 lines
Diff to previous 1.81 (colored)

setthrname() should return EINVAL, not ENAMETOOLONG, when the
input is too long.

ok mpi@

Revision 1.81 / (download) - annotate - [select for diffs], Sat Jan 7 05:24:58 2023 UTC (17 months ago) by guenther
Branch: MAIN
Changes since 1.80: +51 -1 lines
Diff to previous 1.80 (colored)

Add {get,set}thrname(2) for putting thread names in the kernel and
exposed in a new field returned by sysctl(KERN_PROC).  Update
pthread_{get,set}_name_np(3) to use the syscalls.  Show them, when
set, in ps -H and top -H output.

libc and libpthread minor bumps

ok mpi@, mvs@, deraadt@

Revision 1.80 / (download) - annotate - [select for diffs], Sun Aug 14 01:58:27 2022 UTC (21 months, 4 weeks ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.79: +1 -2 lines
Diff to previous 1.79 (colored)

remove unneeded includes in sys/kern
ok mpi@ miod@

Revision 1.79 / (download) - annotate - [select for diffs], Thu Mar 17 14:23:34 2022 UTC (2 years, 2 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.78: +9 -10 lines
Diff to previous 1.78 (colored)

Use the refcnt API with struct ucred.

OK bluhm@

Revision 1.78 / (download) - annotate - [select for diffs], Sun Oct 24 00:02:25 2021 UTC (2 years, 7 months ago) by jsg
Branch: MAIN
Changes since 1.77: +3 -2 lines
Diff to previous 1.77 (colored)

use NULL not 0 for pointer values in kern
ok semarie@

Revision 1.77 / (download) - annotate - [select for diffs], Sun Jan 17 15:28:22 2021 UTC (3 years, 4 months ago) by mvs
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

Cache parent's pid as `ps_ppid' and use it instead of `ps_pptr->ps_pid'.
This allows us to unlock getppid(2).

ok mpi@

Revision 1.76 / (download) - annotate - [select for diffs], Tue Jul 9 12:23:25 2019 UTC (4 years, 11 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.75: +4 -4 lines
Diff to previous 1.75 (colored)

The system calls getgroups(2) and setgroups(2) pass the number of
groups as signed int.  Do not use unsigned int within the kernel
for length calculations.  Now getgroups(2) fails with EINVAL if
called with negative length value.
from Moritz Buhl; OK millert@

Revision 1.75 / (download) - annotate - [select for diffs], Fri Jun 22 13:33:30 2018 UTC (5 years, 11 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

tweak comment

Revision 1.74 / (download) - annotate - [select for diffs], Thu Jun 21 13:58:21 2018 UTC (5 years, 11 months ago) by visa
Branch: MAIN
Changes since 1.73: +14 -2 lines
Diff to previous 1.73 (colored)

Use atomic operations for updating cred structure reference counts
to make crfree() and crhold() MP-safe. Make crhold() a proper function.
Put the definition into file kern_prot.c to constrain the need of the
<sys/atomic.h> header.

While there, adjust the IPL of ucred_pool to avoid lock order problems
with the kernel lock (pointed out by kettenis@).

OK mpi@

Revision 1.73 / (download) - annotate - [select for diffs], Tue Feb 20 12:38:58 2018 UTC (6 years, 3 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.72: +21 -11 lines
Diff to previous 1.72 (colored)

Introduce enternewpgrp() & enterthispgrp(), from FreeBSD via guenther@.

This code shuffling will ease the introduction of the proctree lock
in sys_setsid() and sys_setpgid().

Extracted from a larger diff from guenther@, ok visa@

Revision 1.72 / (download) - annotate - [select for diffs], Mon Feb 19 08:59:52 2018 UTC (6 years, 3 months ago) by mpi
Branch: MAIN
Changes since 1.71: +21 -24 lines
Diff to previous 1.71 (colored)

Remove almost unused `flags' argument of suser().

The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.

No objection from millert@, ok tedu@, bluhm@

Revision 1.65.2.1 / (download) - annotate - [select for diffs], Wed Sep 27 18:09:57 2017 UTC (6 years, 8 months ago) by tj
Branch: OPENBSD_6_0
Changes since 1.65: +5 -1 lines
Diff to previous 1.65 (colored) next main 1.66 (colored)

MFC: amd64 needs FS.base values (the TCB pointers) to be validated,
as noncanonical addresses will cause a fault on load by the kernel.

Revision 1.67.4.1 / (download) - annotate - [select for diffs], Wed Sep 27 18:06:45 2017 UTC (6 years, 8 months ago) by tj
Branch: OPENBSD_6_1
Changes since 1.67: +5 -1 lines
Diff to previous 1.67 (colored) next main 1.68 (colored)

MFC: amd64 needs FS.base values (the TCB pointer) to be validated,
as noncanonical addresses will cause a fault on load by the kernel.

Revision 1.71 / (download) - annotate - [select for diffs], Wed Sep 27 06:45:00 2017 UTC (6 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.70: +3 -1 lines
Diff to previous 1.70 (colored)

guenther sleep-commited the version without #ifdefs

Revision 1.70 / (download) - annotate - [select for diffs], Wed Sep 27 05:43:55 2017 UTC (6 years, 8 months ago) by guenther
Branch: MAIN
Changes since 1.69: +5 -2 lines
Diff to previous 1.69 (colored)

amd64 needs FS.base values (the TCB pointer) to be validated, as noncanonical
addresses will cause a fault on load by the kernel.

Problem observed by Maxime Villard
ok kettenis@ deraadt@

Revision 1.69 / (download) - annotate - [select for diffs], Thu Apr 13 04:06:46 2017 UTC (7 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.68: +1 -19 lines
Diff to previous 1.68 (colored)

Delete the getlogin59 syscall, which was last used one year, two releases,
and four libc major versions ago

ok sthen@ jsing@ deraadt@ jca@

Revision 1.68 / (download) - annotate - [select for diffs], Thu Apr 13 03:52:25 2017 UTC (7 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.67: +2 -5 lines
Diff to previous 1.67 (colored)

Provide mips64 with kernel-facing TCB_{GET,SET} macros that store it
in struct mdproc.  With that, all archs have those and the __HAVE_MD_TCB
macro can be unifdef'ed as always defined.

ok kettenis@ visa@ jsing@

Revision 1.67 / (download) - annotate - [select for diffs], Mon Nov 7 00:26:32 2016 UTC (7 years, 7 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE
Branch point for: OPENBSD_6_1
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (colored)

Split PID from TID, giving processes a PID unrelated to the TID of their
initial thread

ok jsing@ kettenis@

Revision 1.66 / (download) - annotate - [select for diffs], Fri Sep 2 18:11:28 2016 UTC (7 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.65: +2 -1 lines
Diff to previous 1.65 (colored)

add a concept of 'verified auth' to sessions. When set via ioctl,
the user and parent process are recorded. Later, this info may be tested
and used to bypass authorization requirements.
ie, doas won't ask for your password again.
Great idea from henning.
ok deraadt guenther henning

Revision 1.65 / (download) - annotate - [select for diffs], Wed Mar 30 07:49:11 2016 UTC (8 years, 2 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE
Branch point for: OPENBSD_6_0
Changes since 1.64: +26 -3 lines
Diff to previous 1.64 (colored)

Add getlogin_r syscall that checks and returns errors like userspace
getlogin_r() API; keep existing syscall as getlogin59 for temporary compat.

ok kettenis@ deraadt@

Revision 1.64 / (download) - annotate - [select for diffs], Tue Mar 29 16:53:49 2016 UTC (8 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.63: +6 -4 lines
Diff to previous 1.63 (colored)

In setlogin(), don't change anything on error.

ok deraadt@ krw@ zhuk@ jca@ millert@

Revision 1.63 / (download) - annotate - [select for diffs], Mon Mar 2 20:46:50 2015 UTC (9 years, 3 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.62: +5 -2 lines
Diff to previous 1.62 (colored)

Return EINVAL if the creds supplied for NFS export have a cr_ngroups less
than zero or greater than NGROUPS_MAX

Fixes panic seen by henning@

Revision 1.62 / (download) - annotate - [select for diffs], Sat Jan 17 17:49:26 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.61: +3 -3 lines
Diff to previous 1.61 (colored)

use NGROUPS_MAX

Revision 1.61 / (download) - annotate - [select for diffs], Wed Sep 17 19:26:06 2014 UTC (9 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.60: +4 -4 lines
Diff to previous 1.60 (colored)

The  2nd arg of setpgid(2) should be pid_t, not int.
No functional change as pid_t is defined as int32_t.
OK miod@

Revision 1.60 / (download) - annotate - [select for diffs], Fri Apr 18 11:51:17 2014 UTC (10 years, 1 month ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.59: +282 -115 lines
Diff to previous 1.59 (colored)

Have each thread keeps its own (counted!) reference to the process's ucreds
to avoid possible use-after-free references when swapping ids in threaded
processes.  "Do I have the right creds?" checks are always made with the
threads creds.

Inspired by FreeBSD and NetBSD
"right time" deraadt@

Revision 1.59 / (download) - annotate - [select for diffs], Sun Mar 30 21:54:48 2014 UTC (10 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.58: +117 -119 lines
Diff to previous 1.58 (colored)

Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred

Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.

ok matthew@

Revision 1.58 / (download) - annotate - [select for diffs], Mon Mar 24 03:48:00 2014 UTC (10 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.57: +1 -2 lines
Diff to previous 1.57 (colored)

The kernel isn't involved in times(3); <sys/times.h> should never be
included there

Revision 1.57 / (download) - annotate - [select for diffs], Mon Mar 24 00:19:48 2014 UTC (10 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.56: +15 -1 lines
Diff to previous 1.56 (colored)

Split the API: struct ucred remains the kernel internal structure while
struct xucred becomes the structure for syscalls (mount(2) and nfssvc(2)).

ok deraadt@ beck@

Revision 1.56 / (download) - annotate - [select for diffs], Sat Apr 6 03:44:34 2013 UTC (11 years, 2 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.55: +1 -3 lines
Diff to previous 1.55 (colored)

rthreads are always enabled. remove the sysctl.
ok deraadt guenther kettenis matthew

Revision 1.55 / (download) - annotate - [select for diffs], Mon Oct 1 00:08:42 2012 UTC (11 years, 8 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.54: +3 -1 lines
Diff to previous 1.54 (colored)

Make groupmember() check the effective gid too, so that the checks are
consistent when the effective gid isn't also a supplementary group.

ok beck@

Revision 1.54 / (download) - annotate - [select for diffs], Thu Apr 12 10:11:41 2012 UTC (12 years, 2 months ago) by mikeb
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

move accounting flags to struct process; idea and ok guenther

Revision 1.53 / (download) - annotate - [select for diffs], Tue Apr 10 15:50:52 2012 UTC (12 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.52: +5 -5 lines
Diff to previous 1.52 (colored)

Make the KERN_NPROCS and KERN_MAXPROC sysctl()s and the RLIMIT_NPROC rlimit
count processes instead of threads.  New sysctl()s KERN_NTHREADS and
KERN_MAXTHREAD count and limit threads.  The nprocs and maxproc kernel
variables are replaced by nprocess, maxprocess, nthreads, and maxthread.

ok tedu@ mikeb@

Revision 1.52 / (download) - annotate - [select for diffs], Mon Feb 20 22:23:39 2012 UTC (12 years, 3 months ago) by guenther
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

First steps for making ptrace work with rthreads:
 - move the P_TRACED and P_INEXEC flags, and p_oppid, p_ptmask, and
   p_ptstat member from struct proc to struct process
 - sort the PT_* requests into those that take a PID vs those that
   can also take a TID
 - stub in PT_GET_THREAD_FIRST and PT_GET_THREAD_NEXT

ok kettenis@

Revision 1.51 / (download) - annotate - [select for diffs], Sat Oct 15 23:35:29 2011 UTC (12 years, 7 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.50: +29 -1 lines
Diff to previous 1.50 (colored)

"TLS-lite": add kernel support for a per-thread userspace pointer,
for pointing to the thread-control-block.  Support for mapping this
to the correct hardware register can be added as it's finished;
start with support for amd64, sparc, and sparc64.  Includes syscalls
for getting and setting it (for a portable __errno implementation) as
well as creating a new thread with an initial value for it.

discussed with miod@, kettenis@, deraadt@; committing to get the syscalls
in with the impending libc bump and do further refinements in tree

Revision 1.50 / (download) - annotate - [select for diffs], Mon Jul 25 20:32:06 2011 UTC (12 years, 10 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.49: +3 -3 lines
Diff to previous 1.49 (colored)

two more syscall functions that should have returned int, not pid_t

Revision 1.49 / (download) - annotate - [select for diffs], Thu Jul 7 18:08:36 2011 UTC (12 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.48: +4 -7 lines
Diff to previous 1.48 (colored)

effectively revert 1.44.  we don't need the compat_43 syscall returns ever.
getpid is smp safe again.  ok guenther

Revision 1.48 / (download) - annotate - [select for diffs], Mon Apr 4 13:00:13 2011 UTC (13 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

Move P_EXEC flag from struct proc to process, so that setpgid() will
fail regardless of which rthread calls execve()

ok blambert@

Revision 1.47 / (download) - annotate - [select for diffs], Sat Apr 2 17:04:35 2011 UTC (13 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.46: +9 -9 lines
Diff to previous 1.46 (colored)

Move P_SUGID and P_SUGIDEXEC from struct proc to struct process, so
that you can't evade the checks by doing the dirty work in an rthread

ok blambert@, deraadt@

Revision 1.46 / (download) - annotate - [select for diffs], Mon Jul 26 01:56:27 2010 UTC (13 years, 10 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.45: +41 -37 lines
Diff to previous 1.45 (colored)

Correct the links between threads, processes, pgrps, and sessions,
so that the process-level stuff is to/from struct process and not
struct proc.  This fixes a bunch of problem cases in rthreads.
Based on earlier work by blambert and myself, but mostly written
at c2k10.

Tested by many: deraadt, sthen, krw, ray, and in snapshots

Revision 1.45 / (download) - annotate - [select for diffs], Thu Jul 1 02:41:12 2010 UTC (13 years, 11 months ago) by guenther
Branch: MAIN
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

Always identify threads with THREAD_PID_OFFSET, so that there's no
way a kill() intended for a thread can result in a separate process
getting the signal.
ok tedu@ art@

Revision 1.44 / (download) - annotate - [select for diffs], Tue Jun 29 19:09:11 2010 UTC (13 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.43: +4 -12 lines
Diff to previous 1.43 (colored)

remove the compat43 ifdef around some code.  in effect, it's always been
in compat mode and there's no harm continuing that way.
ok dlg deraadt guenther miod thib

Revision 1.43 / (download) - annotate - [select for diffs], Tue Jun 29 00:28:14 2010 UTC (13 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

Eliminate RTHREADS kernel option in favor of a sysctl.  The actual status
(not done) hasn't changed, but now it's less work to test things.
ok art deraadt

Revision 1.42 / (download) - annotate - [select for diffs], Mon Jun 28 23:00:30 2010 UTC (13 years, 11 months ago) by guenther
Branch: MAIN
Changes since 1.41: +1 -2 lines
Diff to previous 1.41 (colored)

<sys/time.b> is for ftime(), which is just in libcompat and not the kernel,
so stop including it in kernel .c files.
"sure" deraadt@

Revision 1.38.2.1 / (download) - annotate - [select for diffs], Fri Jan 29 21:33:30 2010 UTC (14 years, 4 months ago) by sthen
Branch: OPENBSD_4_5
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored) next main 1.39 (colored)

Merge from -current:

----
Make sure the process tree is is loop-free by forbidding ptrace()
of a direct ancestor, closing a localhost DoS.  As an exception,
do permit ptrace() of pid 1 and have inferiors() stop climbing if
it hits that.

ok tedu@  hpux_compat suggestion from miod@
----

Requested by guenther@. The hpux_compat change here is more
conservative than committed to -current.

Revision 1.39.4.1 / (download) - annotate - [select for diffs], Fri Jan 29 21:33:13 2010 UTC (14 years, 4 months ago) by sthen
Branch: OPENBSD_4_6
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored) next main 1.40 (colored)

Merge from -current:

----
Make sure the process tree is is loop-free by forbidding ptrace()
of a direct ancestor, closing a localhost DoS.  As an exception,
do permit ptrace() of pid 1 and have inferiors() stop climbing if
it hits that.

ok tedu@  hpux_compat suggestion from miod@
----

Requested by guenther@. The hpux_compat change here is more
conservative than committed to -current.

Revision 1.41 / (download) - annotate - [select for diffs], Thu Jan 28 19:23:06 2010 UTC (14 years, 4 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

Make sure the process tree is is loop-free by forbidding ptrace()
of a direct ancestor, closing a localhost DoS.  As an exception,
do permit ptrace() of pid 1 and have inferiors() stop climbing if
it hits that.

ok tedu@  hpux_compat suggestion from miod@

Revision 1.40 / (download) - annotate - [select for diffs], Thu Jan 14 23:12:11 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

fix typos in comments, no code changes;
from Brad Tilley <brad at 16systems dot com>;
ok oga@

Revision 1.39 / (download) - annotate - [select for diffs], Tue Jun 2 20:03:59 2009 UTC (15 years ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE
Branch point for: OPENBSD_4_6
Changes since 1.38: +2 -5 lines
Diff to previous 1.38 (colored)

ANSIfy
noted by Jonathan ARMANI, ok blambert@

Revision 1.38 / (download) - annotate - [select for diffs], Tue Dec 16 07:57:28 2008 UTC (15 years, 5 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE
Branch point for: OPENBSD_4_5
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

Move the functionality of psignal() to a new function ptsignal()
that takes an additional argument "type" that indicates whether the
signal is for the process, just a particular thread, or propagated
to a thread because it's not caught or blocked.  psignal() becomes
a wrapper that does the first of those.

So that sys_kill() can tell apart signals for the process and signals
for the process's original thread, the tid of the original thread
is defined as its pid + THREAD_PID_OFFSET.

ok tedu@ art@ andreas@ kurt@   "better early than late" deraadt@

Revision 1.37 / (download) - annotate - [select for diffs], Sat Nov 1 05:59:21 2008 UTC (15 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.36: +37 -15 lines
Diff to previous 1.36 (colored)

change all callers of enterpgrp() to pre-allocate a pgrp or session if
it might be needed later -- before calling pfind(), so that enterpgrp()
can operate without sleeping
ok tedu

Revision 1.36 / (download) - annotate - [select for diffs], Fri Oct 31 17:17:04 2008 UTC (15 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.35: +14 -38 lines
Diff to previous 1.35 (colored)

accidental commit ... backout

Revision 1.35 / (download) - annotate - [select for diffs], Fri Oct 31 17:15:30 2008 UTC (15 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.34: +39 -15 lines
Diff to previous 1.34 (colored)

kern_sysctl.c

Revision 1.34 / (download) - annotate - [select for diffs], Tue Oct 14 18:27:29 2008 UTC (15 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.33: +5 -5 lines
Diff to previous 1.33 (colored)

Back-in; problems were apparently elsewhere.
Put a reference count in struct process to prevent use-after-free
if the main thread reaches the reaper ahead of some other thread
in the process.  Use the reference count to update the user process
count correctly when changin real uid.

"please re-commit before something else nasty comes in" deraadt@

Revision 1.33 / (download) - annotate - [select for diffs], Fri Oct 10 14:35:06 2008 UTC (15 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.32: +4 -4 lines
Diff to previous 1.32 (colored)

backout; is causing some people difficulty

Revision 1.32 / (download) - annotate - [select for diffs], Thu Oct 9 06:34:10 2008 UTC (15 years, 8 months ago) by guenther
Branch: MAIN
Changes since 1.31: +5 -5 lines
Diff to previous 1.31 (colored)

Use the reference count in struct process to update the proc count
for users by the correct amount when changing real UID on (r)threaded
processes.

ok art@ tedu@

Revision 1.31 / (download) - annotate - [select for diffs], Thu May 22 21:27:40 2008 UTC (16 years ago) by thib
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.30: +2 -3 lines
Diff to previous 1.30 (colored)


use PR_ZERO instead of calling bzero directly
after pool_get();

ok beck@

Revision 1.30 / (download) - annotate - [select for diffs], Tue Apr 3 08:05:43 2007 UTC (17 years, 2 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.29: +4 -4 lines
Diff to previous 1.29 (colored)

Start moving state that is shared among threads in a process into
a new struct. Instead of doing a huge rename and deal with the fallout
for weeks, like other projects that need no mention, we will slowly and
carefully move things out of struct proc into a new struct process.

 - Create struct process and the infrastructure to create and remove them.
 - Move threads in a process into struct process.

deraadt@, tedu@ ok

Revision 1.29 / (download) - annotate - [select for diffs], Thu Mar 15 10:22:30 2007 UTC (17 years, 3 months ago) by art
Branch: MAIN
Changes since 1.28: +8 -8 lines
Diff to previous 1.28 (colored)

Since p_flag is often manipulated in interrupts and without biglock
it's a good idea to use atomic.h operations on it. This mechanic
change updates all bit operations on p_flag to atomic_{set,clear}bits_int.

Only exception is that P_OWEUPC is set by MI code before calling
need_proftick and it's automatically cleared by ADDUPC. There's
no reason for MD handling of that flag since everyone handles it the
same way.

kettenis@ ok

Revision 1.28 / (download) - annotate - [select for diffs], Sat Dec 3 18:09:08 2005 UTC (18 years, 6 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.27: +17 -3 lines
Diff to previous 1.27 (colored)

kernel support for threaded processes (rthreads).
uses rfork(RFTHREAD) to create threads, which are presently processes
that are a little more tightly bound together.  several new syscalls
added to facilitate a userland thread library.
all conditional on RTHREADS, currently disabled.
ok deraadt

Revision 1.27 / (download) - annotate - [select for diffs], Mon Nov 28 00:14:29 2005 UTC (18 years, 6 months ago) by jsg
Branch: MAIN
Changes since 1.26: +32 -115 lines
Diff to previous 1.26 (colored)

ansi/deregister.
'go for it' deraadt@

Revision 1.12.10.6 / (download) - annotate - [select for diffs], Thu Feb 19 10:56:37 2004 UTC (20 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.12.10.5: +34 -25 lines
Diff to previous 1.12.10.5 (colored) to branchpoint 1.12 (colored) next main 1.13 (colored)

Merge of current from two weeks agointo the SMP branch

Revision 1.26 / (download) - annotate - [select for diffs], Mon Sep 1 18:06:03 2003 UTC (20 years, 9 months ago) by henning
Branch: MAIN
CVS Tags: SMP_SYNC_B, SMP_SYNC_A, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

match syscallargs comments with reality
from Patrick Latifi <patrick.l@hermes.usherb.ca>
ok jason@ tedu@

Revision 1.25 / (download) - annotate - [select for diffs], Fri Aug 15 20:32:18 2003 UTC (20 years, 10 months ago) by tedu
Branch: MAIN
Changes since 1.24: +32 -23 lines
Diff to previous 1.24 (colored)

change arguments to suser.  suser now takes the process, and a flags
argument.  old cred only calls user suser_ucred.  this will allow future
work to more flexibly implement the idea of a root process.  looks like
something i saw in freebsd, but a little different.
use of suser_ucred vs suser in file system code should be looked at again,
for the moment semantics remain unchanged.
review and input from art@  testing and further review miod@

Revision 1.12.10.5 / (download) - annotate - [select for diffs], Sat Jun 7 11:03:40 2003 UTC (21 years ago) by ho
Branch: SMP
Changes since 1.12.10.4: +2 -6 lines
Diff to previous 1.12.10.4 (colored) to branchpoint 1.12 (colored)

Sync SMP branch to -current

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jun 2 23:28:05 2003 UTC (21 years ago) by millert
Branch: MAIN
Changes since 1.23: +2 -6 lines
Diff to previous 1.23 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.18.4.3 / (download) - annotate - [select for diffs], Mon May 19 22:31:10 2003 UTC (21 years ago) by tedu
Branch: UBC
Changes since 1.18.4.2: +273 -1 lines
Diff to previous 1.18.4.2 (colored) to branchpoint 1.18 (colored) next main 1.19 (colored)

sync

Revision 1.12.10.4 / (download) - annotate - [select for diffs], Fri Mar 28 00:41:26 2003 UTC (21 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.12.10.3: +274 -2 lines
Diff to previous 1.12.10.3 (colored) to branchpoint 1.12 (colored)

Sync the SMP branch with 3.3

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jan 30 03:29:49 2003 UTC (21 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: UBC_SYNC_A, OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.22: +67 -1 lines
Diff to previous 1.22 (colored)

Bring back setreuid(2) and setregid(2) as first class syscalls
(but still implemented via setres[ug]id(2)).  Basically this just
moves them from COMPAT_43 into kern_prot.c.  Also fixes a typo in my
old implementation.  The userland portion will follow in a few days.
deraadt@ OK

Revision 1.22 / (download) - annotate - [select for diffs], Wed Oct 30 20:02:58 2002 UTC (21 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.21: +207 -1 lines
Diff to previous 1.21 (colored)

Implement setresuid(2), getresuid(2), setresgid(2), getresgid(2), based
partly on the Linux emul code and FreeBSD versions.
We need these for Linux, FreeBSD, and HP-UX emulation.
Also change sys_setreuid() and sys_setregid() to use uid_t and gid_t
respectively.

Revision 1.18.4.2 / (download) - annotate - [select for diffs], Tue Oct 29 00:36:44 2002 UTC (21 years, 7 months ago) by art
Branch: UBC
Changes since 1.18.4.1: +3 -3 lines
Diff to previous 1.18.4.1 (colored) to branchpoint 1.18 (colored)

sync to -current

Revision 1.21 / (download) - annotate - [select for diffs], Tue Oct 15 01:27:31 2002 UTC (21 years, 8 months ago) by nordin
Branch: MAIN
CVS Tags: UBC_SYNC_B
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

Match reality by changing (u_int) -> (int) in comments.

Revision 1.12.10.3 / (download) - annotate - [select for diffs], Wed Mar 6 02:13:23 2002 UTC (22 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.12.10.2: +4 -6 lines
Diff to previous 1.12.10.2 (colored) to branchpoint 1.12 (colored)

Merge in trunk

Revision 1.18.4.1 / (download) - annotate - [select for diffs], Thu Jan 31 22:55:40 2002 UTC (22 years, 4 months ago) by niklas
Branch: UBC
Changes since 1.18: +4 -6 lines
Diff to previous 1.18 (colored)

Merge in -current, builds on i386, otherwise untested

Revision 1.20 / (download) - annotate - [select for diffs], Wed Jan 23 15:46:48 2002 UTC (22 years, 4 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.19: +4 -6 lines
Diff to previous 1.19 (colored)

Allocate rusage, pgrp, ucred and session with pool.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Jan 12 22:56:55 2002 UTC (22 years, 5 months ago) by art
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

Don't cast return value from splx to (void) because splx doesn't return anything.

Revision 1.12.10.2 / (download) - annotate - [select for diffs], Wed Jul 4 10:48:24 2001 UTC (22 years, 11 months ago) by niklas
Branch: SMP
Changes since 1.12.10.1: +30 -11 lines
Diff to previous 1.12.10.1 (colored) to branchpoint 1.12 (colored)

Merge in -current from two days ago in the SMP branch.
As usual with merges, they do not indicate progress, so do not hold
your breath for working SMP, and do not mail me and ask about the
state of it.  It has not changed.  There is work ongoing, but very, very
slowly.  The commit is done in parts as to not lock up the tree in too
big chunks at a time.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jun 22 23:55:24 2001 UTC (22 years, 11 months ago) by art
Branch: MAIN
CVS Tags: UBC_BASE, OPENBSD_3_0_BASE, OPENBSD_3_0
Branch point for: UBC
Changes since 1.17: +20 -1 lines
Diff to previous 1.17 (colored)

Try again. (this time it's tested).
Add proc_cansugid that checks if a process may raise it's privileges.
Rework exec to remove the old sugid workaround and check proc_cansugid
just before raising privileges.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jun 22 14:14:09 2001 UTC (22 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.16: +11 -11 lines
Diff to previous 1.16 (colored)

KNF

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jun 19 07:54:37 2001 UTC (22 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.15: +0 -18 lines
Diff to previous 1.15 (colored)

no way, you are on drugs.  last commit revoked because it broke setuid majorly

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jun 18 13:18:36 2001 UTC (22 years, 11 months ago) by art
Branch: MAIN
Changes since 1.14: +19 -1 lines
Diff to previous 1.14 (colored)

Add proc_cansugid used to check if a process should be allowed
to raise its privileges in exec.

Revision 1.12.10.1 / (download) - annotate - [select for diffs], Mon May 14 22:32:41 2001 UTC (23 years, 1 month ago) by niklas
Branch: SMP
Changes since 1.12: +92 -68 lines
Diff to previous 1.12 (colored)

merge in approximately 2.9 into SMP branch

Revision 1.14 / (download) - annotate - [select for diffs], Wed Nov 8 21:27:03 2000 UTC (23 years, 7 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.13: +69 -54 lines
Diff to previous 1.13 (colored)

Cleanup.
Zap COMPAT_09.
Don't duplicate creds unless necessary.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Sep 12 17:30:45 2000 UTC (23 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.12: +24 -15 lines
Diff to previous 1.12 (colored)

o add missing getsid() prototype
o fix typo in getsid() that broke getsid(pid) where pid != 0
o cause getsid() and getpgid() to return EPERM if requesting the
  id of a session/process group not in the current session
o check for NULL session in getsid() for exiting processes

Revision 1.12 / (download) - annotate - [select for diffs], Mon Nov 17 05:57:45 1997 UTC (26 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: kame_19991208, SMP_BASE, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3
Branch point for: SMP
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

indent

Revision 1.11 / (download) - annotate - [select for diffs], Thu Nov 13 07:11:11 1997 UTC (26 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.10: +21 -2 lines
Diff to previous 1.10 (colored)

add getsid(2), XPG4

Revision 1.10 / (download) - annotate - [select for diffs], Tue Sep 2 08:48:32 1997 UTC (26 years, 9 months ago) by downsj
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.9: +4 -4 lines
Diff to previous 1.9 (colored)

COMPAT_BSDOS exec and compat changes.

Revision 1.9 / (download) - annotate - [select for diffs], Fri May 30 21:43:34 1997 UTC (27 years ago) by kstailey
Branch: MAIN
Changes since 1.8: +23 -1 lines
Diff to previous 1.8 (colored)

add getpgid(2) from NetBSD

Revision 1.8 / (download) - annotate - [select for diffs], Sat Mar 29 08:58:03 1997 UTC (27 years, 2 months ago) by tholo
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.7: +4 -2 lines
Diff to previous 1.7 (colored)

Do return values from issetuid() correctly

Revision 1.7 / (download) - annotate - [select for diffs], Sun Oct 27 04:51:37 1996 UTC (27 years, 7 months ago) by tholo
Branch: MAIN
Changes since 1.6: +3 -1 lines
Diff to previous 1.6 (colored)

Allow set[gu]id() if the [gu]id we are trying to set is the saved [gu]id,
but only set effective [gu]id.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Oct 26 07:29:40 1996 UTC (27 years, 7 months ago) by tholo
Branch: MAIN
Changes since 1.5: +4 -1 lines
Diff to previous 1.5 (colored)

Verify that pgid argument to setpgid() is legal

Revision 1.5 / (download) - annotate - [select for diffs], Wed Oct 2 20:22:14 1996 UTC (27 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

copyinstr correctly; spotted by bitblt

Revision 1.4 / (download) - annotate - [select for diffs], Sun Aug 25 09:51:37 1996 UTC (27 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +13 -1 lines
Diff to previous 1.3 (colored)

issetugid() system call discovers if a process was started setuid or setgid

Revision 1.3 / (download) - annotate - [select for diffs], Thu Aug 1 05:26:02 1996 UTC (27 years, 10 months ago) by tholo
Branch: MAIN
Changes since 1.2: +24 -9 lines
Diff to previous 1.2 (colored)

Implemented _POSIX_SAVED_IDS behaviour according to 1003.1-1990, with
allowed extension from Appendix B, section 4.2.2.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Mar 3 17:19:52 1996 UTC (28 years, 3 months ago) by niklas
Branch: MAIN
Changes since 1.1: +29 -7 lines
Diff to previous 1.1 (colored)

From NetBSD: 960217 merge

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:52:44 1995 UTC (28 years, 8 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:52:44 1995 UTC (28 years, 8 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.