| This patch makes /proc/self/exe executable even if proc |
| is not mounted. It is especially useful on NOMMU arches. |
| diff -urp ../linux-2.6.30.org/fs/exec.c linux-2.6.30/fs/exec.c |
| --- ../linux-2.6.30.org/fs/exec.c 2009-06-10 05:05:27.000000000 +0200 |
| +++ linux-2.6.30/fs/exec.c 2009-06-25 00:20:13.000000000 +0200 |
| @@ -652,9 +652,25 @@ struct file *open_exec(const char *name) |
| file = do_filp_open(AT_FDCWD, name, |
| O_LARGEFILE | O_RDONLY | FMODE_EXEC, 0, |
| + if ((PTR_ERR(file) == -ENOENT || PTR_ERR(file) == -EACCES) |
| + && strcmp(name, "/proc/self/exe") == 0 |
| + struct file *sv = file; |
| + mm = get_task_mm(current); |
| + file = get_mm_exe_file(mm); |
| if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) |