--- kernel-source-2.4/fs/binfmt_elf.c.orig 2003-08-08 20:46:56.000000000 +1000 +++ kernel-source-2.4/fs/binfmt_elf.c 2003-08-08 20:47:05.000000000 +1000 @@ -480,6 +480,7 @@ files = current->files; /* Refcounted so ok */ if(unshare_files() < 0) goto out_free_ph; + steal_locks(files, current->files); /* exec will make our files private anyway, but for the a.out loader stuff we need to do it earlier */ @@ -797,7 +798,6 @@ if (current->ptrace & PT_PTRACED) send_sig(SIGTRAP, current, 0); retval = 0; - steal_locks(files, current->files); out: return retval; @@ -813,6 +813,7 @@ out_free_fh: ftmp = current->files; current->files = files; + steal_locks(ftmp, current->files); put_files_struct(ftmp); out_free_ph: kfree(elf_phdata);