opnsense-src/sys/vm
Dawid Gorecki 16a900ae02 setrlimit: Take stack gap into account.
Calling setrlimit with stack gap enabled and with low values of stack
resource limit often caused the program to abort immediately after
exiting the syscall. This happened due to the fact that the resource
limit was calculated assuming that the stack started at sv_usrstack,
while with stack gap enabled the stack is moved by a random number
of bytes.

Save information about stack size in struct vmspace and adjust the
rlim_cur value. If the rlim_cur and stack gap is bigger than rlim_max,
then the value is truncated to rlim_max.

PR: 253208
Reviewed by: kib
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D31516

(cherry picked from commit 889b56c8cd)
2021-12-30 16:24:59 +01:00
..
_vm_phys.h
_vm_radix.h
default_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
device_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
memguard.c
memguard.h
phys_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
pmap.h
redzone.c redzone: Raise a compile error if KASAN is configured 2021-11-01 10:07:31 -04:00
redzone.h
sg_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
swap_pager.c swapoff: add one more variant of the syscall 2021-12-20 02:29:11 +02:00
swap_pager.h swapoff: add one more variant of the syscall 2021-12-20 02:29:11 +02:00
uma.h uma: Add KASAN state transitions 2021-11-01 10:02:54 -04:00
uma_core.c uma: Fix handling of reserves in zone_import() 2021-11-15 09:07:10 -05:00
uma_dbg.c
uma_dbg.h
uma_int.h Improve UMA cache reclamation. 2021-05-15 22:10:48 -04:00
vm.h tmpfs: dynamically register tmpfs pager 2021-05-22 12:38:30 +03:00
vm_domainset.c
vm_domainset.h
vm_dumpset.h minidump: Use the provided dump bitset 2021-12-03 10:02:03 -04:00
vm_extern.h
vm_fault.c vm_fault: Fix vm_fault_populate()'s handling of VM_FAULT_WIRE 2021-12-27 19:36:07 -05:00
vm_glue.c Fix a common typo in syctl descriptions 2021-11-06 08:52:57 +01:00
vm_init.c Make MAXPHYS tunable. Bump MAXPHYS to 1M. 2020-11-28 12:12:51 +00:00
vm_kern.c Convert vm_page_alloc() callers to use vm_page_alloc_noobj(). 2021-11-03 13:39:36 -04:00
vm_kern.h
vm_map.c setrlimit: Take stack gap into account. 2021-12-30 16:24:59 +01:00
vm_map.h setrlimit: Take stack gap into account. 2021-12-30 16:24:59 +01:00
vm_meter.c
vm_mmap.c Add OBJT_SWAP_TMPFS pager 2021-05-22 12:38:29 +03:00
vm_object.c Eliminate key press requirement "show vmopag" command output. 2021-12-29 14:32:48 -05:00
vm_object.h vm: Add a mode to vm_object_page_remove() which skips invalid pages 2021-11-29 09:09:28 -05:00
vm_page.c vm_page: Tighten the object lock assertion in vm_page_invalid() 2021-12-13 08:26:34 -05:00
vm_page.h vm_page: Remove vm_page_sbusy() and vm_page_xbusy() 2021-11-29 09:11:37 -05:00
vm_pageout.c Fix a few typos in source code comments 2021-08-19 09:29:50 +02:00
vm_pageout.h
vm_pagequeue.h
vm_pager.c vm_pager: Optimize an assertion 2021-11-22 08:44:08 -05:00
vm_pager.h vm: Add KPI to dynamically register pagers 2021-05-22 12:38:30 +03:00
vm_param.h
vm_phys.c minidump: De-duplicate is_dumpable() 2021-10-15 12:20:48 -03:00
vm_phys.h minidump: De-duplicate is_dumpable() 2021-10-15 12:20:48 -03:00
vm_radix.c
vm_radix.h
vm_reserv.c vm_reserv: fix zero-boundary error 2021-12-29 11:23:48 -06:00
vm_reserv.h
vm_swapout.c
vm_swapout_dummy.c
vm_unix.c
vnode_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
vnode_pager.h