diff options
Diffstat (limited to 'arch/um/os-Linux/start_up.c')
-rw-r--r-- | arch/um/os-Linux/start_up.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c index 387e26af301a..503148504009 100644 --- a/arch/um/os-Linux/start_up.c +++ b/arch/um/os-Linux/start_up.c | |||
@@ -296,29 +296,7 @@ static void __init check_ptrace(void) | |||
296 | check_sysemu(); | 296 | check_sysemu(); |
297 | } | 297 | } |
298 | 298 | ||
299 | extern int create_tmp_file(unsigned long long len); | 299 | extern void check_tmpexec(void); |
300 | |||
301 | static void check_tmpexec(void) | ||
302 | { | ||
303 | void *addr; | ||
304 | int err, fd = create_tmp_file(UM_KERN_PAGE_SIZE); | ||
305 | |||
306 | addr = mmap(NULL, UM_KERN_PAGE_SIZE, | ||
307 | PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0); | ||
308 | printf("Checking PROT_EXEC mmap in /tmp..."); | ||
309 | fflush(stdout); | ||
310 | if(addr == MAP_FAILED){ | ||
311 | err = errno; | ||
312 | perror("failed"); | ||
313 | if(err == EPERM) | ||
314 | printf("/tmp must be not mounted noexec\n"); | ||
315 | exit(1); | ||
316 | } | ||
317 | printf("OK\n"); | ||
318 | munmap(addr, UM_KERN_PAGE_SIZE); | ||
319 | |||
320 | close(fd); | ||
321 | } | ||
322 | 300 | ||
323 | void os_early_checks(void) | 301 | void os_early_checks(void) |
324 | { | 302 | { |