lkml.org 
[lkml]   [2000]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [FIX] Re: Argument list too long: out of environment space
Khimenko Victor wrote:
> > Feel free to remove the limit altogether and make it dynamic. Something
> > involving an extra struct mm which you are filling up ptrace-style might
> > be appropriate. It must be pageable if it can be arbitrarily large.
>
> Is it really needed ? This is HARD problem. Since you need to keep in
> one address space both arguments passed to execve and new argv
> array. You can try to scan source arguments and make clever rearrange
> of strings in memory (this is not simple: think about something like
> execl("bin/echo",plong_string,plong_string+10,0); for example) or you
> can just clone current process and move agruments from one process to
> another... Both ways looks EXTREMALLY hairy to me and not needed in
> most cases

There's a much simpler method. Just create a new address space (struct
mm) and copy into it the same way as ptrace does.

To make it pageable, simply store the address of the new mm somewhere
and arrange for the vmscan code to scan it just like the other mms. (A
linked list of mms might be useful for another reason: so that vmscan
doesn't repeatedly scan the same mm when it is shared between threads).

> (of course ability to sucessfully call execve with argv
> bigger then amount of RAM in system is sexy but how often it's really
> needed?).

If you remove the argv limit but don't make execve pageable, then you
have a DOS attack. A nasty one: you can lock XXX megabytes instantly.
The pages are locked until the new file is mapped, and you can arrange
for that to take a long time.

It doesn't have to be larger than RAM. Just 10 concurrent 10MB
attempted execves would be a DOS on most systems. You could limit it in
the same way that a limit on lockable user pages has been proposed
generally.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.225 / U:0.496 seconds]
©2003-2011 Jasper Spaans. Advertise on this site