![]() | |||||||||||
Messages in this thread Patch in this message |
Hi all,
In the binfmt_flat.c, the flat binary loader should check file
descriptor table and install the fd on the file.
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 108d56b..6388187 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -493,6 +493,13 @@ static int load_flat_file(struct linux_b
if (data_len + bss_len > rlim)
return -ENOMEM;
+ /* check file descriptor */
+ int retval = get_unused_fd();
+ if (retval < 0)
+ return -EMFILE;
+ get_file(bprm->file);
+ fd_install(retval, bprm->file);
+
/* Flush all traces of the currently running executable */
if (id == 0) {
result = flush_old_exec(bprm);
signed-off-by: Luke Yang <luke.adi@gmail.com>
--
Best regards,
Luke Yang
magic.yyang@gmail.com; luke.adi@gmail.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
| ||||||||||
| Last update: 2006-03-23 08:12 [from the cache] ©2003-2008 | |||||||||||