summaryrefslogtreecommitdiffstats
path: root/sys/uvm/uvm_unix.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* New mmap(2) flag: MAP_CONCEAL.cheloha2019-03-011-1/+5
| | | | | | | | | | | | | MAP_CONCEAL'd memory is not written to disk in the event of a core dump. It may grow other qualities in the future. Wanted by libressl, probably useful elsewhere, too. Prompted by deraadt@, concept from deraadt@/kettenis@. With input from deraadt@, cjeker@, kettenis@, otto@, bcook@, matthew@, guenther@, djm@, and tedu@. ok otto@ deraadt@
* Don't take the vmmap lock when dumping core: it's not actually necessaryguenther2017-03-091-3/+1
| | | | | | and it creates a lock-order-reversal with inode locks ok stefan@
* Handle unshared amaps in uvm_coredump_walkmap() such that untouched pagesguenther2017-03-051-5/+142
| | | | | | | | | | don't get written out to the core file but rather are represented via segments which have memory size greater than their file size. This shrinks core files and eliminates a case where core dumping fails with EFAULT. This can still happen in the shared amap case. Based on a problem report from (and testing by) semarie@ ok stefan@
* Generating a coredump requires walking the map twice; changeguenther2017-03-051-64/+78
| | | | | | | uvm_coredump_walkmap() to do both with a callback in between so it can hold locks/change state across the two. ok stefan@
* When dumping core, skip pages marked as unreadable instead of abortingguenther2017-02-021-1/+11
| | | | | | | the dump. tracked down with help from semarie@ ok mpi@
* move the uvm_map_addr RB tree from RB macros to the RBT functionsdlg2016-09-161-2/+2
| | | | | | | | | this tree is interesting because it uses all the red black tree features, specifically the augment callback thats called on tree topology changes, and it poisons and checks entries as theyre removed from and inserted back into the tree respectively. ok stefan@
* Include map entries that have an amap associated with them in the coredump.kettenis2016-08-121-1/+2
| | | | | | | This fixes coredumps of processes that use relro to make part of their writable address space read-only. ok guenther@
* UVM_FLAG_AMAPPAD has no effect anymore, nuke it.stefan2016-04-041-3/+2
| | | | | | | | | | | | | | This flag caused amaps to be allocated with additional spare slots, to make extending them cheaper. However, the kernel never extends amaps, so allocating spare slots is pointless. Also UVM_FLAG_AMAPPAD only has an effect in combination with UVM_FLAG_OVERLAY. The only function that used both flags was sys_obreak, but that function had the use of UVM_FLAG_OVERLAY removed recently. While there, kill the unused prototypes amap_flags and amap_refs. They're defined as macros already. ok mlarkin@ kettenis@ mpi@
* Allocate amap slots for a virtual memory range reserved with sbrk lazily.stefan2016-03-151-2/+2
| | | | | | | | | This avoids wasting kernel memory if the user process does not make use of the allocated memory. Testing by sthen@ and tobiasu@, thanks! ok deraadt@
* emul_native is only used for kernel threads which can't dump core, soguenther2015-05-051-115/+4
| | | | | | | | | | | delete coredump_trad(), uvm_coredump(), cpu_coredump(), struct md_coredump, and various #includes that are superfluous. This leaves compat_linux processes without a coredump callback. If that ability is desired, someone should update it to use coredump_elf32() and verify the results... ok kettenis@
* Stop using USRSTACK as the edge of the stack, but rather use the vmspacemiod2015-02-091-12/+17
| | | | | | | | vm_minsaddr or vm_maxsaddr, depending upon the direction the stack goes in. This should have no effect on the existing behaviourrr. ok kettenis@ deraadt@
* Prefer MADV_* over POSIX_MADV_* in kernel for consistency: the latterguenther2014-12-171-2/+2
| | | | | | doesn't have all the values and therefore can't be used everywhere. ok deraadt@ kettenis@
* Use MAP_INHERIT_* for the 'inh' argument to the UMV_MAPFLAG() macro,guenther2014-12-151-2/+2
| | | | | | eliminating the must-be-kept-in-sync UVM_INH_* macros ok deraadt@ tedu@
* instead of PROT_MASK, use PROT_READ | PROT_WRITE | PROT_EXEC toderaadt2014-11-171-2/+3
| | | | | | show the maxprot available in obreak mappings. (the default remains PROT_READ | PROT_WRITE, so don't be afraid). ok tedu
* Replace a plethora of historical protection options with justderaadt2014-11-161-5/+5
| | | | | | | PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
* Chuck Cranor rescinded clauses in his licensejsg2014-07-111-7/+2
| | | | | | | | | | | | | on the 2nd of February 2011 in NetBSD. http://marc.info/?l=netbsd-source-changes&m=129658899212732&w=2 http://marc.info/?l=netbsd-source-changes&m=129659095515558&w=2 http://marc.info/?l=netbsd-source-changes&m=129659157916514&w=2 http://marc.info/?l=netbsd-source-changes&m=129665962324372&w=2 http://marc.info/?l=netbsd-source-changes&m=129666033625342&w=2 http://marc.info/?l=netbsd-source-changes&m=129666052825545&w=2 http://marc.info/?l=netbsd-source-changes&m=129666922906480&w=2 http://marc.info/?l=netbsd-source-changes&m=129667725518082&w=2
* compress code by turning four line comments into one line comments.tedu2014-04-131-23/+8
| | | | emphatic ok usual suspects, grudging ok miod
* Move p_emul and p_sigcode from proc to process.guenther2014-03-261-3/+3
| | | | | | | | | Tweak the handling of ktrace EMUL when changing ktracing: only generate one per process (not one per thread) and pass the correct proc pointer down to the VFS layer. Permit generating of NAMI and CSW records inside ktrace(2) itself. ok deraadt@ millert@
* in uvm_coredump, use RB_FOREACH_SAFE because we are torturing the mapderaadt2013-01-161-3/+3
| | | | | inside the loop. Fixes a.out coredumps for miod, solution from guenther. ok miod
* oops, one IO_NODELOCKED left behind in the a.out coredumperderaadt2013-01-161-3/+2
| | | | ok guenther
* Allow SIGKILL to terminate coredumping processes. Semantics decidedderaadt2013-01-151-1/+4
| | | | | with kettenis guenther and beck. ok guenther
* Slice & dice coredump write requests into MAXPHYS blocks, andderaadt2013-01-151-10/+25
| | | | | | yield between operations. Re-grab the vnode every operation, so that multiple coredumps can be saved at the same time. ok guenther beck etc
* New vmmap implementation.ariane2012-03-091-7/+3
| | | | | | | | | | | | no oks (it is really a pain to review properly) extensively tested, I'm confident it'll be stable 'now is the time' from several icb inhabitants Diff provides: - ability to specify different allocators for different regions/maps - a simpler implementation of the current allocator - currently in compatibility mode: it will generate similar addresses as the old allocator
* Backout vmmap in order to repair virtual address selection algorithmsariane2011-06-061-3/+7
| | | | outside the tree.
* Reimplement uvm/uvm_map.ariane2011-05-241-7/+3
| | | | | | | | | | | | | vmmap is designed to perform address space randomized allocations, without letting fragmentation of the address space go through the roof. Some highlights: - kernel address space randomization - proper implementation of guardpages - roughly 10% system time reduction during kernel build Tested by alot of people on tech@ and developers. Theo's machines are still happy.
* Proper check for wrapping high address and setting the break below theotto2009-11-241-5/+5
| | | | base of data; with nicm@ ok miod@ guenther@
* Recommit part of miod's no-coredumps-on-ramdisks diff that got lost in thekettenis2009-06-171-1/+5
| | | | | | big uvm backout mess. ok miod@
* date based reversion of uvm to the 4th May.oga2009-06-171-5/+1
| | | | | | | | | | | More backouts in line with previous ones, this appears to bring us back to a stable condition. A machine forced to 64mb of ram cycled 10GB through swap with this diff and is still running as I type this. Other tests by ariane@ and thib@ also seem to show that it's alright. ok deraadt@, thib@, ariane@
* We need miod's no-coredumps-on-ramdisks diff, because we have grown thederaadt2009-06-061-1/+5
| | | | media just a wee bit too much.
* While working on some stuff in uvm I've gotten REALLY sick of readingoga2009-03-201-13/+5
| | | | | | | K&R function declarations, so switch them all over to ansi-style, in accordance with the prophesy. "go for it" art@
* Make ELF platforms generate ELF core dumps. Somewhat based on code fromkettenis2009-03-051-1/+74
| | | | | | NetBSD. ok kurt@, drahn@, miod@
* Include sigcode in core dumps. This makes it possible to backtracekettenis2008-03-021-2/+3
| | | | | | through signal handlers with gdb. ok miod@
* Don't dump duplicate data in stack segments of core dumps when the stackkettenis2008-02-271-5/+9
| | | | | | memory map is fragmented. Avoids ridiculously large core dumps. ok miod@
* Mark vadvise(2) as obsolete and remove its implementation, so instead ofmiod2008-01-051-21/+1
| | | | | | | | | returning EINVAL, you'll get ENOSYS. No serious code has used this system call in at least fifteen years. The libc stub will be removed at the next major crank time. ok henning@ deraadt@ krw@ toby@
* Correctly calculate stack increment for MACHINE_STACK_GROWS_UP; fixes problemskettenis2007-12-161-2/+2
| | | | | | where core dumps on hppa were missing the last stack page. ok miod@
* replace ctob and btoc with ptoa and atop respectivelymartin2007-09-151-4/+4
| | | | help and ok miod@ thib@
* replace the machine dependant bytes-to-clicks macro by the MI ptoa()martin2007-09-011-5/+5
| | | | | | | | version for i386 more architectures and ctob() replacement is being worked on prodded by and ok miod
* The return value of uvm_grow() (and previously, grow()) has not been usedmiod2007-04-111-9/+7
| | | | | | in 15 years, make it a void function. ok art@
* - Make a UVM_OBJ_IS_DEVICE macro.art2005-07-261-2/+13
| | | | | | | | | | | | | - Use it to skip device mappings while dumping core. - Ignore EFAULT errors while dumping core since they can happen even for valid mappings. Just skip that part of the core file and let it get automagically zero-filled. This fixes the broken X core dumps that people have been seeing and also fixes some other potential problems that could prevent core dumps (mmaps beyond EOF, etc.). tedu@ ok
* do not treat map entries above the stack as stack; only for the grow-upsmickey2003-03-041-2/+2
|
* fix the way stack is written into the core file on the upward growing stack machines. the other case is not affected. miod@ deraadt@ okmickey2003-02-181-5/+8
|
* user-defined stacks check is the same for grownups as for growndownsmickey2002-12-201-5/+1
|
* simplify stack grownups (growndowns are not touched)mickey2002-12-191-2/+2
|
* Since memory deallocation can't fail, remove the error return fromart2002-10-291-20/+15
| | | | | uvm_unmap, uvm_deallocate and a few other functions. Simplifies some code and reduces diff to the UBC branch.
* map the heap without PROT_EXEC.art2002-08-231-2/+2
| | | | deraadt@ ok.
* UBC was a disaster. It worked very good when it worked, but on someart2001-12-191-21/+26
| | | | | | | | | machines or some configurations or in some phase of the moon (we actually don't know when or why) files disappeared. Since we've not been able to track down the problem in two weeks intense debugging and we need -current to be stable, back out everything to a state it had before UBC. We apologise for the inconvenience.
* Sync in more uvm from NetBSD. Mostly just cosmetic stuff.art2001-11-281-16/+14
| | | | Contains also support for page coloring.
* Sync in more uvm changes from NetBSD.art2001-11-281-17/+14
| | | | | This time we're getting rid of KERN_* and VM_PAGER_* error codes and use errnos instead.
* Another sync of uvm to NetBSD. Just minor fiddling, no major changes.art2001-11-071-5/+5
|
* Add an alignment argument to uvm_map that specifies an alignment hintart2001-11-071-3/+3
| | | | for the virtual address.