Skip to contentSkip to conversation

Suspicious RLIM_INFINITY use, 2.4.17

PATCH Richard Zidlicky 1 participant 1 message Feb 5, 2002

lore
Share & tools
lore
#0 lore raw

Hi,

I came acros this (2.4.17):

fs/binfmt_aout.c:

	rlim = current->rlim[RLIMIT_DATA].rlim_cur;
	if (rlim >= RLIM_INFINITY)
		rlim = ~0;
	if (ex.a_data + ex.a_bss > rlim)
		return -ENOMEM;

this looks like it will disable any limit checks, but no similar code is binfmt_elf so maybe it should be removed altogether?

mmap.c Tue Feb 5 19:53:59 2002 renamed from mmap.c.rz Sat Dec 29 01:02:57 2001 +1 -1
@@ -167,7 +167,7 @@
 
        /* Check against rlimit.. */
        rlim = current->rlim[RLIMIT_DATA].rlim_cur;
-       if (rlim < RLIM_INFINITY && brk - mm->start_data > rlim)
+       if (rlim != RLIM_INFINITY && brk - mm->start_data > rlim)
                goto out;
 
        /* Check against existing mmap mappings. */

Richard