Skip to contentSkip to conversation

fs/binfmts: double unlock in search_binary_handler()

PATCH New Dan Carpenter 1 participant 1 message Aug 1, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/binfmts: double unlock in search_binary_handler()

The recent -mm patch 3046d15088 "fs/binfmts: better handling of binfmt loops" introduced a new "continue" to the loop. The problem is that we are supposed to be holding the lock at the start so we need to take it again.

---
Static checker stuff. Untested.

fs/exec.c +1 -0
index f8b7ed1..e2785fc 100644
@@ -1426,6 +1426,7 @@ int search_binary_handler(struct linux_binprm *bprm)
 				copy_strings(bprm->argc_orig, *((struct user_arg_ptr *) bprm->argv_orig), bprm);
 				bprm->argc = bprm->argc_orig;
 				retval = -ENOEXEC;
+				read_lock(&binfmt_lock);
 				continue;
 			}