[PATCH] binfmt_flat: missing argv table

From: Yoshinori Sato
Date: Wed Jun 15 2011 - 03:49:46 EST


"put_user" is multiple times evalute on argument
(in asm-generic/uaccess.h).
So this code building argv table include gabage.

Signed-off-by: Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>

diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 811384b..127a198 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -144,7 +144,7 @@ static unsigned long create_flat_tables(
put_user(argc, sp);
current->mm->arg_start = (unsigned long) p;
while (argc-->0) {
- put_user((unsigned long) p, argv++);
+ put_user((unsigned long) p, argv); argv++;
do {
get_user(dummy, p); p++;
} while (dummy);

--
Yoshinori Sato
<ysato@xxxxxxxxxxxxxxxxxxxx>
--
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/