Re: Please revert git commit 1ad3dcc0



Bernd Schmidt <bernds_cb1@xxxxxxxxxxx> wrote:

Linus, Andrew,

please revert 1ad3dcc0. That was a patch to the binfmt_flat loader,
which was motivated by an LTP testcase which checks that execve returns
EMFILE when the file descriptor table is full.

The patch is buggy: the code now keeps file descriptors open for the
executable and its libraries, which has confused at least one
application. It's also unnecessary, since there is no code that uses
the file descriptor, so the new EMFILE error return is totally artificial.

The reversion is
Signed-off-by: Bernd Schmidt <bernd.schmidt@xxxxxxxxxx>
Signed-off-by: Greg Ungerer <gerg@xxxxxxxxxxx>
and I think Luke had no objections either.


I don't get it. The substance of the patch is

+ /* check file descriptor */
+ exec_fileno = get_unused_fd();
+ if (exec_fileno < 0) {
+ ret = -EMFILE;
+ goto err;
+ }
+ get_file(bprm->file);
+ fd_install(exec_fileno, bprm->file);

and that get_file() will be undone by exit(). Without this change we'll
forget to do file limit checking.

So.. please tell us much more about the problem.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Please revert git commit 1ad3dcc0
    ... That was a patch to the binfmt_flat loader, which was motivated by an LTP testcase which checks that execve returns EMFILE when the file descriptor table is full. ...
    (Linux-Kernel)
  • Re: [PATCH] Use userland-like functions for reading the ACPI table
    ... especially since it depends on thread-global state (the file descriptor ... I *also* think this patch is just fundamentally broken regardless. ... So I would NAK this patch - it looks buggy, and the reason for it is not ...
    (Linux-Kernel)
  • Re: Change select(2) to kevent(2) on script(1)...
    ... devices' (svn commit: r185942). ... 'master' file descriptor ... Are you planning to commit the patch for scriptto SVN? ...
    (freebsd-current)
  • Re: Change select(2) to kevent(2) on script(1)...
    ... devices' (svn commit: r185942). ... 'master' file descriptor ... Are you planning to commit the patch for scriptto SVN? ...
    (freebsd-current)
  • Re: [Patch] Support UTF-8 scripts
    ... > whole point of my patch - I would not propose a kernel patch to ... The last time I handed execve() a script as a ... >> kernel config files ever. ... nothing about how to execute a text file - the kernel should return ...
    (Linux-Kernel)