CVS log for src/sys/kern/sys_process.c
Up to [FreeBSD] / src / sys / kern
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Revision 1.178: download - view: text, markup, annotated - select for diffs
Fri Feb 10 00:02:13 2012 UTC (111 minutes, 44 seconds ago) by kib
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +2 -0 lines
SVN rev 231320 on 2012-02-10 00:02:13Z by kib Mark the automatically attached child with PL_FLAG_CHILD in struct lwpinfo flags, for PT_FOLLOWFORK auto-attachment. In collaboration with: Dmitry Mikulin <dmitrym juniper net> MFC after: 1 week
Revision 1.177.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.177.2.1: preferred, colored; next MAIN 1.178: preferred, colored
Changes since revision 1.177.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release cycle. Approved by: re (implicit)
Revision 1.177.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.177: preferred, colored; next MAIN 1.178: preferred, colored
Changes since revision 1.177: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith Copy head to stable/9 as part of 9.0-RELEASE release cycle. Approved by: re (implicit)
Revision 1.177: download - view: text, markup, annotated - select for diffs
Fri Sep 16 13:58:51 2011 UTC (4 months, 3 weeks ago) by kmacy
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +2 -2 lines
SVN rev 225617 on 2011-09-16 13:58:51Z by kmacy In order to maximize the re-usability of kernel code in user space this patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz)
Revision 1.176: download - view: text, markup, annotated - select for diffs
Fri Jun 17 21:44:13 2011 UTC (7 months, 3 weeks ago) by obrien
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +9 -0 lines
SVN rev 223212 on 2011-06-17 21:44:13Z by obrien Add comment from CSRG rev 7.27 (1992/06/23 19:56:55; author: mckusick)
Revision 1.175: download - view: text, markup, annotated - select for diffs
Tue Jun 14 17:09:30 2011 UTC (7 months, 3 weeks ago) by obrien
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +6 -2 lines
SVN rev 223088 on 2011-06-14 17:09:30Z by obrien We should not return ECHILD when debugging a child and the parent does a "wait4(-1, ..., WNOHANG, ...)". Instead wait(2) should behave as if the child does not wish to report status at this time. Reviewed by: jhb
Revision 1.155.2.11: download - view: text, markup, annotated - select for diffs
Tue Mar 1 20:44:14 2011 UTC (11 months, 1 week ago) by dchagin
Branches: RELENG_8
Diff to: previous 1.155.2.10: preferred, colored; branchpoint 1.155: preferred, colored; next MAIN 1.156: preferred, colored
Changes since revision 1.155.2.10: +1 -1 lines
SVN rev 219144 on 2011-03-01 20:44:14Z by dchagin MFC r217896: Add macro to test the sv_flags of any process. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures.
Revision 1.155.2.10: download - view: text, markup, annotated - select for diffs
Sat Feb 5 22:57:14 2011 UTC (12 months ago) by kib
Branches: RELENG_8
Diff to: previous 1.155.2.9: preferred, colored; branchpoint 1.155: preferred, colored
Changes since revision 1.155.2.9: +15 -1 lines
SVN rev 218355 on 2011-02-05 22:57:14Z by kib MFC r217819: Allow debugger to specify that children of the traced process should be automatically traced. Extend the ptrace(PL_LWPINFO) to report that child just forked. To not change the struct thread layout, td_dbg_forked was placed at the end of the structure.
Revision 1.174: download - view: text, markup, annotated - select for diffs
Wed Jan 26 20:03:58 2011 UTC (12 months, 2 weeks ago) by dchagin
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +1 -1 lines
SVN rev 217896 on 2011-01-26 20:03:58Z by dchagin Add macro to test the sv_flags of any process. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures. MFC after: 1 month
Revision 1.173: download - view: text, markup, annotated - select for diffs
Tue Jan 25 10:59:21 2011 UTC (12 months, 2 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +15 -1 lines
SVN rev 217819 on 2011-01-25 10:59:21Z by kib Allow debugger to specify that children of the traced process should be automatically traced. Extend the ptrace(PL_LWPINFO) to report that child just forked. Reviewed by: davidxu, jhb MFC after: 2 weeks
Revision 1.155.2.9: download - view: text, markup, annotated - select for diffs
Mon Dec 27 12:39:24 2010 UTC (13 months, 2 weeks ago) by attilio
Branches: RELENG_8
Diff to: previous 1.155.2.8: preferred, colored; branchpoint 1.155: preferred, colored
Changes since revision 1.155.2.8: +3 -0 lines
SVN rev 216734 on 2010-12-27 12:39:24Z by attilio MFC r215679: Add the ability for GDB to printout the thread name along with other thread specific informations. In order to achieve that, for both on-line debugging and core analysis, a new member to PT_LWPINFO ptrace(2) interface is added and a new ELF note (NT_THRMISC) as well. Sponsored by: Sandvine Incorporated
Revision 1.145.2.2.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.145.2.2: preferred, colored; next MAIN 1.146: preferred, colored
Changes since revision 1.145.2.2: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release. Approved by: re (implicit)
Revision 1.155.2.8.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.155.2.8: preferred, colored; next MAIN 1.155.2.9: preferred, colored
Changes since revision 1.155.2.8: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release. Approved by: re (implicit)
Revision 1.172: download - view: text, markup, annotated - select for diffs
Mon Dec 20 22:49:31 2010 UTC (13 months, 2 weeks ago) by alc
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +17 -63 lines
SVN rev 216604 on 2010-12-20 22:49:31Z by alc Introduce vm_fault_hold() and use it to (1) eliminate a long-standing race condition in proc_rwmem() and to (2) simplify the implementation of the cxgb driver's vm_fault_hold_user_pages(). Specifically, in proc_rwmem() the requested read or write could fail because the targeted page could be reclaimed between the calls to vm_fault() and vm_page_hold(). In collaboration with: kib@ MFC after: 6 weeks
Revision 1.171: download - view: text, markup, annotated - select for diffs
Mon Nov 22 14:42:13 2010 UTC (14 months, 2 weeks ago) by attilio
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +3 -0 lines
SVN rev 215679 on 2010-11-22 14:42:13Z by attilio Add the ability for GDB to printout the thread name along with other thread specific informations. In order to do that, and in order to avoid KBI breakage with existing infrastructure the following semantic is implemented: - For live programs, a new member to the PT_LWPINFO is added (pl_tdname) - For cores, a new ELF note is added (NT_THRMISC) that can be used for storing thread specific, miscellaneous, informations. Right now it is just popluated with a thread name. GDB, then, retrieves the correct informations from the corefile via the BFD interface, as it groks the ELF notes and create appropriate pseudo-sections. Sponsored by: Sandvine Incorporated Tested by: gianni Discussed with: dim, kan, kib MFC after: 2 weeks
Revision 1.155.2.8: download - view: text, markup, annotated - select for diffs
Wed Nov 3 21:24:21 2010 UTC (15 months ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.155.2.7: preferred, colored; branchpoint 1.155: preferred, colored
Changes since revision 1.155.2.7: +62 -3 lines
SVN rev 214756 on 2010-11-03 21:24:21Z by kib MFC r209688: Extend ptrace(PT_LWPINFO) to report siginfo for the signal that caused debugee stop.
Revision 1.155.2.7: download - view: text, markup, annotated - select for diffs
Wed Nov 3 21:21:12 2010 UTC (15 months ago) by kib
Branches: RELENG_8
Diff to: previous 1.155.2.6: preferred, colored; branchpoint 1.155: preferred, colored
Changes since revision 1.155.2.6: +6 -2 lines
SVN rev 214755 on 2010-11-03 21:21:12Z by kib MFC r208453: Reorganize syscall entry and leave handling. Implement ptrace_lwpinfo pl_flags PL_FLAG_SCE, PL_FLAG_SCX and PL_FLAG_EXEC. The i386, amd64, sparc64, sun4v, powerpc and ia64 syscall()s are changed to use syscallenter()/syscallret(). MIPS and arm are not converted and use the mostly unchanged syscall() implementation. MFC r208514: Change ia64' struct syscall_args definition so that args is a pointer to the arguments array instead of array itself. MFC r208566: Allow to use syscallname(9) outside subr_trap.c. MFC r209258 (by rpaulo): Make DTrace syscall provider work again by including opt_kdtrace.h here. MFC r209313: Only enable kdtrace hook in the LINT on the architectures that implement it. MFC r209697: Obey sv_syscallnames bounds in syscallname(). NOTE: The KBI of the struct sysentvec is changed, new required members sv_set_syscall_retval, sv_fetch_syscall_args and sv_syscallnames are added. The sv_prepsyscall field is now ignored. Third-party modules using the struct sysentvec must be modified and recompiled, we believe that only ABI emulators are affected. No such out-of-tree modules are known. In-tree modules that are affected by the change were converted to depend on exact version of the kernel, see r214421.
Revision 1.170: download - view: text, markup, annotated - select for diffs
Sat Oct 9 02:50:23 2010 UTC (16 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +3 -14 lines
SVN rev 213642 on 2010-10-09 02:50:23Z by davidxu Create a global thread hash table to speed up thread lookup, use rwlock to protect the table. In old code, thread lookup is done with process lock held, to find a thread, kernel has to iterate through process and thread list, this is quite inefficient. With this change, test shows in extreme case performance is dramatically improved. Earlier patch was reviewed by: jhb, julian
Revision 1.169: download - view: text, markup, annotated - select for diffs
Sun Jul 4 11:48:30 2010 UTC (19 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +62 -3 lines
SVN rev 209688 on 2010-07-04 11:48:30Z by kib Extend ptrace(PT_LWPINFO) to report siginfo for the signal that caused debugee stop. The change should keep the ABI. Take care of compat32. Discussed with: davidxu, jhb MFC after: 2 weeks
Revision 1.168: download - view: text, markup, annotated - select for diffs
Mon Jun 21 09:55:56 2010 UTC (19 months, 2 weeks ago) by ed
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +3 -3 lines
SVN rev 209390 on 2010-06-21 09:55:56Z by ed Use ISO C99 integer types in sys/kern where possible. There are only about 100 occurences of the BSD-specific u_int*_t datatypes in sys/kern. The ISO C99 integer types are used here more often.
Revision 1.155.2.6.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 4 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.155.2.6: preferred, colored; next MAIN 1.155.2.7: preferred, colored
Changes since revision 1.155.2.6: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith Copy stable/8 to releng/8.1 in preparation for 8.1-RC1. Approved by: re (implicit)
Revision 1.145.2.2: download - view: text, markup, annotated - select for diffs
Tue Jun 1 19:39:27 2010 UTC (20 months, 1 week ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_4_BP
Branch point for: RELENG_7_4
Diff to: previous 1.145.2.1: preferred, colored; branchpoint 1.145: preferred, colored; next MAIN 1.146: preferred, colored
Changes since revision 1.145.2.1: +20 -14 lines
SVN rev 208719 on 2010-06-01 19:39:27Z by jhb MFC 208555: Ignore the 'addr' argument passed to PT_STEP (it is required to be '1' for PT_STEP which means "ignore") and PT_DETACH.
Revision 1.155.2.6: download - view: text, markup, annotated - select for diffs
Tue Jun 1 19:38:46 2010 UTC (20 months, 1 week ago) by jhb
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.155.2.5: preferred, colored; branchpoint 1.155: preferred, colored
Changes since revision 1.155.2.5: +20 -14 lines
SVN rev 208718 on 2010-06-01 19:38:46Z by jhb MFC 208555: Ignore the 'addr' argument passed to PT_STEP (it is required to be '1' for PT_STEP which means "ignore") and PT_DETACH. Approved by: re (kib)
Revision 1.167: download - view: text, markup, annotated - select for diffs
Tue May 25 21:32:37 2010 UTC (20 months, 2 weeks ago) by jhb
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +20 -14 lines
SVN rev 208555 on 2010-05-25 21:32:37Z by jhb Ignore the 'addr' argument passed to PT_STEP (it is required to be '1' for PT_STEP which means "ignore") and PT_DETACH. PR: kern/146167 MFC after: 1 week
Revision 1.166: download - view: text, markup, annotated - select for diffs
Sun May 23 18:32:02 2010 UTC (20 months, 2 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +6 -2 lines
SVN rev 208453 on 2010-05-23 18:32:02Z by kib Reorganize syscall entry and leave handling. Extend struct sysvec with three new elements: sv_fetch_syscall_args - the method to fetch syscall arguments from usermode into struct syscall_args. The structure is machine-depended (this might be reconsidered after all architectures are converted). sv_set_syscall_retval - the method to set a return value for usermode from the syscall. It is a generalization of cpu_set_syscall_retval(9) to allow ABIs to override the way to set a return value. sv_syscallnames - the table of syscall names. Use sv_set_syscall_retval in kern_sigsuspend() instead of hardcoding the call to cpu_set_syscall_retval(). The new functions syscallenter(9) and syscallret(9) are provided that use sv_*syscall* pointers and contain the common repeated code from the syscall() implementations for the architecture-specific syscall trap handlers. Syscallenter() fetches arguments, calls syscall implementation from ABI sysent table, and set up return frame. The end of syscall bookkeeping is done by syscallret(). Take advantage of single place for MI syscall handling code and implement ptrace_lwpinfo pl_flags PL_FLAG_SCE, PL_FLAG_SCX and PL_FLAG_EXEC. The SCE and SCX flags notify the debugger that the thread is stopped at syscall entry or return point respectively. The EXEC flag augments SCX and notifies debugger that the process address space was changed by one of exec(2)-family syscalls. The i386, amd64, sparc64, sun4v, powerpc and ia64 syscall()s are changed to use syscallenter()/syscallret(). MIPS and arm are not converted and use the mostly unchanged syscall() implementation. Reviewed by: jhb, marcel, marius, nwhitehorn, stas Tested by: marcel (ia64), marius (sparc64), nwhitehorn (powerpc), stas (mips) MFC after: 1 month
Revision 1.165: download - view: text, markup, annotated - select for diffs
Fri Apr 30 00:46:43 2010 UTC (21 months, 1 week ago) by kmacy
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +4 -4 lines
SVN rev 207410 on 2010-04-30 00:46:43Z by kmacy On Alan's advice, rather than do a wholesale conversion on a single architecture from page queue lock to a hashed array of page locks (based on a patch by Jeff Roberson), I've implemented page lock support in the MI code and have only moved vm_page's hold_count out from under page queue mutex to page lock. This changes pmap_extract_and_hold on all pmaps. Supported by: Bitgravity Inc. Discussed with: alc, jeffr, and kib
Revision 1.155.2.5: download - view: text, markup, annotated - select for diffs
Wed Apr 7 02:24:41 2010 UTC (22 months ago) by nwhitehorn
Branches: RELENG_8
Diff to: previous 1.155.2.4: preferred, colored; branchpoint 1.155: preferred, colored
Changes since revision 1.155.2.4: +14 -16 lines
SVN rev 206336 on 2010-04-07 02:24:41Z by nwhitehorn MFC r205014,205015: Provide groundwork for 32-bit binary compatibility on non-x86 platforms, for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. This MFC is required for MFCs of later changes to the freebsd32 compatibility from HEAD. Requested by: kib
Revision 1.155.2.4: download - view: text, markup, annotated - select for diffs
Wed Mar 31 02:43:58 2010 UTC (22 months, 1 week ago) by marcel
Branches: RELENG_8
Diff to: previous 1.155.2.3: preferred, colored; branchpoint 1.155: preferred, colored
Changes since revision 1.155.2.3: +4 -0 lines
SVN rev 205956 on 2010-03-31 02:43:58Z by marcel
MFC rev 198341 and 198342:
o Introduce vm_sync_icache() for making the I-cache coherent with
the memory or D-cache, depending on the semantics of the platform.
vm_sync_icache() is basically a wrapper around pmap_sync_icache(),
that translates the vm_map_t argumument to pmap_t.
o Introduce pmap_sync_icache() to all PMAP implementation. For powerpc
it replaces the pmap_page_executable() function, added to solve
the I-cache problem in uiomove_fromphys().
o In proc_rwmem() call vm_sync_icache() when writing to a page that
has execute permissions. This assures that when breakpoints are
written, the I-cache will be coherent and the process will actually
hit the breakpoint.
o This also fixes the Book-E PMAP implementation that was missing
necessary locking while trying to deal with the I-cache coherency
in pmap_enter() (read: mmu_booke_enter_locked).
Revision 1.164: download - view: text, markup, annotated - select for diffs
Thu Mar 11 14:49:06 2010 UTC (23 months ago) by nwhitehorn
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +14 -16 lines
SVN rev 205014 on 2010-03-11 14:49:06Z by nwhitehorn Provide groundwork for 32-bit binary compatibility on non-x86 platforms, for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. Reviewed by: kib, jhb
Revision 1.155.2.3: download - view: text, markup, annotated - select for diffs
Sun Mar 7 00:05:44 2010 UTC (23 months ago) by marcel
Branches: RELENG_8
Diff to: previous 1.155.2.2: preferred, colored; branchpoint 1.155: preferred, colored
Changes since revision 1.155.2.2: +179 -0 lines
SVN rev 204813 on 2010-03-07 00:05:44Z by marcel MFC revs 203696, 203708, 203783 and 203788: Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can obtain the memory map of the traced process. Requested by: kib@
Revision 1.163: download - view: text, markup, annotated - select for diffs
Thu Feb 11 21:10:56 2010 UTC (23 months, 4 weeks ago) by marcel
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +3 -0 lines
SVN rev 203788 on 2010-02-11 21:10:56Z by marcel Initialize pve_fsid and pve_fileid to VNOVAL.
Revision 1.162: download - view: text, markup, annotated - select for diffs
Thu Feb 11 18:00:53 2010 UTC (23 months, 4 weeks ago) by marcel
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +123 -69 lines
SVN rev 203783 on 2010-02-11 18:00:53Z by marcel o Add support for COMPAT_IA32. o Incorporate review comments: - Properly reference and lock the map - Take into account that the VM map can change inbetween requests - Add the fileid and fsid attributes Credits: kib@ Reviewed by: kib@
Revision 1.145.2.1.6.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (2 years ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.145.2.1: preferred, colored; next MAIN 1.145.2.2: preferred, colored
Changes since revision 1.145.2.1: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process. Approved by: re (implicit)
Revision 1.161: download - view: text, markup, annotated - select for diffs
Tue Feb 9 17:20:00 2010 UTC (2 years ago) by marcel
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +19 -0 lines
SVN rev 203708 on 2010-02-09 17:20:00Z by marcel Unbreak building kernels with COMPAT_32 enabled. The actual support for the PT_VM_ENTRY request from 32-bit processes will follow. Pointy hat: marcel
Revision 1.160: download - view: text, markup, annotated - select for diffs
Tue Feb 9 05:52:35 2010 UTC (2 years ago) by marcel
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +103 -0 lines
SVN rev 203696 on 2010-02-09 05:52:35Z by marcel Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can obtain the memory map of the traced process. PT_VM_TIMESTAMP can be used to check if the memory map changed since the last time to avoid iterating over all the VM entries unnecesarily. MFC after: 1 month
Revision 1.155.2.2: download - view: text, markup, annotated - select for diffs
Sun Feb 7 11:37:38 2010 UTC (2 years ago) by kib
Branches: RELENG_8
Diff to: previous 1.155.2.1: preferred, colored; branchpoint 1.155: preferred, colored
Changes since revision 1.155.2.1: +5 -0 lines
SVN rev 203608 on 2010-02-07 11:37:38Z by kib MFC r202882: For i386, amd64 and ia32 on amd64 MD syscall(), reread syscall number and arguments after ptracestop(), if debugger modified anything in the process environment.
Revision 1.159: download - view: text, markup, annotated - select for diffs
Sat Jan 23 11:45:35 2010 UTC (2 years ago) by kib
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +5 -0 lines
SVN rev 202882 on 2010-01-23 11:45:35Z by kib For PT_TO_SCE stop that stops the ptraced process upon syscall entry, syscall arguments are collected before ptracestop() is called. As a consequence, debugger cannot modify syscall or its arguments. For i386, amd64 and ia32 on amd64 MD syscall(), reread syscall number and arguments after ptracestop(), if debugger modified anything in the process environment. Since procfs stopeven requires number of syscall arguments in p_xstat, this cannot be solved by moving stop/trace point before argument fetching. Move the code to read arguments into separate function fetch_syscall_args() to avoid code duplication. Note that ktrace point for modified syscall is intentionally recorded twice, once with original arguments, and second time with the arguments set by debugger. PT_TO_SCX stop is executed after cpu_syscall_set_retval() already. Reported by: Ali Polatel <alip exherbo org> Briefly discussed with: jhb MFC after: 3 weeks
Revision 1.158: download - view: text, markup, annotated - select for diffs
Thu Nov 26 05:16:07 2009 UTC (2 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +12 -9 lines
SVN rev 199819 on 2009-11-26 05:16:07Z by alc Replace VM_PROT_OVERRIDE_WRITE by VM_PROT_COPY. VM_PROT_OVERRIDE_WRITE has represented a write access that is allowed to override write protection. Until now, VM_PROT_OVERRIDE_WRITE has been used to write breakpoints into text pages. Text pages are not just write protected but they are also copy-on-write. VM_PROT_OVERRIDE_WRITE overrides the write protection on the text page and triggers the replication of the page so that the breakpoint will be written to a private copy. However, here is where things become confused. It is the debugger, not the process being debugged that requires write access to the copied page. Nonetheless, the copied page is being mapped into the process with write access enabled. In other words, once the debugger sets a breakpoint within a text page, the program can write to its private copy of that text page. Whereas prior to setting the breakpoint, a SIGSEGV would have occurred upon a write access. VM_PROT_COPY addresses this problem. The combination of VM_PROT_READ and VM_PROT_COPY forces the replication of a copy-on-write page even though the access is only for read. Moreover, the replicated page is only mapped into the process with read access, and not write access. Reviewed by: kib MFC after: 4 weeks
Revision 1.157: download - view: text, markup, annotated - select for diffs
Sun Oct 25 02:48:29 2009 UTC (2 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +1 -1 lines
SVN rev 198463 on 2009-10-25 02:48:29Z by alc Update a comment to reflect the previous change.
Revision 1.155.2.1.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.155.2.1: preferred, colored; next MAIN 1.155.2.2: preferred, colored
Changes since revision 1.155.2.1: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure. Approved by: re (implicit)
Revision 1.156: download - view: text, markup, annotated - select for diffs
Wed Oct 21 18:38:02 2009 UTC (2 years, 3 months ago) by marcel
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +4 -0 lines
SVN rev 198341 on 2009-10-21 18:38:02Z by marcel
o Introduce vm_sync_icache() for making the I-cache coherent with
the memory or D-cache, depending on the semantics of the platform.
vm_sync_icache() is basically a wrapper around pmap_sync_icache(),
that translates the vm_map_t argumument to pmap_t.
o Introduce pmap_sync_icache() to all PMAP implementation. For powerpc
it replaces the pmap_page_executable() function, added to solve
the I-cache problem in uiomove_fromphys().
o In proc_rwmem() call vm_sync_icache() when writing to a page that
has execute permissions. This assures that when breakpoints are
written, the I-cache will be coherent and the process will actually
hit the breakpoint.
o This also fixes the Book-E PMAP implementation that was missing
necessary locking while trying to deal with the I-cache coherency
in pmap_enter() (read: mmu_booke_enter_locked).
The key property of this change is that the I-cache is made coherent
*after* writes have been done. Doing it in the PMAP layer when adding
or changing a mapping means that the I-cache is made coherent *before*
any writes happen. The difference is key when the I-cache prefetches.
Revision 1.155.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith Copy head to stable/8 as part of 8.0 Release cycle. Approved by: re (Implicit)
Revision 1.155: download - view: text, markup, annotated - select for diffs
Thu Jul 2 09:15:30 2009 UTC (2 years, 7 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +0 -1 lines
SVN rev 195280 on 2009-07-02 09:15:30Z by rwatson Clean up a number of aspects of token generation from audit arguments to system calls: - Centralize generation of argument tokens for VM addresses in a macro, ADDR_TOKEN(), and properly encode 64-bit addresses in 64-bit arguments. - Fix up argument numbers across a large number of syscalls so that they match the numeric argument into the system call. - Don't audit the address argument to ioctl(2) or ptrace(2), but do keep generating tokens for mmap(2), minherit(2), since they relate to passing object access across execve(2). Approved by: re (audit argument blanket) Obtained from: TrustedBSD Project MFC after: 1 week
Revision 1.154: download - view: text, markup, annotated - select for diffs
Sat Jun 27 13:58:44 2009 UTC (2 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +5 -5 lines
SVN rev 195104 on 2009-06-27 13:58:44Z by rwatson Replace AUDIT_ARG() with variable argument macros with a set more more specific macros for each audit argument type. This makes it easier to follow call-graphs, especially for automated analysis tools (such as fxr). In MFC, we should leave the existing AUDIT_ARG() macros as they may be used by third-party kernel modules. Suggested by: brooks Approved by: re (kib) Obtained from: TrustedBSD Project MFC after: 1 week
Revision 1.153: download - view: text, markup, annotated - select for diffs
Tue Jun 23 20:45:22 2009 UTC (2 years, 7 months ago) by kib
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +5 -1 lines
SVN rev 194766 on 2009-06-23 20:45:22Z by kib Implement global and per-uid accounting of the anonymous memory. Add rlimit RLIMIT_SWAP that limits the amount of swap that may be reserved for the uid. The accounting information (charge) is associated with either map entry, or vm object backing the entry, assuming the object is the first one in the shadow chain and entry does not require COW. Charge is moved from entry to object on allocation of the object, e.g. during the mmap, assuming the object is allocated, or on the first page fault on the entry. It moves back to the entry on forks due to COW setup. The per-entry granularity of accounting makes the charge process fair for processes that change uid during lifetime, and decrements charge for proper uid when region is unmapped. The interface of vm_pager_allocate(9) is extended by adding struct ucred *, that is used to charge appropriate uid when allocation if performed by kernel, e.g. md(4). Several syscalls, among them is fork(2), may now return ENOMEM when global or per-uid limits are enforced. In collaboration with: pho Reviewed by: alc Approved by: re (kensmith)
Revision 1.145.2.1.4.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.145.2.1: preferred, colored; next MAIN 1.145.2.2: preferred, colored
Changes since revision 1.145.2.1: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE. Approved by: re (implicit)
Revision 1.152: download - view: text, markup, annotated - select for diffs
Mon Mar 2 18:43:50 2009 UTC (2 years, 11 months ago) by kib
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +4 -5 lines
SVN rev 189282 on 2009-03-02 18:43:50Z by kib Use the p_sysent->sv_flags flag SV_ILP32 to detect 32bit process executing on 64bit kernel. This eliminates the direct comparisions of p_sysent with &ia32_freebsd_sysvec, that were left intact after r185169.
Revision 1.145.2.1.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.145.2.1: preferred, colored; next MAIN 1.145.2.2: preferred, colored
Changes since revision 1.145.2.1: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith Create releng/7.1 in preparation for moving into RC phase of 7.1 release cycle. Approved by: re (implicit)
Revision 1.151: download - view: text, markup, annotated - select for diffs
Wed Nov 5 03:01:23 2008 UTC (3 years, 3 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +2 -0 lines
SVN rev 184667 on 2008-11-05 03:01:23Z by davidxu Revert rev 184216 and 184199, due to the way the thread_lock works, it may cause a lockup. Noticed by: peter, jhb
Revision 1.150: download - view: text, markup, annotated - select for diffs
Thu Oct 23 07:55:38 2008 UTC (3 years, 3 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +0 -2 lines
SVN rev 184199 on 2008-10-23 07:55:38Z by davidxu Actually, for signal and thread suspension, extra process spin lock is unnecessary, the normal process lock and thread lock are enough. The spin lock is still needed for process and thread exiting to mimic single sched_lock.
Revision 1.149: download - view: text, markup, annotated - select for diffs
Wed Oct 15 06:31:37 2008 UTC (3 years, 3 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +6 -11 lines
SVN rev 183911 on 2008-10-15 06:31:37Z by davidxu Move per-thread userland debugging flags into seperated field, this eliminates some problems of locking, e.g, a thread lock is needed but can not be used at that time. Only the process lock is needed now for new field.
Revision 1.131.2.8.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.131.2.8: preferred, colored; next MAIN 1.132: preferred, colored
Changes since revision 1.131.2.8: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith Create releng/6.4 from stable/6 in preparation for 6.4-RC1. Approved by: re (implicit)
Revision 1.131.2.8: download - view: text, markup, annotated - select for diffs
Wed Jul 30 19:52:54 2008 UTC (3 years, 6 months ago) by jhb
Branches: RELENG_6
CVS tags: RELENG_6_4_BP
Branch point for: RELENG_6_4
Diff to: previous 1.131.2.7: preferred, colored; branchpoint 1.131: preferred, colored; next MAIN 1.132: preferred, colored
Changes since revision 1.131.2.7: +3 -2 lines
SVN rev 181010 on 2008-07-30 19:52:54Z by jhb MFC: Use VM_FAULT_DIRTY to fault in pages for write access in proc_rwmem().
Revision 1.145.2.1: download - view: text, markup, annotated - select for diffs
Wed Jul 30 19:49:10 2008 UTC (3 years, 6 months ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_3_BP, RELENG_7_2_BP, RELENG_7_1_BP
Branch point for: RELENG_7_3, RELENG_7_2, RELENG_7_1
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +3 -2 lines
SVN rev 181009 on 2008-07-30 19:49:10Z by jhb MFC: Use VM_FAULT_DIRTY to fault in pages for write access in proc_rwmem().
Revision 1.148: download - view: text, markup, annotated - select for diffs
Wed Mar 19 06:19:00 2008 UTC (3 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +1 -5 lines
- Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice from requiring the per-process spinlock to only requiring the process lock. - Reflect these changes in the proc.h documentation and consumers throughout the kernel. This is a substantial reduction in locking cost for these fields and was made possible by recent changes to threading support.
Revision 1.147: download - view: text, markup, annotated - select for diffs
Wed Mar 12 10:11:59 2008 UTC (3 years, 11 months ago) by jeff
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +0 -15 lines
Remove kernel support for M:N threading. While the KSE project was quite successful in bringing threading to FreeBSD, the M:N approach taken by the kse library was never developed to its full potential. Backwards compatibility will be provided via libmap.conf for dynamically linked binaries and static binaries will be broken.
Revision 1.146: download - view: text, markup, annotated - select for diffs
Thu Nov 8 19:35:36 2007 UTC (4 years, 3 months ago) by ups
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +3 -2 lines
Use VM_FAULT_DIRTY to fault in pages for write access in proc_rwmen. Otherwise copy on write may create an anonymous page that is not marked as dirty. Since writing data to these pages in this function also does not dirty these pages they may be later discarded by the pagedaemon.
Revision 1.145: download - view: text, markup, annotated - select for diffs
Tue Oct 9 00:03:39 2007 UTC (4 years, 4 months ago) by jeff
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0
Branch point for: RELENG_7
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +9 -9 lines
- Fix from pr kern/115469; Don't redeliver a signal once it has been handled by the target process. Contributed by: Tijl Coosemans <tijl@ulyssis.org> Approved by: re
Revision 1.144: download - view: text, markup, annotated - select for diffs
Mon Sep 17 05:27:20 2007 UTC (4 years, 4 months ago) by jeff
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +1 -1 lines
- Move all of the PS_ flags into either p_flag or td_flags. - p_sflag was mostly protected by PROC_LOCK rather than the PROC_SLOCK or previously the sched_lock. These bugs have existed for some time. - Allow swapout to try each thread in a process individually and then swapin the whole process if any of these fail. This allows us to move most scheduler related swap flags into td_flags. - Keep ki_sflag for backwards compat but change all in source tools to use the new and more correct location of P_INMEM. Reported by: pho Reviewed by: attilio, kib Approved by: re (kensmith)
Revision 1.143: download - view: text, markup, annotated - select for diffs
Tue Jun 5 00:00:54 2007 UTC (4 years, 8 months ago) by jeff
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +18 -15 lines
Commit 14/14 of sched_lock decomposition. - Use thread_lock() rather than sched_lock for per-thread scheduling sychronization. - Use the per-process spinlock rather than the sched_lock for per-process scheduling synchronization. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
Revision 1.142: download - view: text, markup, annotated - select for diffs
Sun Mar 4 22:36:46 2007 UTC (4 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +0 -3 lines
Remove 'MPSAFE' annotations from the comments above most system calls: all system calls now enter without Giant held, and then in some cases, acquire Giant explicitly. Remove a number of other MPSAFE annotations in the credential code and tweak one or two other adjacent comments.
Revision 1.131.2.7: download - view: text, markup, annotated - select for diffs
Tue Nov 14 19:28:37 2006 UTC (5 years, 2 months ago) by trhodes
Branches: RELENG_6
CVS tags: RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3, RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2
Diff to: previous 1.131.2.6: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.6: +1 -1 lines
MFC 1.139: Close a race condition where num can be larger than tmp, giving the user too large of a boundary. Reported by: Ilja Van Sprundel Approved by: re (kensmith)
Revision 1.141: download - view: text, markup, annotated - select for diffs
Thu Oct 26 21:42:20 2006 UTC (5 years, 3 months ago) by jb
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +6 -0 lines
Make KSE a kernel option, turned on by default in all GENERIC kernel configs except sun4v (which doesn't process signals properly with KSE). Reviewed by: davidxu@
Revision 1.140: download - view: text, markup, annotated - select for diffs
Wed Oct 25 06:18:04 2006 UTC (5 years, 3 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +1 -5 lines
Move sigqueue_take() call into proc_reparent(), this fixed bugs where proc_reparent() is called but sigqueue_take() is forgotten.
Revision 1.139: download - view: text, markup, annotated - select for diffs
Sat Oct 14 10:30:14 2006 UTC (5 years, 3 months ago) by trhodes
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +1 -1 lines
Close a race condition where num can be larger than tmp, giving the user too large of a boundary. Reported by: Ilja Van Sprundel
Revision 1.131.2.6: download - view: text, markup, annotated - select for diffs
Sun Sep 3 08:06:59 2006 UTC (5 years, 5 months ago) by rwatson
Branches: RELENG_6
Diff to: previous 1.131.2.5: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.5: +7 -0 lines
Merge kern_sig.c:1.322, sys_process.c:1.136, vfs_vnops.c:1.238 from HEAD to RELENG_6: Audit the arguments to the kill(2) and killpg(2) system calls. Audit the arguments to the ptrace(2) system call. Make sure that we are adding a path token to the audit record in open(2). Do this by making sure we are using the AUDITVNODE1 mask in the namei flags. Obtained from: TrustedBSD Project
Revision 1.131.2.5: download - view: text, markup, annotated - select for diffs
Fri Aug 25 12:36:54 2006 UTC (5 years, 5 months ago) by cperciva
Branches: RELENG_6
Diff to: previous 1.131.2.4: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.4: +1 -1 lines
MFC: Fix a signedness bug. Security: Local DoS
Revision 1.138: download - view: text, markup, annotated - select for diffs
Sun Aug 20 10:29:08 2006 UTC (5 years, 5 months ago) by cperciva
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +1 -1 lines
Fix a signedness bug. MFC after: 3 days Security: Local DoS
Revision 1.131.2.4: download - view: text, markup, annotated - select for diffs
Wed May 17 00:41:49 2006 UTC (5 years, 8 months ago) by davidxu
Branches: RELENG_6
Diff to: previous 1.131.2.3: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.3: +2 -0 lines
MFC following revisions: sys/ptrace.h 1.27 kern/sys_process 1.135 get LWP's signal info.
Revision 1.131.2.3: download - view: text, markup, annotated - select for diffs
Tue Mar 7 18:08:09 2006 UTC (5 years, 11 months ago) by jhb
Branches: RELENG_6
CVS tags: RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1
Diff to: previous 1.131.2.2: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.2: +60 -104 lines
MFC: Close some races between procfs/ptrace and exit1() by changing exit1() to block until any current PHOLD's are released. This includes Simplifying the cleanup code in kern_ptrace() and removing the now unnecessary vmspace ref counting magic from proc_rwmem(). Also, the locking for ptrace_single_step(), ptrace_set_pc(), and ptrace_clear_single_step() have been fixed to be consistent across the tree. Approved by: re (scottl)
Revision 1.127.2.5: download - view: text, markup, annotated - select for diffs
Tue Feb 28 15:02:51 2006 UTC (5 years, 11 months ago) by emaste
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5
Diff to: previous 1.127.2.4: preferred, colored; branchpoint 1.127: preferred, colored; next MAIN 1.128: preferred, colored
Changes since revision 1.127.2.4: +30 -26 lines
MFC kern_sig.c 1.319 sys_process.c 1.134 to RELENG_5: Avoid kernel panic when attaching a process which may not be stopped by debugger, e.g process is dumping core. Only access p_xthread if P_STOPPED_TRACE is set, this means thread is ready to exchange signal with debugger, print a warning if P_STOPPED_TRACE is not set due to some bugs in other code, if there is. The patch has been tested by Anish Mistry mistry.7 at osu dot edu, and is slightly adjusted. Approved by: re (scottl)
Revision 1.127.2.4: download - view: text, markup, annotated - select for diffs
Tue Feb 28 14:58:36 2006 UTC (5 years, 11 months ago) by emaste
Branches: RELENG_5
Diff to: previous 1.127.2.3: preferred, colored; branchpoint 1.127: preferred, colored
Changes since revision 1.127.2.3: +4 -2 lines
MFC kern_kse.c 1.215 sys_process.c 1.132 to RELENG_5: Fix a LOR between sched_lock and sleep queue lock. kern_kse.c 1.216: Add missing brackets. LOR ID: 060 Approved by: re (scottl)
Revision 1.137: download - view: text, markup, annotated - select for diffs
Wed Feb 22 18:57:50 2006 UTC (5 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +60 -104 lines
Close some races between procfs/ptrace and exit(2): - Reorder the events in exit(2) slightly so that we trigger the S_EXIT stop event earlier. After we have signalled that, we set P_WEXIT and then wait for any processes with a hold on the vmspace via PHOLD to release it. PHOLD now KASSERT()'s that P_WEXIT is clear when it is invoked, and PRELE now does a wakeup if P_WEXIT is set and p_lock drops to zero. - Change proc_rwmem() to require that the processing read from has its vmspace held via PHOLD by the caller and get rid of all the junk to screw around with the vmspace reference count as we no longer need it. - In ptrace() and pseudofs(), treat a process with P_WEXIT set as if it doesn't exist. - Only do one PHOLD in kern_ptrace() now, and do it earlier so it covers FIX_SSTEP() (since on alpha at least this can end up calling proc_rwmem() to clear an earlier single-step simualted via a breakpoint). We only do one to avoid races. Also, by making the EINVAL error for unknown requests be part of the default: case in the switch, the various switch cases can now just break out to return which removes a _lot_ of duplicated PRELE and proc unlocks, etc. Also, it fixes at least one bug where a LWP ptrace command could return EINVAL with the proc lock still held. - Changed the locking for ptrace_single_step(), ptrace_set_pc(), and ptrace_clear_single_step() to always be called with the proc lock held (it was a mixed bag previously). Alpha and arm have to drop the lock while the mess around with breakpoints, but other archs avoid extra lock release/acquires in ptrace(). I did have to fix a couple of other consumers in kern_kse and a few other places to hold the proc lock and PHOLD. Tested by: ps (1 mostly, but some bits of 2-4 as well) MFC after: 1 week
Revision 1.136: download - view: text, markup, annotated - select for diffs
Tue Feb 14 01:18:31 2006 UTC (5 years, 11 months ago) by wsalamon
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +7 -0 lines
Audit the arguments to the ptrace(2) system call. Obtained from: TrustedBSD Project Approved by: rwatson (mentor)
Revision 1.135: download - view: text, markup, annotated - select for diffs
Mon Feb 6 09:41:56 2006 UTC (6 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +2 -0 lines
Add members pl_sigmask and pl_siglist into ptrace_lwpinfo to get lwp's signal mask and pending signals.
Revision 1.131.2.2: download - view: text, markup, annotated - select for diffs
Sat Jan 7 11:53:49 2006 UTC (6 years, 1 month ago) by davidxu
Branches: RELENG_6
Diff to: previous 1.131.2.1: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.1: +30 -26 lines
MFC following revisions: kern_sig.c revision 1.319 sys_process.c revision 1.134 Avoid kernel panic when attaching a process which may not be stopped by debugger, e.g process is dumping core.
Revision 1.134: download - view: text, markup, annotated - select for diffs
Sat Dec 24 02:59:29 2005 UTC (6 years, 1 month ago) by davidxu
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +30 -26 lines
Avoid kernel panic when attaching a process which may not be stopped by debugger, e.g process is dumping core. Only access p_xthread if P_STOPPED_TRACE is set, this means thread is ready to exchange signal with debugger, print a warning if P_STOPPED_TRACE is not set due to some bugs in other code, if there is. The patch has been tested by Anish Mistry mistry.7 at osu dot edu, and is slightly adjusted.
Revision 1.133: download - view: text, markup, annotated - select for diffs
Tue Nov 8 23:28:12 2005 UTC (6 years, 3 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +10 -1 lines
Make sure pending SIGCHLD is removed from previous parent when process is attached or detached.
Revision 1.131.2.1: download - view: text, markup, annotated - select for diffs
Tue Sep 27 12:17:38 2005 UTC (6 years, 4 months ago) by davidxu
Branches: RELENG_6
CVS tags: RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +4 -2 lines
MFC kern/sys_process.c revision 1.132
kern/kern_kse.c revision 1.215
> Fix a LOR between sched_lock and sleep queue lock.
Approved by: re(scottl)
Revision 1.132: download - view: text, markup, annotated - select for diffs
Fri Aug 19 13:35:34 2005 UTC (6 years, 5 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +4 -2 lines
Fix a LOR between sched_lock and sleep queue lock.
Revision 1.131: download - view: text, markup, annotated - select for diffs
Thu Jun 30 07:49:22 2005 UTC (6 years, 7 months ago) by peter
Branches: MAIN
CVS tags: RELENG_6_BP
Branch point for: RELENG_6
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +178 -22 lines
Jumbo-commit to enhance 32 bit application support on 64 bit kernels. This is good enough to be able to run a RELENG_4 gdb binary against a RELENG_4 application, along with various other tools (eg: 4.x gcore). We use this at work. ia32_reg.[ch]: handle the 32 bit register file format, used by ptrace, procfs and core dumps. procfs_*regs.c: vary the format of proc/XXX/*regs depending on the client and target application. procfs_map.c: Don't print a 64 bit value to 32 bit consumers, or their sscanf fails. They expect an unsigned long. imgact_elf.c: produce a valid 32 bit coredump for 32 bit apps. sys_process.c: handle 32 bit consumers debugging 32 bit targets. Note that 64 bit consumers can still debug 32 bit targets. IA64 has got stubs for ia32_reg.c. Known limitations: a 5.x/6.x gdb uses get/setcontext(), which isn't implemented in the 32/64 wrapper yet. We also make a tiny patch to gdb pacify it over conflicting formats of ld-elf.so.1. Approved by: re
Revision 1.127.2.3: download - view: text, markup, annotated - select for diffs
Tue Mar 29 07:24:45 2005 UTC (6 years, 10 months ago) by das
Branches: RELENG_5
CVS tags: RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.127.2.2: preferred, colored; branchpoint 1.127: preferred, colored
Changes since revision 1.127.2.2: +2 -0 lines
MFC sys_process.c,v 1.130: Add missing cases for PT_SYSCALL. Approved by: re
Revision 1.130: download - view: text, markup, annotated - select for diffs
Fri Mar 18 21:22:28 2005 UTC (6 years, 10 months ago) by das
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +2 -0 lines
Add missing cases for PT_SYSCALL. Found by: Coverity Prevent analysis tool
Revision 1.127.2.2: download - view: text, markup, annotated - select for diffs
Sat Feb 5 01:02:50 2005 UTC (7 years ago) by das
Branches: RELENG_5
Diff to: previous 1.127.2.1: preferred, colored; branchpoint 1.127: preferred, colored
Changes since revision 1.127.2.1: +1 -1 lines
MFC: 2004-11-27 06:51:39 UTC Don't include sys/user.h merely for its side-effect of recursively including other headers.
Revision 1.127.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:26:17 2005 UTC (7 years ago) by imp
Branches: RELENG_5
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +1 -1 lines
MFC: /*- and related license changes
Revision 1.129: download - view: text, markup, annotated - select for diffs
Thu Jan 6 23:35:39 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +1 -1 lines
/* -> /*- for copyright notices, minor format tweaks as necessary
Revision 1.128: download - view: text, markup, annotated - select for diffs
Sat Nov 27 06:51:37 2004 UTC (7 years, 2 months ago) by das
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +1 -1 lines
Don't include sys/user.h merely for its side-effect of recursively including other headers.
Revision 1.127: download - view: text, markup, annotated - select for diffs
Sun Aug 8 22:26:11 2004 UTC (7 years, 6 months ago) by davidxu
Branches: MAIN
CVS tags: RELENG_5_BP, RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Branch point for: RELENG_5
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +7 -0 lines
Add pl_flags to ptrace_lwpinfo, two flags PL_FLAG_SA and PL_FLAG_BOUND indicate that a thread is in UTS critical region. Reviewed by: deischen Approved by: marcel
Revision 1.126: download - view: text, markup, annotated - select for diffs
Tue Jul 27 03:53:40 2004 UTC (7 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +7 -11 lines
- Use atomic ops for updating the vmspace's refcnt and exitingcnt. - Push down Giant into shmexit(). (Giant is acquired only if the vmspace contains shm segments.) - Eliminate the acquisition of Giant from proc_rwmem(). - Reduce the scope of Giant in exit1(), uncovering the destruction of the address space.
Revision 1.125: download - view: text, markup, annotated - select for diffs
Sun Jul 18 00:59:57 2004 UTC (7 years, 6 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +0 -0 lines
This is a forced commit. Clear suspension flag for debugged process when detaching.
Revision 1.124: download - view: text, markup, annotated - select for diffs
Sat Jul 17 23:15:41 2004 UTC (7 years, 6 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +1 -1 lines
Fix typo.
Revision 1.123: download - view: text, markup, annotated - select for diffs
Tue Jul 13 07:25:24 2004 UTC (7 years, 6 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +109 -10 lines
Implement following commands: PT_CLEARSTEP, PT_SETSTEP, PT_SUSPEND PT_RESUME, PT_GETNUMLWPS, PT_GETLWPLIST.
Revision 1.122: download - view: text, markup, annotated - select for diffs
Mon Jul 12 05:07:50 2004 UTC (7 years, 7 months ago) by marcel
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +19 -0 lines
Implement the PT_LWPINFO request. This request can be used by the
tracing process to obtain information about the LWP that caused the
traced process to stop. Debuggers can use this information to select
the thread currently running on the LWP as the current thread.
The request has been made compatible with NetBSD for as much as
possible. This implementation differs from NetBSD in the following
ways:
1. The data argument is allowed to be smaller than the size of the
ptrace_lwpinfo structure known to the kernel, but not 0. This
is opposite to what NetBSD allows. The reason for this is that
we can extend the structure without affecting older binaries.
2. On NetBSD the tracing process is to set the pl_lwpid field to
the Id of the LWP it wants information of. We don't do that.
Our ptrace interface allows passing the LWP Id instead of the
PID. The tracing process is to set the PID to the LWP Id it
wants information of.
3. When the PID is actually the PID of the tracing process, this
request returns the information about the LWP that caused the
process to stop. This was the whole purpose of the request in
the first place.
When the traced process has exited, this request will return the
LWP Id 0, indicating that the process state is not the result of
an event specific to a LWP.
Revision 1.121: download - view: text, markup, annotated - select for diffs
Fri Jul 2 09:19:22 2004 UTC (7 years, 7 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +36 -6 lines
Allow ptrace to deal with lwpid. Reviewed by: marcel
Revision 1.120: download - view: text, markup, annotated - select for diffs
Thu Apr 1 20:56:44 2004 UTC (7 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +8 -8 lines
Finish fixing up Alpha to work with an MP safe ptrace(): - ptrace_single_step() is no longer called with the proc lock held, so don't try to unlock it and then relock it. - Push Giant down into proc_rwmem() instead of forcing all the consumers (including Alpha breakpoint support) to explicitly wrap calls to proc_rwmem() with Giant. Tested by: kensmith
Revision 1.119: download - view: text, markup, annotated - select for diffs
Wed Mar 24 23:35:04 2004 UTC (7 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +1 -9 lines
Use uiomove_fromphys() instead of pmap_qenter() and pmap_qremove() in proc_rwmem().
Revision 1.118: download - view: text, markup, annotated - select for diffs
Mon Mar 15 18:48:28 2004 UTC (7 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +11 -6 lines
Drop the proc lock around calls to the MD functions ptrace_single_step(), ptrace_set_pc(), and cpu_ptrace() so that those functions are free to acquire Giant, sleep, etc. We already do a PHOLD/PRELE around them so that it is safe to sleep inside of these routines if necessary. This allows ptrace() to be marked MP safe again as it no longer triggers lock order reversals on Alpha. Tested by: wilko
Revision 1.51.2.9: download - view: text, markup, annotated - select for diffs
Thu Mar 4 09:02:37 2004 UTC (7 years, 11 months ago) by truckman
Branches: RELENG_4
CVS tags: RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.51.2.8: preferred, colored; branchpoint 1.51: preferred, colored; next MAIN 1.52: preferred, colored
Changes since revision 1.51.2.8: +0 -0 lines
Forced commit. Previous commit also MFC'ed sys_process.c rev 1.117. When reparenting a process in the PT_DETACH code, only set p_sigparent to SIGCHLD if the new parent process is initproc.
Revision 1.51.2.8: download - view: text, markup, annotated - select for diffs
Wed Mar 3 09:18:41 2004 UTC (7 years, 11 months ago) by truckman
Branches: RELENG_4
Diff to: previous 1.51.2.7: preferred, colored; branchpoint 1.51: preferred, colored
Changes since revision 1.51.2.7: +2 -0 lines
MFC: kern_exit.c 1.221
sys_process.c 1.116
When reparenting a process to init, make sure that p_sigparent is
set to SIGCHLD.
Revision 1.117: download - view: text, markup, annotated - select for diffs
Thu Feb 19 10:39:42 2004 UTC (7 years, 11 months ago) by truckman
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +2 -1 lines
When reparenting a process in the PT_DETACH code, only set p_sigparent to SIGCHLD if the new parent process is initproc. MFC after: 2 weeks
Revision 1.116: download - view: text, markup, annotated - select for diffs
Wed Feb 11 22:06:02 2004 UTC (8 years ago) by truckman
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +1 -0 lines
When reparenting a process to init, make sure that p_sigparent is set to SIGCHLD. This avoids the creation of orphaned Linux-threaded zombies that init is unable to reap. This can occur when the parent process sets its SIGCHLD to SIG_IGN. Fix a similar situation in the PT_DETACH code. Tested by: "Steven Hartland" <killing AT multiplay.co.uk>
Revision 1.115: download - view: text, markup, annotated - select for diffs
Thu Oct 9 10:17:16 2003 UTC (8 years, 4 months ago) by robert
Branches: MAIN
CVS tags: RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +16 -1 lines
Implement preliminary support for the PT_SYSCALL command to ptrace(2).
Revision 1.114: download - view: text, markup, annotated - select for diffs
Fri Aug 15 05:25:06 2003 UTC (8 years, 5 months ago) by marcel
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +13 -22 lines
Add or finish support for machine dependent ptrace requests. When we check for permissions, do it for all requests, not the known requests. Later when we actually service the request we deal with the invalid requests we previously caught earlier. This commit changes the behaviour of the ptrace(2) interface for boundary cases such as an unknown request without proper permissions. Previously we would return EINVAL. Now we return EBUSY or EPERM. Platforms need to define __HAVE_PTRACE_MACHDEP when they have MD requests. This makes the prototype of cpu_ptrace() visible and introduces a call to this function for all requests greater or equal to PT_FIRSTMACH. Silence on: audit
Revision 1.51.2.1.2.3: download - view: text, markup, annotated - select for diffs
Tue Aug 12 20:24:13 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_3
Diff to: previous 1.51.2.1.2.2: preferred, colored; branchpoint 1.51.2.1: preferred, colored; next MAIN 1.51.2.2: preferred, colored
Changes since revision 1.51.2.1.2.2: +1 -1 lines
Merge from RELENG_4_7 1.51.2.4.2.2: Fix typo: `uap->data' versus `data'.
Revision 1.51.2.1.4.3: download - view: text, markup, annotated - select for diffs
Tue Aug 12 20:23:51 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_4
Diff to: previous 1.51.2.1.4.2: preferred, colored; branchpoint 1.51.2.1: preferred, colored; next MAIN 1.51.2.2: preferred, colored
Changes since revision 1.51.2.1.4.2: +1 -1 lines
Merge from RELENG_4_7 1.51.2.4.2.2: Fix typo: `uap->data' versus `data'.
Revision 1.51.2.3.2.2: download - view: text, markup, annotated - select for diffs
Tue Aug 12 20:23:24 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_5
Diff to: previous 1.51.2.3.2.1: preferred, colored; branchpoint 1.51.2.3: preferred, colored; next MAIN 1.51.2.4: preferred, colored
Changes since revision 1.51.2.3.2.1: +1 -1 lines
Merge from RELENG_4_7 1.51.2.4.2.2: Fix typo: `uap->data' versus `data'.
Revision 1.51.2.3.4.2: download - view: text, markup, annotated - select for diffs
Mon Aug 11 10:16:35 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_6
Diff to: previous 1.51.2.3.4.1: preferred, colored; branchpoint 1.51.2.3: preferred, colored; next MAIN 1.51.2.4: preferred, colored
Changes since revision 1.51.2.3.4.1: +1 -1 lines
Merge from RELENG_4_7 1.51.2.4.2.2: Fix typo: `uap->data' versus `data'.
Revision 1.51.2.4.2.2: download - view: text, markup, annotated - select for diffs
Mon Aug 11 10:14:38 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_7
Diff to: previous 1.51.2.4.2.1: preferred, colored; branchpoint 1.51.2.4: preferred, colored; next MAIN 1.51.2.5: preferred, colored
Changes since revision 1.51.2.4.2.1: +1 -1 lines
Fix typo: `uap->data' versus `data'. Noticed by: Anil <atria78@entic.net>, Bruce M Simpson <bms@spc.org>
Revision 1.51.2.1.2.2: download - view: text, markup, annotated - select for diffs
Sun Aug 10 23:23:57 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_3
Diff to: previous 1.51.2.1.2.1: preferred, colored; branchpoint 1.51.2.1: preferred, colored
Changes since revision 1.51.2.1.2.1: +2 -1 lines
MFC sys_process.c 1.113, spigot.c 1.60: Add or correct range checking of signal numbers in system calls and ioctls.
Revision 1.51.2.1.4.2: download - view: text, markup, annotated - select for diffs
Sun Aug 10 23:23:06 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_4
Diff to: previous 1.51.2.1.4.1: preferred, colored; branchpoint 1.51.2.1: preferred, colored
Changes since revision 1.51.2.1.4.1: +2 -1 lines
MFC sys_process.c 1.113, spigot.c 1.60: Add or correct range checking of signal numbers in system calls and ioctls.
Revision 1.51.2.3.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 23:22:20 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_5
Diff to: previous 1.51.2.3: preferred, colored
Changes since revision 1.51.2.3: +2 -1 lines
MFC sys_process.c 1.113, spigot.c 1.60: Add or correct range checking of signal numbers in system calls and ioctls.
Revision 1.51.2.3.4.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 23:21:18 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_6
Diff to: previous 1.51.2.3: preferred, colored
Changes since revision 1.51.2.3: +2 -1 lines
MFC sys_process.c 1.113, spigot.c 1.60: Add or correct range checking of signal numbers in system calls and ioctls.
Revision 1.51.2.4.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 23:20:31 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_7
Diff to: previous 1.51.2.4: preferred, colored
Changes since revision 1.51.2.4: +2 -1 lines
MFC sys_process.c 1.113, spigot.c 1.60: Add or correct range checking of signal numbers in system calls and ioctls.
Revision 1.51.2.6.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 23:19:36 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4_8
Diff to: previous 1.51.2.6: preferred, colored; next MAIN 1.51.2.7: preferred, colored
Changes since revision 1.51.2.6: +2 -1 lines
MFC sys_process.c 1.113, spigot.c 1.60: Add or correct range checking of signal numbers in system calls and ioctls.
Revision 1.104.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 23:17:49 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_5_0
Diff to: previous 1.104: preferred, colored; next MAIN 1.105: preferred, colored
Changes since revision 1.104: +2 -2 lines
MFC sys_process.c 1.113, spigot.c 1.60: Add or correct range checking of signal numbers in system calls and ioctls. MFC kern_sig.c 1.257: panic() if we try to handle an out-of-range signal number in psignal()/ tdsignal().
Revision 1.108.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 23:14:09 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_5_1
Diff to: previous 1.108: preferred, colored; next MAIN 1.109: preferred, colored
Changes since revision 1.108: +2 -2 lines
MFC sys_process.c 1.113, spigot.c 1.60: Add or correct range checking of signal numbers in system calls and ioctls. MFC kern_sig.c 1.257: panic() if we try to handle an out-of-range signal number in psignal()/ tdsignal().
Revision 1.51.2.7: download - view: text, markup, annotated - select for diffs
Sun Aug 10 23:09:28 2003 UTC (8 years, 6 months ago) by nectar
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9
Diff to: previous 1.51.2.6: preferred, colored; branchpoint 1.51: preferred, colored
Changes since revision 1.51.2.6: +2 -1 lines
MFC sys_process.c 1.113, spigot.c 1.60: Add or correct range checking of signal numbers in system calls and ioctls.
Revision 1.113: download - view: text, markup, annotated - select for diffs
Sun Aug 10 23:04:55 2003 UTC (8 years, 6 months ago) by nectar
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +2 -2 lines
Add or correct range checking of signal numbers in system calls and ioctls. In the particular case of ptrace(), this commit more-or-less reverts revision 1.53 of sys_process.c, which appears to have been erroneous. Reviewed by: iedowse, jhb
Revision 1.112: download - view: text, markup, annotated - select for diffs
Sat Aug 9 18:01:19 2003 UTC (8 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +5 -30 lines
Background: When proc_rwmem() wired and mapped a page, it also added a reference to the containing object. The purpose of the reference being to prevent the destruction of the object and an attempt to free the wired page. (Wired pages can't be freed.) Unfortunately, this approach does not work. Some operations, like fork(2) that call vm_object_split(), can move the wired page to a difference object, thereby making the reference pointless and opening the possibility of the wired page being freed. A solution is to use vm_page_hold() in place of vm_page_wire(). Held pages can be freed. They are moved to a special hold queue until the hold is released. Submitted by: tegge
Revision 1.111: download - view: text, markup, annotated - select for diffs
Sat Aug 2 17:08:21 2003 UTC (8 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +1 -1 lines
Use kmem_alloc_nofault() rather than kmem_alloc_pageable() in proc_rwmem(). See revision 1.140 of kern/sys_pipe.c for a detailed rationale. Submitted by: tegge
Revision 1.110: download - view: text, markup, annotated - select for diffs
Wed Jun 11 06:43:48 2003 UTC (8 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +12 -12 lines
Add vm object locking.
Revision 1.109: download - view: text, markup, annotated - select for diffs
Wed Jun 11 00:56:57 2003 UTC (8 years, 8 months ago) by obrien
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +3 -2 lines
Use __FBSDID().
Revision 1.108: download - view: text, markup, annotated - select for diffs
Fri Apr 25 20:02:16 2003 UTC (8 years, 9 months ago) by jhb
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE
Branch point for: RELENG_5_1
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +7 -0 lines
Push down Giant around calls to proc_rwmem() in kern_ptrace. kern_ptrace() should now be MP safe.
Revision 1.107: download - view: text, markup, annotated - select for diffs
Tue Apr 22 20:01:56 2003 UTC (8 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +1 -2 lines
Prefer the proc lock to sched_lock when testing PS_INMEM now that it is safe to do so.
Revision 1.106: download - view: text, markup, annotated - select for diffs
Thu Apr 17 22:31:54 2003 UTC (8 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +2 -3 lines
The sched_lock is not needed while clearing two of the P_STOPPED bits in p_flag. Also, the proc lock can't be recursed, so simplify an older proc lock assertion.
Revision 1.105: download - view: text, markup, annotated - select for diffs
Wed Mar 19 00:31:45 2003 UTC (8 years, 10 months ago) by des
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +5 -5 lines
Whitespace cleanup.
Revision 1.51.2.6: download - view: text, markup, annotated - select for diffs
Wed Jan 8 03:06:45 2003 UTC (9 years, 1 month ago) by kan
Branches: RELENG_4
CVS tags: RELENG_4_8_BP, RELENG_4_8_0_RELEASE
Branch point for: RELENG_4_8
Diff to: previous 1.51.2.5: preferred, colored; branchpoint 1.51: preferred, colored
Changes since revision 1.51.2.5: +6 -0 lines
PT_{GET|SET}DDREGS are defined in i386 MD headers in STABLE.
Do not try to use them if they were not defined (i.e on Alpha).
Submitted by: Rich Bud <rbud@fortean.com>
Revision 1.51.2.5: download - view: text, markup, annotated - select for diffs
Thu Jan 2 20:39:13 2003 UTC (9 years, 1 month ago) by kan
Branches: RELENG_4
Diff to: previous 1.51.2.4: preferred, colored; branchpoint 1.51: preferred, colored
Changes since revision 1.51.2.4: +119 -31 lines
MFC: split ptrace(2) syscall into a wrapper doing copyin/copyout operations and kern_ptrace implementation function. This is required for an upcoming Linux/i386 emulator ptrace syscall.
Revision 1.104: download - view: text, markup, annotated - select for diffs
Wed Oct 16 16:28:33 2002 UTC (9 years, 3 months ago) by jhb
Branches: MAIN
CVS tags: RELENG_5_0_BP, RELENG_5_0_0_RELEASE
Branch point for: RELENG_5_0
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +1 -0 lines
Add a missing PROC_UNLOCK in ptrace() for the PT_IO case. PR: kern/44065 Submitted by: Mark Kettenis <kettenis@chello.nl>
Revision 1.103: download - view: text, markup, annotated - select for diffs
Wed Sep 11 08:13:54 2002 UTC (9 years, 5 months ago) by julian
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +1 -0 lines
Completely redo thread states. Reviewed by: davidxu@freebsd.org
Revision 1.102: download - view: text, markup, annotated - select for diffs
Sat Sep 7 22:18:19 2002 UTC (9 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +0 -1 lines
Remove bogus fill_kinfo_proc() before ptrace_set_pc(). There was no need for this. Submitted by: bde
Revision 1.101: download - view: text, markup, annotated - select for diffs
Thu Sep 5 07:30:14 2002 UTC (9 years, 5 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +1 -1 lines
s/SGNL/SIG/ s/SNGL/SINGLE/ s/SNGLE/SINGLE/ Fix abbreviation for P_STOPPED_* etc flags, in original code they were inconsistent and difficult to distinguish between them. Approved by: julian (mentor)
Revision 1.100: download - view: text, markup, annotated - select for diffs
Thu Sep 5 01:02:41 2002 UTC (9 years, 5 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +88 -68 lines
Split up ptrace() into a wrapper that does the copying to and from user space and a kern_ptrace() implementation. Use the kern_*() version in the Linux emulation code to remove more stack gap uses. Approved by: des
Revision 1.99: download - view: text, markup, annotated - select for diffs
Sun Aug 25 13:17:21 2002 UTC (9 years, 5 months ago) by charnier
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +1 -1 lines
Replace various spelling with FALLTHROUGH which is lint()able
Revision 1.98: download - view: text, markup, annotated - select for diffs
Sat Jul 20 22:44:39 2002 UTC (9 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +1 -3 lines
Do preserve the error result from calling p_cansee() and use that when failing because of the error. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
Revision 1.97: download - view: text, markup, annotated - select for diffs
Fri Jul 12 17:21:22 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +4 -0 lines
Lock accesses to the page queues.
Revision 1.96: download - view: text, markup, annotated - select for diffs
Fri Jul 12 16:48:05 2002 UTC (9 years, 7 months ago) by tmm
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +5 -3 lines
Fix ptrace(PT_READ_*, ...) for non-little-endian architectures where sizeof(register_t) != sizeof(int).
Revision 1.95: download - view: text, markup, annotated - select for diffs
Sat Jun 29 17:26:18 2002 UTC (9 years, 7 months ago) by julian
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +4 -2 lines
Part 1 of KSE-III The ability to schedule multiple threads per process (one one cpu) by making ALL system calls optionally asynchronous. to come: ia64 and power-pc patches, patches for gdb, test program (in tools) Reviewed by: Almost everyone who counts (at various times, peter, jhb, matt, alfred, mini, bernd, and a cast of thousands) NOTE: this is still Beta code, and contains lots of debugging stuff. expect slight instability in signals..
Revision 1.51.2.4: download - view: text, markup, annotated - select for diffs
Mon Jun 17 19:23:41 2002 UTC (9 years, 7 months ago) by alfred
Branches: RELENG_4
CVS tags: RELENG_4_7_BP, RELENG_4_7_0_RELEASE
Branch point for: RELENG_4_7
Diff to: previous 1.51.2.3: preferred, colored; branchpoint 1.51: preferred, colored
Changes since revision 1.51.2.3: +7 -1 lines
Prevent DoS: Do not allow one to trace an ancestor when one is being traced. PR: kern/29741 MFC: 1.90
Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun May 19 01:37:43 2002 UTC (9 years, 8 months ago) by marcel
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +1 -1 lines
All signals can be sent to the inferior process when it's restarted, not just the legacy ones. PR: 33299 Submitted by: Alexander N. Kabaev <ak03@gte.com>
Revision 1.93: download - view: text, markup, annotated - select for diffs
Sun May 19 00:14:49 2002 UTC (9 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +2 -2 lines
Change p_can{debug,see,sched,signal}()'s first argument to be a thread
pointer instead of a proc pointer and require the process pointed to
by the second argument to be locked. We now use the thread ucred reference
for the credential checks in p_can*() as a result. p_canfoo() should now
no longer need Giant.
Revision 1.92: download - view: text, markup, annotated - select for diffs
Thu May 9 04:13:36 2002 UTC (9 years, 9 months ago) by mini
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +0 -7 lines
Remove trace_req(). Reviewed by: alfred, jhb, peter
Revision 1.91: download - view: text, markup, annotated - select for diffs
Sat Apr 20 21:56:42 2002 UTC (9 years, 9 months ago) by marcel
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +1 -0 lines
GCC 3.x WARNS: Add a break to the default case.
Revision 1.90: download - view: text, markup, annotated - select for diffs
Sun Apr 14 17:12:55 2002 UTC (9 years, 9 months ago) by alfred
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +14 -1 lines
Don't allow one to trace an ancestor when already traced. PR: kern/29741 Submitted by: Dave Zarzycki <zarzycki@FreeBSD.org> Fix from: Tim J. Robbins <tim@robbins.dropbear.id.au> MFC After: 2 weeks
Revision 1.89: download - view: text, markup, annotated - select for diffs
Fri Apr 12 21:17:37 2002 UTC (9 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +114 -86 lines
Rework ptrace(2) to be more locking friendly. We do any needed copyin()'s and acquire the proctree_lock if needed first. Then we lock the process if necessary and fiddle with it as appropriate. Finally we drop locks and do any needed copyout's. This greatly simplifies the locking.
Revision 1.88: download - view: text, markup, annotated - select for diffs
Tue Apr 9 20:10:46 2002 UTC (9 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +2 -0 lines
- Change fill_kinfo_proc() to require that the process is locked when it is called. - Change sysctl_out_proc() to require that the process is locked when it is called and to drop the lock before it returns. If this proves too complex we can change sysctl_out_proc() to simply acquire the lock at the very end and have the calling code drop the lock right after it returns. - Lock the process we are going to export before the p_cansee() in the loop in sysctl_kern_proc() and hold the lock until we call sysctl_out_proc(). - Don't call p_cansee() on the process about to be exported twice in the aforementioned loop.
Revision 1.87: download - view: text, markup, annotated - select for diffs
Sun Mar 17 00:56:40 2002 UTC (9 years, 10 months ago) by jake
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +2 -2 lines
Convert all pmap_kenter/pmap_kremove pairs in MI code to use pmap_qenter/ pmap_qremove. pmap_kenter is not safe to use in MI code because it is not guaranteed to flush the mapping from the tlb on all cpus. If the process in question is preempted and migrates cpus between the call to pmap_kenter and pmap_kremove, the original cpu will be left with stale mappings in its tlb. This is currently not a problem for i386 because we do not use PG_G on SMP, and thus all mappings are flushed from the tlb on context switches, not just user mappings. This is not the case on all architectures, and if PG_G is to be used with SMP on i386 it will be a problem. This was committed by peter earlier as part of his fine grained tlb shootdown work for i386, which was backed out for other reasons. Reviewed by: peter
Revision 1.86: download - view: text, markup, annotated - select for diffs
Sat Mar 16 02:40:02 2002 UTC (9 years, 10 months ago) by des
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +31 -0 lines
Implement PT_IO (read / write arbitrary amounts of data or text).
Submitted by: Artur Grabowski <art@{blahonga,openbsd}.org>
Obtained from: OpenBSD
Revision 1.85: download - view: text, markup, annotated - select for diffs
Fri Mar 15 20:17:12 2002 UTC (9 years, 10 months ago) by des
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +1 -25 lines
PT_[GS]ET{,DB,FP}REGS isn't really optional any more, since we have dummy
backend functions for those archs that don't support them. I meant to do
this ages ago, but never got around to it.
Inspired by: OpenBSD
Revision 1.84: download - view: text, markup, annotated - select for diffs
Wed Feb 27 09:51:33 2002 UTC (9 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +2 -2 lines
Back out all the pmap related stuff I've touched over the last few days. There is some unresolved badness that has been eluding me, particularly affecting uniprocessor kernels. Turning off PG_G helped (which is a bad sign) but didn't solve it entirely. Userland programs still crashed.
Revision 1.83: download - view: text, markup, annotated - select for diffs
Wed Feb 27 02:14:56 2002 UTC (9 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +2 -2 lines
Jake further reduced IPI shootdowns on sparc64 in loops by using ranged shootdowns in a couple of key places. Do the same for i386. This also hides some physical addresses from higher levels and has it use the generic vm_page_t's instead. This will help for PAE down the road. Obtained from: jake (MI code, suggestions for MD part)
Revision 1.82: download - view: text, markup, annotated - select for diffs
Sat Feb 23 11:12:54 2002 UTC (9 years, 11 months ago) by tanimura
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +3 -3 lines
Lock struct pgrp, session and sigio. New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current)
Revision 1.81: download - view: text, markup, annotated - select for diffs
Thu Feb 21 04:47:38 2002 UTC (9 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +21 -25 lines
Fixed some style bugs. Added a comment about a bug in PT_SSTEP. Approved by: des
Revision 1.80: download - view: text, markup, annotated - select for diffs
Thu Feb 21 04:37:55 2002 UTC (9 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +77 -16 lines
Recover bits that were lost in transition in rev.1.76: - P_INMEM checks in all the functions. P_INMEM must be checked because PHOLD() is broken. The old bits had bogus locking (using sched_lock) to lock P_INMEM. After removing the P_INMEM checks, we were left with just the bogus locking. - large comments. They were too large, but better than nothing. Remove obfuscations that were gained in transition in rev.1.76: - PROC_REG_ACTION() is even more of an obfuscation than PROC_ACTION(). The change copies procfs_machdep.c rev.1.22 of i386/procfs_machdep.c verbatim except for "fixing" the old-style function headers and adjusting function names and comments. It doesn't remove the bogus locking. Approved by: des
Revision 1.79: download - view: text, markup, annotated - select for diffs
Fri Feb 8 08:56:01 2002 UTC (10 years ago) by peter
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +12 -12 lines
Bah, I managed to turn cosmetic things into real bugs. Fix shadowed variable declarations. :-( Definately not my day today.
Revision 1.78: download - view: text, markup, annotated - select for diffs
Thu Feb 7 23:05:40 2002 UTC (10 years ago) by peter
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +15 -11 lines
Fix a whole bunch of long lines introduced by previous commit by using td = FIRST_THREAD_IN_PROC(p) once, after we have identified the process that we are operating on.
Revision 1.77: download - view: text, markup, annotated - select for diffs
Thu Feb 7 20:58:44 2002 UTC (10 years ago) by julian
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +10 -10 lines
Pre-KSE/M3 commit. this is a low-functionality change that changes the kernel to access the main thread of a process via the linked list of threads rather than assuming that it is embedded in the process. It IS still embeded there but remove all teh code that assumes that in preparation for the next commit which will actually move it out. Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
Revision 1.51.2.1.2.1: download - view: text, markup, annotated - select for diffs
Wed Jan 23 23:05:54 2002 UTC (10 years ago) by nectar
Branches: RELENG_4_3
Diff to: previous 1.51.2.1: preferred, colored
Changes since revision 1.51.2.1: +5 -1 lines
Eliminate ptrace/exec race. MFC 1.191 src/sys/sys/proc.h MFC 1.44 src/sys/kern/kern_exec.c (execve) Add P_INEXEC flag to indicate that a process is currently exec'ing. sys/kern/sys_process.c (ptrace) sys/miscfs/procfs/... Do not allow debugging of a process during exec.
Revision 1.51.2.1.4.1: download - view: text, markup, annotated - select for diffs
Wed Jan 23 23:05:00 2002 UTC (10 years ago) by nectar
Branches: RELENG_4_4
Diff to: previous 1.51.2.1: preferred, colored
Changes since revision 1.51.2.1: +5 -1 lines
Eliminate ptrace/exec race. MFC 1.191 src/sys/sys/proc.h MFC 1.44 src/sys/kern/kern_exec.c (execve) Add P_INEXEC flag to indicate that a process is currently exec'ing. sys/kern/sys_process.c (ptrace) sys/miscfs/procfs/... Do not allow debugging of a process during exec.
Revision 1.51.2.3: download - view: text, markup, annotated - select for diffs
Tue Jan 22 17:22:59 2002 UTC (10 years ago) by nectar
Branches: RELENG_4
CVS tags: RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_5_BP, RELENG_4_5_0_RELEASE
Branch point for: RELENG_4_6, RELENG_4_5
Diff to: previous 1.51.2.2: preferred, colored; branchpoint 1.51: preferred, colored
Changes since revision 1.51.2.2: +5 -1 lines
Eliminate ptrace/exec race. MFC 1.191 src/sys/sys/proc.h MFC 1.44 src/sys/kern/kern_exec.c (execve) Add P_INEXEC flag to indicate that a process is currently exec'ing. sys/kern/sys_process.c (ptrace) sys/miscfs/procfs/... Do not allow debugging of a process during exec. Submitted by: tegge Approved by: re
Revision 1.76: download - view: text, markup, annotated - select for diffs
Sun Oct 21 23:57:15 2001 UTC (10 years, 3 months ago) by des
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +37 -7 lines
Move procfs_* from procfs_machdep.c into sys_process.c, and rename them to proc_* in the process; procfs_machdep.c is no longer needed. Run-tested on i386, build-tested on Alpha, untested on other platforms.
Revision 1.75: download - view: text, markup, annotated - select for diffs
Sun Oct 7 20:08:42 2001 UTC (10 years, 4 months ago) by des
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +210 -191 lines
Dissociate ptrace from procfs.
Until now, the ptrace syscall was implemented as a wrapper that called
various functions in procfs depending on which ptrace operation was
requested. Most of these functions were themselves wrappers around
procfs_{read,write}_{,db,fp}regs(), with only some extra error checks,
which weren't necessary in the ptrace case anyway.
This commit moves procfs_rwmem() from procfs_mem.c into sys_process.c
(renaming it to proc_rwmem() in the process), and implements ptrace()
directly in terms of procfs_{read,write}_{,db,fp}regs() instead of
having it fake up a struct uio and then call procfs_do{,db,fp}regs().
It also moves the prototypes for procfs_{read,write}_{,db,fp}regs()
and proc_rwmem() from proc.h to ptrace.h, and marks all procfs files
except procfs_machdep.c as "optional procfs" instead of "standard".
Revision 1.74: download - view: text, markup, annotated - select for diffs
Thu Oct 4 16:35:44 2001 UTC (10 years, 4 months ago) by des
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +9 -6 lines
Final style(9) commit: placement of opening brace; a continuation indent I missed in the previous commit; a line that exceeded 80 characters. No functional changes, but the object file's md5 checksum changes because some lines have been displaced.
Revision 1.73: download - view: text, markup, annotated - select for diffs
Thu Oct 4 16:29:45 2001 UTC (10 years, 4 months ago) by des
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +31 -31 lines
More style(9) fixes: no spaces between function name and parameter list; some indentation fixes (particularly continuation lines). Reviewed by: md5(1)
Revision 1.72: download - view: text, markup, annotated - select for diffs
Thu Oct 4 16:09:22 2001 UTC (10 years, 4 months ago) by des
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +25 -25 lines
This file had a mixture of "return foo;" and "return (foo);"; standardize on "return (foo);" as mandated by style(9). Reviewed by: md5(1)
Revision 1.51.2.2: download - view: text, markup, annotated - select for diffs
Wed Oct 3 06:55:42 2001 UTC (10 years, 4 months ago) by peter
Branches: RELENG_4
Diff to: previous 1.51.2.1: preferred, colored; branchpoint 1.51: preferred, colored
Changes since revision 1.51.2.1: +1 -41 lines
MFC: Initiate de-orbit burn for PT_READ_U/PT_WRITE_U. These particularly nasty interfaces should have been put to death long ago. Nothing in the tree uses them (and should not anyway since we have PT_GETREGS etc) and as near as I can tell, no ports use it either.
Revision 1.71: download - view: text, markup, annotated - select for diffs
Tue Sep 18 19:06:11 2001 UTC (10 years, 4 months ago) by mp
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +3 -3 lines
Set debug information on the process being traced, not the current (debugger) process. This should allow gdb to function correctly on post-KSE kernels.
Revision 1.70: download - view: text, markup, annotated - select for diffs
Wed Sep 12 08:37:46 2001 UTC (10 years, 5 months ago) by julian
Branches: MAIN
CVS tags: KSE_MILESTONE_2
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +18 -17 lines
KSE Milestone 2 Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
Revision 1.69: download - view: text, markup, annotated - select for diffs
Wed Aug 8 05:25:07 2001 UTC (10 years, 6 months ago) by peter
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +1 -44 lines
Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they are a really nasty interface that should have been killed long ago when 'ptrace(PT_[SG]ETREGS' etc came along. The entity that they operate on (struct user) will not be around much longer since it is part-per-process and part-per-thread in a post-KSE world. gdb does not actually use this except for the obscure 'info udot' command which does a hexdump of as much of the child's 'struct user' as it can get. It carries its own #defines so it doesn't break compiles.
Revision 1.68: download - view: text, markup, annotated - select for diffs
Thu Jul 5 17:10:44 2001 UTC (10 years, 7 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +3 -3 lines
o Replace calls to p_can(..., P_CAN_xxx) with calls to p_canxxx().
The p_can(...) construct was a premature (and, it turns out,
awkward) abstraction. The individual calls to p_canxxx() better
reflect differences between the inter-process authorization checks,
such as differing checks based on the type of signal. This has
a side effect of improving code readability.
o Replace direct credential authorization checks in ktrace() with
invocation of p_candebug(), while maintaining the special case
check of KTR_ROOT. This allows ktrace() to "play more nicely"
with new mandatory access control schemes, as well as making its
authorization checks consistent with other "debugging class"
checks.
o Eliminate "privused" construct for p_can*() calls which allowed the
caller to determine if privilege was required for successful
evaluation of the access control check. This primitive is currently
unused, and as such, serves only to complicate the API.
Approved by: ({procfs,linprocfs} changes) des
Obtained from: TrustedBSD Project
Revision 1.67: download - view: text, markup, annotated - select for diffs
Wed May 23 09:42:04 2001 UTC (10 years, 8 months ago) by ru
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +2 -2 lines
- FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION file
systems were repo-copied from sys/miscfs to sys/fs.
- Renamed the following file systems and their modules:
fdesc -> fdescfs, portal -> portalfs, union -> unionfs.
- Renamed corresponding kernel options:
FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS.
- Install header files for the above file systems.
- Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland
Makefiles.
Revision 1.66: download - view: text, markup, annotated - select for diffs
Fri May 4 18:13:11 2001 UTC (10 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +7 -2 lines
Fix a bug in the pfind() changes due to confusing the process returned by
pfind() ('pp') with the process being detached from ptrace.
Reported by: bde
Revision 1.65: download - view: text, markup, annotated - select for diffs
Tue May 1 08:12:58 2001 UTC (10 years, 9 months ago) by markm
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +5 -3 lines
Undo part of the tangle of having sys/lock.h and sys/mutex.h included in other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
Revision 1.64: download - view: text, markup, annotated - select for diffs
Tue Apr 24 00:51:48 2001 UTC (10 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +15 -11 lines
Change the pfind() and zpfind() functions to lock the process that they find before releasing the allproc lock and returning. Reviewed by: -smp, dfr, jake
Revision 1.63: download - view: text, markup, annotated - select for diffs
Wed Mar 28 11:52:53 2001 UTC (10 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +8 -7 lines
Convert the allproc and proctree locks from lockmgr locks to sx locks.
Revision 1.62: download - view: text, markup, annotated - select for diffs
Wed Mar 7 03:06:18 2001 UTC (10 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +30 -18 lines
- Proc locking. - Remove some unneeded spl()'s.
Revision 1.61: download - view: text, markup, annotated - select for diffs
Fri Feb 9 06:09:51 2001 UTC (11 years ago) by bmilekic
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +13 -13 lines
Change and clean the mutex lock interface.
mtx_enter(lock, type) becomes:
mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)
similarily, for releasing a lock, we now have:
mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.
The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.
Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:
MTX_QUIET and MTX_NOSWITCH
The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:
mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.
Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.
Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.
Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.
Finally, caught up to the interface changes in all sys code.
Contributors: jake, jhb, jasone (in no particular order)
Revision 1.60: download - view: text, markup, annotated - select for diffs
Wed Jan 24 11:15:24 2001 UTC (11 years ago) by jhb
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +19 -5 lines
- Catch up to proc flag changes. - Update stopevent() to assert that the proc lock is held when it is held and is not recursed. Note that the STOPEVENT() macro obtains the proc lock when calling this function.
Revision 1.59: download - view: text, markup, annotated - select for diffs
Sun Dec 31 01:30:27 2000 UTC (11 years, 1 month ago) by ps
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +1 -2 lines
Backout rev 1.57 & 1.58. While the previous revisions fixed attaching to running processes, it completely breaks normal debugging. A better fix is in the works, but cannot be properly tested until the problem with gdb hanging the system in -current is solved.
Revision 1.58: download - view: text, markup, annotated - select for diffs
Sat Dec 30 00:44:44 2000 UTC (11 years, 1 month ago) by ps
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +2 -2 lines
Pass me the pointy hat. Do not hold sched_lock over psignal. Submitted by: alfred
Revision 1.57: download - view: text, markup, annotated - select for diffs
Thu Dec 28 08:34:21 2000 UTC (11 years, 1 month ago) by ps
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +2 -1 lines
Send a SIGCONT when detaching or continuing the excution of a traced process. This fixes a problem when attaching to a process in gdb and the process staying in the STOP'd state after quiting gdb. This whole process seems a bit suspect, but this seems to work. Reviewed by: peter
Revision 1.56: download - view: text, markup, annotated - select for diffs
Sat Dec 23 19:43:09 2000 UTC (11 years, 1 month ago) by jake
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +12 -2 lines
Protect proc.p_pptr and proc.p_children/p_sibling with the proctree_lock. linprocfs not locked pending response from informal maintainer. Reviewed by: jhb, -smp@
Revision 1.55: download - view: text, markup, annotated - select for diffs
Tue Dec 12 07:25:53 2000 UTC (11 years, 2 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +4 -6 lines
Change the proc information returned from the kernel so that it no longer contains kernel specific data structures, but rather only scalar values and structures that are already part of the kernel/user interface, specifically rusage and rtprio. It no longer contains proc, session, pcred, ucred, procsig, vmspace, pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If any of these changed in size, ps, w, fstat, gcore, systat, and top would all stop working. The new structure has over 200 bytes of unassigned space for future values to be added, yet is nearly 100 bytes smaller per entry than the structure that it replaced.
Revision 1.54: download - view: text, markup, annotated - select for diffs
Sat Dec 2 01:32:51 2000 UTC (11 years, 2 months ago) by jhb
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +14 -4 lines
Protect p_stat with sched_lock.
Revision 1.51.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 26 04:34:41 2000 UTC (11 years, 3 months ago) by jwd
Branches: RELENG_4
CVS tags: RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_2_0_RELEASE
Branch point for: RELENG_4_4, RELENG_4_3
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +2 -2 lines
MFC: Rev 1.53 signal value check not needed for PT_STEP request.
Note: Rev 1.52 has is not MFC'd at this point.
Revision 1.53: download - view: text, markup, annotated - select for diffs
Sat Oct 14 03:56:01 2000 UTC (11 years, 3 months ago) by jwd
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +2 -2 lines
Remove the signal value check from the PT_STEP codepath. It can cause an bogus failure. Reviewed by: Sean Eric Fagan <sef@kithrup.com> and no other response to the review request.
Revision 1.52: download - view: text, markup, annotated - select for diffs
Wed Aug 30 04:49:07 2000 UTC (11 years, 5 months ago) by rwatson
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +4 -12 lines
o Centralize inter-process access control, introducing:
int p_can(p1, p2, operation, privused)
which allows specification of subject process, object process,
inter-process operation, and an optional call-by-reference privused
flag, allowing the caller to determine if privilege was required
for the call to succeed. This allows jail, kern.ps_showallprocs and
regular credential-based interaction checks to occur in one block of
code. Possible operations are P_CAN_SEE, P_CAN_SCHED, P_CAN_KILL,
and P_CAN_DEBUG. p_can currently breaks out as a wrapper to a
series of static function checks in kern_prot, which should not
be invoked directly.
o Commented out capabilities entries are included for some checks.
o Update most inter-process authorization to make use of p_can() instead
of manual checks, PRISON_CHECK(), P_TRESPASS(), and
kern.ps_showallprocs.
o Modify suser{,_xxx} to use const arguments, as it no longer modifies
process flags due to the disabling of ASU.
o Modify some checks/errors in procfs so that ENOENT is returned instead
of ESRCH, further improving concealment of processes that should not
be visible to other processes. Also introduce new access checks to
improve hiding of processes for procfs_lookup(), procfs_getattr(),
procfs_readdir(). Correct a bug reported by bp concerning not
handling the CREATE case in procfs_lookup(). Remove volatile flag in
procfs that caused apparently spurious qualifier warnigns (approved by
bde).
o Add comment noting that ktrace() has not been updated, as its access
control checks are different from ptrace(), whereas they should
probably be the same. Further discussion should happen on this topic.
Reviewed by: bde, green, phk, freebsd-security, others
Approved by: bde
Obtained from: TrustedBSD Project
Revision 1.51: download - view: text, markup, annotated - select for diffs
Sun Nov 21 19:03:10 1999 UTC (12 years, 2 months ago) by phk
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_1_1_RELEASE, RELENG_4_1_0_RELEASE, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +2 -3 lines
Introduce the new function
p_trespass(struct proc *p1, struct proc *p2)
which returns zero or an errno depending on the legality of p1 trespassing
on p2.
Replace kern_sig.c:CANSIGNAL() with call to p_trespass() and one
extra signal related check.
Replace procfs.h:CHECKIO() macros with calls to p_trespass().
Only show command lines to process which can trespass on the target
process.
Revision 1.50: download - view: text, markup, annotated - select for diffs
Fri Oct 29 18:08:53 1999 UTC (12 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +1 -2 lines
useracc() the prequel:
Merge the contents (less some trivial bordering the silly comments)
of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts
the #defines for the vm_inherit_t and vm_prot_t types next to their
typedefs.
This paves the road for the commit to follow shortly: change
useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE}
as argument.
Revision 1.49: download - view: text, markup, annotated - select for diffs
Mon Oct 11 15:19:11 1999 UTC (12 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +1 -2 lines
Trim unused options (or #ifdef for undoc options). Submitted by: phk
Revision 1.14.4.2: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:32:25 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_1_0
Diff to: previous 1.14.4.1: preferred, colored; branchpoint 1.14: preferred, colored; next MAIN 1.15: preferred, colored
Changes since revision 1.14.4.1: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.24.2.2: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:15:18 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_2
Diff to: previous 1.24.2.1: preferred, colored; branchpoint 1.24: preferred, colored; next MAIN 1.25: preferred, colored
Changes since revision 1.24.2.1: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.41.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 29 16:26:08 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_3
CVS tags: RELENG_3_5_0_RELEASE, RELENG_3_4_0_RELEASE, RELENG_3_3_0_RELEASE
Diff to: previous 1.41: preferred, colored; next MAIN 1.42: preferred, colored
Changes since revision 1.41: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.48: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:46:19 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.47: download - view: text, markup, annotated - select for diffs
Fri Jul 9 04:15:55 1999 UTC (12 years, 7 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +33 -1 lines
Implement support for hardware debug registers on the i386. Submitted by: Brian Dean <brdean@unx.sas.com>
Revision 1.46: download - view: text, markup, annotated - select for diffs
Thu Jul 1 22:52:40 1999 UTC (12 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +2 -2 lines
Moving the initialization for write sooner quiets a warning.
Revision 1.45: download - view: text, markup, annotated - select for diffs
Wed Apr 28 11:37:04 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
CVS tags: PRE_VFS_BIO_NFS_PATCH, POST_VFS_BIO_NFS_PATCH
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +3 -1 lines
This Implements the mumbled about "Jail" feature. This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
Revision 1.44: download - view: text, markup, annotated - select for diffs
Tue Apr 27 11:16:13 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
CVS tags: PRE_SMP_VMSHARE, POST_SMP_VMSHARE
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +2 -2 lines
Suser() simplification: 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
Revision 1.43: download - view: text, markup, annotated - select for diffs
Mon Mar 29 08:29:22 1999 UTC (12 years, 10 months ago) by dfr
Branches: MAIN
CVS tags: PRE_NEWBUS, POST_NEWBUS
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +2 -2 lines
Call ptrace_u_check with the right size.
Revision 1.42: download - view: text, markup, annotated - select for diffs
Wed Jan 27 21:49:57 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +2 -2 lines
Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
Revision 1.41: download - view: text, markup, annotated - select for diffs
Sat Dec 26 17:14:37 1998 UTC (13 years, 1 month ago) by dfr
Branches: MAIN
CVS tags: RELENG_3_BP, RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE, RELENG_3_1_0_RELEASE
Branch point for: RELENG_3
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +5 -2 lines
Tweak ptrace(PT_READ_U) so that the last alpha register can be read.
Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed Jul 29 18:41:30 1998 UTC (13 years, 6 months ago) by dfr
Branches: MAIN
CVS tags: RELENG_3_0_0_RELEASE
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +2 -2 lines
Only access an int for READU/WRITEU since that is what ptrace is declared to return.
Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Jul 15 04:43:49 1998 UTC (13 years, 6 months ago) by bde
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +7 -5 lines
Cast function pointers to uintfptr_t before casting them to u_long. Hopefully caddr_t is large enough to hold function pointers. Cast object pointers to uintptr_t before casting them to u_long. Types are wronger than usual for the PT_READ_U case. ptrace() can only return ints, but longs are accessed.
Revision 1.38: download - view: text, markup, annotated - select for diffs
Sun Jun 7 17:11:39 1998 UTC (13 years, 8 months ago) by dfr
Branches: MAIN
CVS tags: PRE_NOBDEV
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +5 -5 lines
This commit fixes various 64bit portability problems required for FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
Revision 1.37: download - view: text, markup, annotated - select for diffs
Tue May 19 00:00:12 1998 UTC (13 years, 8 months ago) by tegge
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +6 -1 lines
Disallow reading the current kernel stack. Only the user structure and the current registers should be accessible. Reviewed by: David Greenman <dg@root.com>
Revision 1.36: download - view: text, markup, annotated - select for diffs
Fri Feb 6 12:13:27 1998 UTC (14 years ago) by eivind
Branches: MAIN
CVS tags: PRE_SOFTUPDATE, PRE_DEVFS_SLICE, POST_SOFTUPDATE, POST_DEVFS_SLICE
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +1 -3 lines
Back out DIAGNOSTIC changes.
Revision 1.35: download - view: text, markup, annotated - select for diffs
Wed Feb 4 22:32:36 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +3 -1 lines
Turn DIAGNOSTIC into a new-style option.
Revision 1.34: download - view: text, markup, annotated - select for diffs
Thu Jan 22 17:29:49 1998 UTC (14 years ago) by dyson
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +5 -5 lines
VM level code cleanups. 1) Start using TSM. Struct procs continue to point to upages structure, after being freed. Struct vmspace continues to point to pte object and kva space for kstack. u_map is now superfluous. 2) vm_map's don't need to be reference counted. They always exist either in the kernel or in a vmspace. The vmspaces are managed by reference counts. 3) Remove the "wired" vm_map nonsense. 4) No need to keep a cache of kernel stack kva's. 5) Get rid of strange looking ++var, and change to var++. 6) Change more data structures to use our "zone" allocator. Added struct proc, struct vmspace and struct vnode. This saves a significant amount of kva space and physical memory. Additionally, this enables TSM for the zone managed memory. 7) Keep ioopt disabled for now. 8) Remove the now bogus "single use" map concept. 9) Use generation counts or id's for data structures residing in TSM, where it allows us to avoid unneeded restart overhead during traversals, where blocking might occur. 10) Account better for memory deficits, so the pageout daemon will be able to make enough memory available (experimental.) 11) Fix some vnode locking problems. (From Tor, I think.) 12) Add a check in ufs_lookup, to avoid lots of unneeded calls to bcmp. (experimental.) 13) Significantly shrink, cleanup, and make slightly faster the vm_fault.c code. Use generation counts, get rid of unneded collpase operations, and clean up the cluster code. 14) Make vm_zone more suitable for TSM. This commit is partially as a result of discussions and contributions from other people, including DG, Tor Egge, PHK, and probably others that I have forgotten to attribute (so let me know, if I forgot.) This is not the infamous, final cleanup of the vnode stuff, but a necessary step. Vnode mgmt should be correct, but things might still change, and there is still some missing stuff (like ioopt, and physical backing of non-merged cache files, debugging of layering concepts.)
Revision 1.33: download - view: text, markup, annotated - select for diffs
Sat Dec 6 04:11:10 1997 UTC (14 years, 2 months ago) by sef
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +20 -1 lines
Changes to allow event-based process monitoring and control.
Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Nov 12 12:28:12 1997 UTC (14 years, 3 months ago) by tegge
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +5 -5 lines
Set return value for the correct process in ptrace().
Revision 1.31: download - view: text, markup, annotated - select for diffs
Thu Nov 6 19:29:22 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +6 -7 lines
Move the "retval" (3rd) parameter from all syscall functions and put it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Sep 2 20:05:53 1997 UTC (14 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +1 -7 lines
Removed unused #includes.
Revision 1.14.4.1: download - view: text, markup, annotated - select for diffs
Sun Apr 27 21:43:09 1997 UTC (14 years, 9 months ago) by alex
Branches: RELENG_2_1_0
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +5 -1 lines
Merge from -current: disallow debugger attachment when securelevel > 0.
Revision 1.24.2.1: download - view: text, markup, annotated - select for diffs
Sun Apr 27 21:33:31 1997 UTC (14 years, 9 months ago) by alex
Branches: RELENG_2_2
CVS tags: RELENG_2_2_8_RELEASE, RELENG_2_2_7_RELEASE, RELENG_2_2_6_RELEASE, RELENG_2_2_5_RELEASE, RELENG_2_2_2_RELEASE
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +5 -1 lines
Merge from -current: disallow debugger attachment when securelevel > 0.
Revision 1.29: download - view: text, markup, annotated - select for diffs
Sun Apr 27 21:26:29 1997 UTC (14 years, 9 months ago) by alex
Branches: MAIN
CVS tags: WOLLMAN_MBUF, BP_WOLLMAN_MBUF
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +1 -2 lines
Remove bogon from previous commit: doubly included sys/systm.h.
Revision 1.28: download - view: text, markup, annotated - select for diffs
Sun Apr 27 19:02:34 1997 UTC (14 years, 9 months ago) by alex
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +6 -1 lines
Prevent debugger attachment to init when securelevel > 0. Noticed by: Brian Buchanan <brian@wasteland.calbbs.com>
Revision 1.27: download - view: text, markup, annotated - select for diffs
Sat Feb 22 09:39:20 1997 UTC (14 years, 11 months ago) by peter
Branches: MAIN
CVS tags: pre_smp_merge, post_smp_merge
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +1 -1 lines
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not ready for it yet.
Revision 1.26: download - view: text, markup, annotated - select for diffs
Mon Feb 10 02:09:58 1997 UTC (15 years ago) by dyson
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +1 -1 lines
This is the kernel Lite/2 commit. There are some requisite userland changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
Revision 1.25: download - view: text, markup, annotated - select for diffs
Tue Jan 14 06:43:56 1997 UTC (15 years ago) by jkh
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +1 -1 lines
Make the long-awaited change from $Id$ to $FreeBSD$ This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
Revision 1.24: download - view: text, markup, annotated - select for diffs
Sun Jun 2 06:24:27 1996 UTC (15 years, 8 months ago) by dyson
Branches: MAIN
CVS tags: RELENG_2_2_BP, RELENG_2_2_1_RELEASE, RELENG_2_2_0_RELEASE
Branch point for: RELENG_2_2
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +1 -5 lines
Remove the now-unnecessary and incorrect wiring of the "other" processes page table pages. The pmap layer now handles that fully.
Revision 1.23: download - view: text, markup, annotated - select for diffs
Thu May 2 14:20:23 1996 UTC (15 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +2 -2 lines
removed:
CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei()
ptei() kvtopte() ptetov() ispt() ptetoav() &c &c
new:
NPDEPG
Major macro cleanup.
Revision 1.22: download - view: text, markup, annotated - select for diffs
Sat Mar 30 15:02:58 1996 UTC (15 years, 10 months ago) by peter
Branches: MAIN
CVS tags: wollman_polling
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +16 -2 lines
Because of the way that ptrace() now calls procfs routines to read/write the process's memory, it was possible for the procfs_domem() call to return a residual leftover, but with no errno. Since this is no good for ptrace which ignored the the residual, remap a leftover amount into an errno rather than fooling the caller into thinking it was successful when in fact it was not. Submitted by: bde (a very long time ago :-)
Revision 1.21: download - view: text, markup, annotated - select for diffs
Wed Jan 24 18:29:00 1996 UTC (16 years ago) by peter
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +226 -99 lines
Major fixes for ptrace()...
PT_ATTACH/PT_DETACH implemented now and fully operational.
PT_{GET|SET}{REGS|FPREFS} implemented now, using code shared with procfs
PT_{READ|WRITE}_{I|D} now uses code shared with procfs
ptrace opcodes now fully permission checked, including ownerships.
doing an operation to the u-area on a swapped process should no longer
panic.
running gdb as root works for me now, where it didn't before.
general cleanup..
Note, that this has some tightening of permissions/access checks etc.
Some of these may be going too far.. In particular, the "owner" of the
traced process is enforced. The process that created or attached to
the traced process is now the only one that can "do" things to it.
Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri Jan 19 03:58:04 1996 UTC (16 years ago) by dyson
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +6 -6 lines
Eliminated many redundant vm_map_lookup operations for vm_mmap. Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish overhead for merged cache. Efficiency improvement for vfs_cluster. It used to do alot of redundant calls to cluster_rbuild. Correct the ordering for vrele of .text and release of credentials. Use the selective tlb update for 486/586/P6. Numerous fixes to the size of objects allocated for files. Additionally, fixes in the various pagers. Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs. Fixes in the swap pager for exhausted resources. The pageout code will not as readily thrash. Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE), thereby improving efficiency of several routines. Eliminate even more unnecessary vm_page_protect operations. Significantly speed up process forks. Make vm_object_page_clean more efficient, thereby eliminating the pause that happens every 30seconds. Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the case of filesystems mounted async. Fix a panic with busy pages when write clustering is done for non-VMIO buffers.
Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun Dec 17 06:59:36 1995 UTC (16 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +9 -7 lines
Updated to match 1TB filesize changes. Some pindexes were still offsets and weren't converted. ptrace() was broken.
Revision 1.18: download - view: text, markup, annotated - select for diffs
Sat Dec 16 21:43:47 1995 UTC (16 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +1 -7 lines
Removed dead debugging code.
Revision 1.17: download - view: text, markup, annotated - select for diffs
Thu Dec 7 12:46:54 1995 UTC (16 years, 2 months ago) by davidg
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +9 -1 lines
Untangled the vm.h include file spaghetti.
Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue Nov 14 09:05:34 1995 UTC (16 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +7 -1 lines
Move the process-table stuff to a more suitable file. Remove filetable stuff from kern_sysctl.c
Revision 1.15: download - view: text, markup, annotated - select for diffs
Sun Nov 12 06:43:06 1995 UTC (16 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +4 -1 lines
Included <sys/sysproto.h> to get central declarations for syscall args structs and prototypes for syscalls. Ifdefed duplicated decentralized declarations of args structs. It's convenient to have this visible but they are hard to maintain. Some are already different from the central declarations. 4.4lite2 puts them in comments in the function headers but I wanted to avoid the large changes for that.
Revision 1.14: download - view: text, markup, annotated - select for diffs
Tue May 30 08:05:58 1995 UTC (16 years, 8 months ago) by rgrimes
Branches: MAIN
CVS tags: RELENG_2_1_7_RELEASE, RELENG_2_1_6_RELEASE, RELENG_2_1_6_1_RELEASE, RELENG_2_1_5_RELEASE, RELENG_2_1_0_RELEASE, RELENG_2_1_0_BP, RELENG_2_0_5_RELEASE, RELENG_2_0_5_BP, RELENG_2_0_5
Branch point for: RELENG_2_1_0
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +9 -9 lines
Remove trailing whitespace.
Revision 1.13: download - view: text, markup, annotated - select for diffs
Fri May 12 21:39:48 1995 UTC (16 years, 9 months ago) by davidg
Branches: MAIN
CVS tags: RELENG_2_0_5_ALPHA
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +3 -3 lines
pread/pwrite() should be static. Submitted by: sef
Revision 1.12: download - view: text, markup, annotated - select for diffs
Thu Mar 16 18:12:42 1995 UTC (16 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +2 -2 lines
Add and move declarations to fix all of the warnings from `gcc -Wimplicit' (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
Revision 1.11: download - view: text, markup, annotated - select for diffs
Sun Feb 19 02:50:31 1995 UTC (16 years, 11 months ago) by davidg
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +5 -5 lines
Truncate the pte address to a page boundry. This probably won't fix the panic, but at least it's more correct.
Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Feb 16 00:41:16 1995 UTC (16 years, 11 months ago) by davidg
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +5 -5 lines
Fixed botched previous change - use 'pageno' not initialized to NULL 'kva'. Submitted by: Lars Fredriksen
Revision 1.9: download - view: text, markup, annotated - select for diffs
Fri Feb 10 22:36:11 1995 UTC (17 years ago) by davidg
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +6 -10 lines
Wire the page table before doing the vm_fault(). Fixes a panic that happens when using gdb. Submitted by: John Dyson
Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Jan 14 13:19:38 1995 UTC (17 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +2 -6 lines
Fix security holes in sigreturn(), ptrace() and procfs. sigreturn() attempted to check for insecure and fatal eflags and segment selectors, but missed many cases and got the IOPL check back to front. The other syscalls didn't check at all. sys_process.c, machdep.c: Only allow PT_WRITE_U to write to the registers (ordinary and FP). psl.h, locore.s, machdep.c: Eliminate PSL_MBZ, PSL_MBO and PSL_USERCLR. We are not supposed to assume anything about the reserved bits. Use PSL_USERCHANGE and PSL_KERNEL instead. Rename PSL_USERSET to PSL_USER. exception.s: Define a private label for use by doreti when returning to user mode fails. machdep.c: In syscalls, allow changing only the eflags that can be changed on 486's in user mode (no longer attempt to allow benign IOPL changes; allow changing the nasty PSL_NT; don't allow changing the i586 bits). Don't attempt to check all the cases involving invalid selectors and %eip's. Just check for privilege violations and let the invalid things cause a trap. procfs_machdep.c: Call the ptrace register functions to do all the work for reading and writing ordinary registers and for single stepping. trap.c: Ignore traps caused by PSL_NT being set. Previously, users could cause a fatal trap in user mode by setting PSL_NT and executing an iret, and a fatal trap in kernel mode by setting PSL_NT and making a syscall. PSL_NT was cleared too late and not in enough modes to fix the problem. Make all traps in user mode (except T_NMI) nonfatal. Recover from traps caused by attempting to load invalid user registers in doreti by restarting the traps so that they appear to occur in user mode. --- Fix bogons that I noticed while fixing the above: psl.h: Fix some comments. Uniformize idempotency ifdef. exception.s, machdep.c: Remove rsvd[0-14]. rsvd0 hasn't been reserved since the 486 came out. Replace rsvd0 by `align'. rsvd[0-11] used wrong (magic non-unique) trap numbers. Replace rsvd[1-14] by rsvd. locore.s: Enable alignment check flag on 486's and 586's. machdep.c: Use a better type for kstack[]. Use TFREGP() to find the registers. Reformat ptrace functions from SEF to something closer to KNF. procfs_machdep.c: The wrong pointer to the registers got fixed as a side effect. Implement reading and writing of FP registers. /proc/*/*regs now work (only) for processes that are in memory. Clean up comments. trap.c, trap.h: Remove unused trap types.
Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Sep 25 19:33:49 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
CVS tags: RELEASE_2_0, OLAH_TTCP, BETA_2_0, ALPHA_2_0
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +7 -7 lines
While in the real world, I had a bad case of being swapped out for a lot of cycles. While waiting there I added a lot of the extra ()'s I have, (I have never used LISP to any extent). So I compiled the kernel with -Wall and shut up a lot of "suggest you add ()'s", removed a bunch of unused var's and added a couple of declarations here and there. Having a lap-top is highly recommended. My kernel still runs, yell at me if you kernel breaks.
Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu Aug 18 22:35:05 1994 UTC (17 years, 5 months ago) by wollman
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +5 -3 lines
Fix up some sloppy coding practices: - Delete redundant declarations. - Add -Wredundant-declarations to Makefile.i386 so they don't come back. - Delete sloppy COMMON-style declarations of uninitialized data in header files. - Add a few prototypes. - Clean up warnings resulting from the above. NB: ioconf.c will still generate a redundant-declaration warning, which is unavoidable unless somebody volunteers to make `config' smarter.
Revision 1.5: download - view: text, markup, annotated - select for diffs
Sat Aug 13 03:50:25 1994 UTC (17 years, 6 months ago) by wollman
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -2 lines
Change all #includes to follow the current Berkeley style. Some of these ``changes'' are actually not changes at all, but CVS sometimes has trouble telling the difference. This also includes support for second-directory compiles. This is not quite complete yet, as `config' doesn't yet do the right thing. You can still make it work trivially, however, by doing the following: rm /sys/compile mkdir /usr/obj/sys/compile ln -s M-. /sys/compile cd /sys/i386/conf config MYKERNEL cd ../../compile/MYKERNEL ln -s /sys @ rm machine ln -s @/i386/include machine make depend make
Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Aug 8 13:00:14 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +317 -30 lines
Process tracing code. Written by Sean Eric Fagan. Submitted by: Sean Eric Fagan
Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Aug 2 07:42:40 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +1 -0 lines
Added $Id$
Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed May 25 09:04:47 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2 -0 lines
The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch. Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Tue May 24 10:04:40 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: CSRG
CVS tags: bsd_44_lite_2, bsd_44_lite, REL_before_johndavid_2_0_0
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
BSD 4.4 Lite Kernel Sources
Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue May 24 10:04:39 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Initial revision
