Page MenuHomeFreeBSD

D2731.id5944.diff
No OneTemporary

D2731.id5944.diff

Index: sys/kern/imgact_elf.c
===================================================================
--- sys/kern/imgact_elf.c
+++ sys/kern/imgact_elf.c
@@ -901,12 +901,25 @@
* not actually fault in all the segments pages.
*/
PROC_LOCK(imgp->proc);
- if (data_size > lim_cur(imgp->proc, RLIMIT_DATA) ||
- text_size > maxtsiz ||
- total_size > lim_cur(imgp->proc, RLIMIT_VMEM) ||
- racct_set(imgp->proc, RACCT_DATA, data_size) != 0 ||
- racct_set(imgp->proc, RACCT_VMEM, total_size) != 0) {
+ if (data_size > lim_cur(imgp->proc, RLIMIT_DATA)) {
PROC_UNLOCK(imgp->proc);
+ uprintf("Data segment size exceeds process limit\n");
+ return (ENOMEM);
+ } else if (text_size > maxtsiz) {
+ PROC_UNLOCK(imgp->proc);
+ uprintf("Text segment size exceeds system limit\n");
+ return (ENOMEM);
+ } else if (total_size > lim_cur(imgp->proc, RLIMIT_VMEM)) {
+ PROC_UNLOCK(imgp->proc);
+ uprintf("Total segment size exceeds process limit\n");
+ return (ENOMEM);
+ } else if (racct_set(imgp->proc, RACCT_DATA, data_size) != 0) {
+ PROC_UNLOCK(imgp->proc);
+ uprintf("Data segment size exceeds resource limit\n");
+ return (ENOMEM);
+ } else if (racct_set(imgp->proc, RACCT_VMEM, total_size) != 0) {
+ PROC_UNLOCK(imgp->proc);
+ uprintf("Total segment size exceeds resource limit\n");
return (ENOMEM);
}

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 4, 5:44 AM (4 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29229995
Default Alt Text
D2731.id5944.diff (1 KB)

Event Timeline