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_phys: Try to clean up NUMA KPIs 2020-11-19 03:59:21 +00:00
_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 vm: clean up empty lines in .c and .h files 2020-09-01 21:20:45 +00:00
memguard.h LinuxKPI: Implement ksize() function. 2020-08-29 19:26:31 +00:00
phys_pager.c vm_object_kvme_type(): reimplement by embedding kvme_type into pagerops 2021-05-22 12:38:30 +03:00
pmap.h Add pmap_enter(9) PMAP_ENTER_LARGEPAGE flag and implement it on amd64. 2020-09-09 21:50:24 +00:00
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 Add interruptible variant of vm_wait(9), vm_wait_intr(9). 2020-09-08 23:28:09 +00:00
vm_domainset.h Add interruptible variant of vm_wait(9), vm_wait_intr(9). 2020-09-08 23:28:09 +00:00
vm_dumpset.h minidump: Use the provided dump bitset 2021-12-03 10:02:03 -04:00
vm_extern.h Remove the VM map zone. 2020-08-17 13:02:01 +00:00
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 Remove the VM map zone. 2020-08-17 13:02:01 +00:00
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: clean up empty lines in .c and .h files 2020-09-01 21:20:45 +00:00
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 Add interruptible variant of vm_wait(9), vm_wait_intr(9). 2020-09-08 23:28:09 +00:00
vm_pagequeue.h vm_phys: Try to clean up NUMA KPIs 2020-11-19 03:59:21 +00:00
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 (fault 3/9) Move map relookup into a dedicated function. 2020-01-23 05:07:01 +00:00
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: clean up empty lines in .c and .h files 2020-09-01 21:20:45 +00:00
vm_radix.h Use SMR to provide a safe unlocked lookup for vm_radix. 2020-02-19 19:58:31 +00:00
vm_reserv.c vm_reserv: fix zero-boundary error 2021-12-29 11:23:48 -06:00
vm_reserv.h Fix locking in vm_reserv_reclaim_contig(). 2019-11-22 16:28:52 +00:00
vm_swapout.c Use a single VM object for kernel stacks. 2020-04-26 20:08:57 +00:00
vm_swapout_dummy.c
vm_unix.c Prepare to handle non-trivial errors from vm_map_delete(). 2020-09-09 21:34:31 +00:00
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