Date: Tue, 25 Jul 2006 09:17:57 GMT From: Chris Jones <cdjones@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 102357 for review Message-ID: <200607250917.k6P9HvqE019941@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=102357 Change 102357 by cdjones@cdjones-impulse on 2006/07/25 09:16:55 Check memory usage when loading ELF binary under jails. Affected files ... .. //depot/projects/soc2006/cdjones_jail/src/sys/kern/imgact_elf.c#5 edit Differences ... ==== //depot/projects/soc2006/cdjones_jail/src/sys/kern/imgact_elf.c#5 (text+ko) ==== @@ -58,6 +58,7 @@ #include <sys/sysctl.h> #include <sys/sysent.h> #include <sys/vnode.h> +#include <sys/jail.h> #include <vm/vm.h> #include <vm/vm_kern.h> @@ -761,7 +762,10 @@ PROC_LOCK(imgp->proc); if (data_size > lim_cur(imgp->proc, RLIMIT_DATA) || text_size > maxtsiz || - total_size > lim_cur(imgp->proc, RLIMIT_VMEM)) { + total_size > lim_cur(imgp->proc, RLIMIT_VMEM) || + (jailed(imgp->proc->p_ucred) && + total_size > (prison_memory_limit(imgp->proc->p_ucred) + - prison_memory(imgp->proc->p_ucred)))) { PROC_UNLOCK(imgp->proc); return (ENOMEM); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607250917.k6P9HvqE019941>