Re: [PATCH 3/4] prctl: move MMF_EXE_FILE_CHANGED into exe_file struct

Davidlohr Bueso
2015-03-15T02:13:15Z

On Sat, 2015-03-14 at 15:39 -0700, Davidlohr Bueso wrote:
> + if (test_and_set_mm_exe_file(mm, exefd.file))
> + return 0;
> + return -EPERM;

Bah, this is obviously bogus. We'd need the following folded in:

diff --git a/kernel/sys.c b/kernel/sys.c
index a82d0c4..41b27bd 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1694,8 +1694,8 @@ set_file:
* This grabs a reference to exefd.file.
*/
if (test_and_set_mm_exe_file(mm, exefd.file))
- return 0;
- return -EPERM;
+ return -EPERM;
+ return 0;
}