summaryrefslogtreecommitdiff
path: root/sys/dev/dtv/dtv_buffer.c
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2018-05-01 16:37:23 +0000
committerkamil <kamil@NetBSD.org>2018-05-01 16:37:23 +0000
commit9d02027080155d5c5f8a4aa515c658328fa6eeb2 (patch)
tree4319129cf2d201608e4282cde4e6e2c08d1a1c98 /sys/dev/dtv/dtv_buffer.c
parent5366ef43b53d63d81ecc71786daabcae5f6e0432 (diff)
Implement PTRACE_VFORK
Add support for tracing vfork(2) events in the context of ptrace(2). This API covers other frontends to fork1(9) like posix_spawn(2) or clone(2), if they cause parent to wait for exec(2) or exit(2) of the child. Changes: - Add new argument to sigswitch() determining whether we need to acquire the proc_lock or whether it's already held. - Refactor fork1(9) for fork(2) and vfork(2)-like events. Call sigswitch() from fork(1) for forking or vforking parent, instead of emitting kpsignal(9). We need to emit the signal and suspend the parent, returning to user and relock proc_lock. - Add missing prototype for proc_stop_done() in kern_sig.c. - Make sigswitch a public function accessible from other kernel code including <sys/signalvar.h>. - Remove an entry about unimplemented PTRACE_VFORK in the ptrace(2) man page. - Permin PTRACE_VFORK in the ptrace(2) frontend for userland. - Remove expected failure for unimplemented PTRACE_VFORK tests in the ATF ptrace(2) test-suite. - Relax signal routing constraints under a debugger for a vfork(2)ed child. This intended to protect from signaling a parent of a vfork(2)ed child that called PT_TRACE_ME, but wrongly misrouted other signals in vfork(2) use-cases. Add XXX comments about still existing problems and future enhancements: - correct vfork(2) + PT_TRACE_ME handling. - fork1(2) handling of scenarios when a process is collected in valid but rare cases. All ATF ptrace(2) fork[1-8] and vfork[1-8] tests pass. Fix PR kern/51630 by Kamil Rytarowski (myself). Sponsored by <The NetBSD Foundation>
Diffstat (limited to 'sys/dev/dtv/dtv_buffer.c')
0 files changed, 0 insertions, 0 deletions
='2005-12-08 03:06:31 +0000'>2005-12-08Use ANSI function decls.thorpej 2005-06-25the magic number is not byte-swapped.christos 2005-05-29- add const.christos - remove unnecessary casts. - add __UNCONST casts and mark them with XXXUNCONST as necessary. 2004-09-04Recognize bundles as mach-O executablesmanu 2004-03-23- Nuke __P().junyoung - Drop trailing spaces. 2003-10-20One more section type in the Mach-O format. Now /usr/X11R6/bin/quartz-wm linksmanu and run (it aborts because the dock is not launched). 2003-10-19Support Darwin static binaries (I should say: support the only Darwinmanu static binary: otool). Dynamic binaires have a pointer to the Mach-O header on the top of the stack, static binaries don't have this, and having it produced a crash. One bugfix: the EXEC_MACHO code assumes that entry = NULL means that the entry point has not been found in the load commands seen so far. Therefore we need to initialized entry to NULL if we want a static binary to discover it. (dynamic binaries were forced to iscover it because when the intepreter load command is found, entry is updated whatever its value was before). One hack: Both COMPAT_MACH and COMPAT_DARWIN are willing to run Mach-O binaries. COMPAT_MACH fails for dynamic binaries because it cannot find the interpreter in /emul/mach. For static binaires, it will accept them (and for Darwin static binaries, this will cause a failure). Until we rite a test for matchinf Darwin static binaries, just swap the order of COMPAT_MACH and COMPAT_DARWIN in the exec switch so that COMPAT_DARWIN is tried first (this will have the advantage of speeding up program startup). EXECSW_PRIO_{FIRST_LAST} does not seem to work... 2003-09-07Correctly check Mach-O fat header so that fat binaries get launched.manu 2003-08-08GC: exec_foo_setup_stack; use exec_setup_stack, and provide a way forchristos emulations to override it. 2003-06-29Back out the lwp/ktrace changes. They contained a lot of colateral damage,fvdl and need to be examined and discussed more. 2003-06-28Pass lwp pointers throughtout the kernel, as required, so that the lwpid candarrenr be inserted into ktrace records. The general change has been to replace "struct proc *" with "struct lwp *" in various function prototypes, pass the lwp through and use l_proc to get the process pointer when needed. Bump the kernel rev up to 1.6V 2003-04-21Some Mach-O libraries do not have a load base address. The Darwinmanu kernel seems to skip them, letting the dirty job to dyld. 2002-12-11Load __OBJC and ____CGSERVER sections of Mach-O binaries as __TEXT.manu 2002-11-29back out the previous change, which is useless. Darwin loads the librariesmanu that are required by the binary, not the libraries required by the libraries required by the binary. Hopefully, binaries should load again on i386. 2002-11-29Maitain a chainedlist of already loaded Mach-O objects, to avoid loadingmanu the same file multiple times because of recursive loading (ie: libx require liby and libz and liby require libz, so libz would be loaded twice) This is probably suboptimal, but it enable /bin/sh to load on the PowerPC, so it's a good interim solution until we figure precisely how things should work. I'm not sure whether this makes the excessive recursive check useless or not. 2002-11-24Rewrite the excessive recursive loading protection by actually counting themanu recursions instead of the total function calls. We limit to 6 recursion, which is what Darwin does. 2002-11-22Libraries do not use relative addresses, they are absolute and should bemanu treated as such if we want the same mapping as in Darwin. While we are there KNFify function names 2002-11-21Check for excessive recursive Mach-O loadingmanu 2002-11-21Remove a debug message that has been committed by mistake.manu 2002-11-21We now have the exact stack initial stack layout of Darwin:manu macho_hdr, argc, *argv, NULL, *envp, NULL, progname, NULL, *progname, **argv, **envp Where progname is a pointer to the program name as given in the first argument to execve(), and macho_hdr a pointer to the Mach-O header at the beginning of the executable file. 2002-10-31XXX: be32toh on powerpc does not cast to int32_t so passing u_long tochristos be32toh produces an unsigned long result, causing a printf argument mismatch. This is the wrong fix, but I am not going to change the powerpc macros; fix the powerpc macros and revert my change. 2002-10-30int format long arg problemsmanu 2002-10-30fix fat binary architecture choosing code. mach binaries now execute aschristos poorly as before the x86 MP merge. 2002-10-30make this compile again.christos 2002-10-29Introduce an array of supported CPU types by a given arch for Mach-Omanu 2002-10-29If the magic number is 0xfeedface instead of 0xcafebabe, this means thatmanu the executable is not fat. The binary starts with an object header instead of a mach fat header. 2002-10-05count executable image pages as executable for vm-usage purposes.chs also, always do the VTEXT vs. v_writecount mutual exclusion (which we previously skipped if the text or data segment was empty). 2002-09-27remove trailing \n in panic(). approved perry.provos 2001-11-12add RCSIDslukem 2001-11-10fix compile typo.christos 2001-10-30- Add a new vnode flag VEXECMAP, which indicates that a vnode hasthorpej executable mappings. Stop overloading VTEXT for this purpose (VTEXT also has another meaning). - Rename vn_marktext() to vn_markexec(), and use it when executable mappings of a vnode are established. - In places where we want to set VTEXT, set it in v_flag directly, rather than making a function call to do this (it no longer makes sense to use a function call, since we no longer overload VTEXT with VEXECMAP's meaning). VEXECMAP suggested by Chuq Silvers. 2001-10-28make a copy of the epp->ep_path, because it is too late to use it whenchristos copyargs is called since we've swapped vmspaces. 2001-07-14use be32toh instead of bswap32christos add a macro MACHO_MACHDEP_CASES instead of ifdef'ing cpu types. thanks jason! 2001-07-14new exec module for MACH-O fat binarieschristos XXX: shared libraries are not handled properly yet.