Re: Resource limit test in binfmt_elf

Richard Henderson (richard@atheist.tamu.edu)
Fri, 14 Jun 1996 13:20:41 -0500 (CDT)


> Thanks. Here's my second try. Besidess, shouldn't it be possible to set the
> limit on a per user base?

Eh? It is settable on a per-process basis. That's what the
current->rlim[...] is all about.

Two little buglets:

for(i=0;i < elf_ex.e_phnum; i++){
if(elf_ppnt->p_flags & PF_W) {
! unsigned int new_data_size = datasize+elf_ppnt->p_memsz;
if (new_data_size > rlim || new_data_size < datasize)
return -ENOMEM;
}
elf_ppnt++;
}
--------
for(i=0;i < elf_ex.e_phnum; i++){
if(elf_ppnt->p_flags & PF_W) {
! unsigned long new_data_size = datasize+elf_ppnt->p_memsz;
if (new_data_size > rlim || new_data_size < datasize)
return -ENOMEM;
+ data_size = new_data_size;
}
elf_ppnt++;
}

r~