summaryrefslogtreecommitdiff
path: root/sys/miscfs/procfs
AgeCommit message (Collapse)Author
2007-09-01replace the machine dependant bytes-to-clicks macro by the MI ptoa()Martin Reindl
version for i386 more architectures and ctob() replacement is being worked on prodded by and ok miod
2007-06-22declare "pid" as pid_t instead of long, and remove unneeded cast to pid_tJasper Lievisse Adriaanse
ok pedro@ thib@
2007-06-18ansify/de-register.Jasper Lievisse Adriaanse
no binary change
2007-06-01pedro ok'd this ~3500 line diff which removes the vop argumentTheo de Raadt
"ap = v" comments in under 8 seconds, so it must be ok. and it compiles too.
2007-03-15Since p_flag is often manipulated in interrupts and without biglockArtur Grabowski
it's a good idea to use atomic.h operations on it. This mechanic change updates all bit operations on p_flag to atomic_{set,clear}bits_int. Only exception is that P_OWEUPC is set by MI code before calling need_proftick and it's automatically cleared by ADDUPC. There's no reason for MD handling of that flag since everyone handles it the same way. kettenis@ ok
2007-01-01Allow reads of /proc/meminfo to be correctly terminated, okay thib@Pedro Martelletto
2006-11-29Kernel stack can be swapped. This means that stuff that's on the stackMiod Vallat
should never be referenced outside the context of the process to which this stack belongs unless we do the PHOLD/PRELE dance. Loads of code doesn't follow the rules here. Instead of trying to track down all offenders and fix this hairy situation, it makes much more sense to not swap kernel stacks. From art@, tested by many some time ago.
2006-08-28Allow building procfs on systems that don't #define PT_STEP (such as sparc64).Marc Aurele La France
ok pedro@, miod@
2006-03-05Use more queue macros rather than doing it by hand; ok otto@ krw@Miod Vallat
2005-12-11Replace procfs_domem() with a similar interface, process_domem(), which livesMiod Vallat
out of procfs and gets a ptrace request PT_{READ,WRITE}_{I,D} as argument; also procfs_checkioperm() becomes process_checkioperm(). From art@ some time ago; ok kettenis@ pedro@
2005-11-19Remove unnecessary lockmgr() archaism that was costing too much in termsPedro Martelletto
of panics and bugfixes. Access curproc directly, do not expect a process pointer as an argument. Should fix many "process context required" bugs. Incentive and okay millert@, okay marc@. Various testing, thanks.
2005-11-04Add an extra flags argument to uvm_io(), to specify whether we want to fixMiod Vallat
the protection of the memory mapping we're doing I/O on, or if we want to leave them as they are. This should only be necessary for breakpoint insertion in code, so we'll only use it for ptrace requests. Initially from art@ after discussion with kettenis@ millert@ and I, tested by many.
2005-05-31Protect the run queues with SCHED_LOCK, not just spl (ot nothing at all inArtur Grabowski
one case fixed here). miod@ "appears to be harmless" markus@ ok
2005-05-29sched work by niklas and art backed out; causes panicsTheo de Raadt
2005-05-25This patch is mortly art's work and was done *a year* ago. Art wants to thankNiklas Hallqvist
everyone for the prompt review and ok of this work ;-) Yeah, that includes me too, or maybe especially me. I am sorry. Change the sched_lock to a mutex. This fixes, among other things, the infamous "telnet localhost &" problem. The real bug in that case was that the sched_lock which is by design a non-recursive lock, was recursively acquired, and not enough releases made us hold the lock in the idle loop, blocking scheduling on the other processors. Some of the other processors would hold the biglock though, which made it impossible for cpu 0 to enter the kernel... A nice deadlock. Let me just say debugging this for days just to realize that it was all fixed in an old diff noone ever ok'd was somewhat of an anti-climax. This diff also changes splsched to be correct for all our architectures.
2005-04-21careful strlcpy and snprintf return handling; ok pedro beckTheo de Raadt
2005-04-16Remove regs and fpregs pseudo-files from procfs.Mark Kettenis
ok deraadt@, miod@
2005-04-01calling pfind() and checking that the process doesn't exist is notPedro Martelletto
enough to allow us to call vgone() from procfs_inactive(). to avoid a deadlock, check for VXLOCK as well, in case we were called from vclean(). problem report from Sho Fujita, okay tedu@.
2004-10-19use queue.h provided macro when traversing the process list, no changesPedro Martelletto
in generated object file. from Joris Vink.
2004-06-24This moves access to wall and uptime variables in MI code,Thorsten Lockert
encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
2004-05-20remove more caddr_tTed Unangst
2004-05-20Properly flush instruction cache for ptrace(PT_WRTIE_{DI}, ...) on powerpcMark Kettenis
and m68k. ok drahn@, millert@
2004-05-05make sure uio_offset is a safe value, with suggestions from millert@Ted Unangst
ok deraadt@ millert@ problem noticed by deprotect.com
2004-03-03repair status by not repeating fields. fixes pr2101 from jim razmusTed Unangst
2004-03-03save room for nul, so we can unmount later. pr2327 from peter wernerTed Unangst
2003-09-23Replace select backends with poll backends. selscan() and pollscan()Todd C. Miller
now call the poll backend. With this change we implement greater poll(2) functionality instead of emulating it via the select backend. Adapted from NetBSD and including some changes from FreeBSD. Tested by many, deraadt@ OK
2003-08-15change arguments to suser. suser now takes the process, and a flagsTed Unangst
argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
2003-08-14constify vfsops; tedu@ okMichael Shalayeff
2003-08-11constify constant namesMichael Shalayeff
2003-08-05make procfs support statfs args. lossage noticed and patch tested by jolanTed Unangst
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-04-28call lockmgr a bit earlier to avoid a race.Ted Unangst
2003-04-07sprintf elimination from rohee.Ted Unangst
2003-03-09Disallow ptrace if P_SUGIDEXEC flag is set (we already disallow if P_SUGIDTodd C. Miller
is set). deraadt@ and tholo@ OK.
2003-02-24use M_MISCFSMNT instead of M_UFSMNT for mount dataTed Unangst
ok art@
2003-01-31Sigh. I comitted the wrong diff in the last vfs changes.Artur Grabowski
These are the files that were ok:ed and tested.
2003-01-31File system locking fixups, mostly from NetBSD:Artur Grabowski
- cache_lookup move common code from various fs's here always return with vnode and parent locked adjust return codes - PDIRUNLOCK - new flag set if lookup couldn't lock parent vnode - kernfs and procfs lock vnode in get_root don't unlock (again) in kernfs_freevp fix memory leak in procfs From tedu@stanford.edu deraadt@ and various other ok
2002-04-06Do not hide Pfpregs from a switch() if PT_[GS]ETFPREGS are not defined,Miod Vallat
so that this compiles with option DIAGNOSTIC; fixes PR #2528 ok fgsch@
2002-03-14First round of __P removal in sysTodd C. Miller
2002-03-14Turn the ptrace(2) syscall into a kernel compile option, option PTRACE inMiod Vallat
your kernel configuration file. By default, GENERIC will enable this. When PTRACE is not enabled, several ptrace-like features of the procfs filesystem will be disabled as well (namely, the ability to read and write any process' registers, as well as attching, single stepping and detaching to/from processes). This should help paranoid people build better sandboxens, and us to build smaller ramdisks.
2002-03-11Since all archs implement PT_GETREGS and PT_SETREGS, make then unoptional.Artur Grabowski
They still stay in MD code for backwards compatibility, but a check in ptrace.h checks if they are defined. Note - the same thing will be done with PT_{GET,SET}FPREGS once vax implements them and with PT_STEP when it's implemented by sparc, sparc64 and alpha.
2002-01-30Move SET/CLR/ISSET macros to param.h. fgsch@ and millert@ okThomas Nordin
2002-01-30Add proc0 to the PIDHASH table. art@ okThomas Nordin
2002-01-20When a process is exec:ing mark it with a flag. Check that flag in ptraceArtur Grabowski
and procfs (and possibly more places in the future) and simply refuse to fiddle with the execing process. This is an ugly hack, but this far we haven't been successful in creating a race-free exec.
2001-12-04Readd VOP_MMAP, will be used soon. Right now it's just a question toArtur Grabowski
the filesystem if we're allowed to mmap the file.
2001-11-15uvm_vnp_setsizeArtur Grabowski
2001-11-15lockmgr instead of rolling our own.Artur Grabowski
2001-11-06Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.Miod Vallat
(Look ma, I might have broken the tree)
2001-11-06redundant includes.Artur Grabowski
2001-09-19No need to PHOLD/PRELE here, really.Artur Grabowski