Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: kill HOST_TASK_PID

just provide get_current_pid() to the userland side of things
instead of get_current() + manual poking in its results

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Al Viro and committed by
Richard Weinberger
c2220b2a 28a12cb5

+4 -8
-2
arch/um/include/shared/common-offsets.h
··· 2 2 3 3 DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE); 4 4 5 - OFFSET(HOST_TASK_PID, task_struct, pid); 6 - 7 5 DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE); 8 6 DEFINE(UM_KERN_PAGE_MASK, PAGE_MASK); 9 7 DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT);
+1 -1
arch/um/include/shared/kern_util.h
··· 48 48 * GFP_ATOMIC. 49 49 */ 50 50 extern int __cant_sleep(void); 51 - extern void *get_current(void); 51 + extern int get_current_pid(void); 52 52 extern int copy_from_user_proc(void *to, void *from, int size); 53 53 extern int cpu(void); 54 54 extern char *uml_strdup(const char *string);
+2 -2
arch/um/kernel/process.c
··· 126 126 { 127 127 } 128 128 129 - void *get_current(void) 129 + int get_current_pid(void) 130 130 { 131 - return current; 131 + return task_pid_nr(current); 132 132 } 133 133 134 134 /*
+1 -3
arch/x86/um/bugs_32.c
··· 13 13 static int host_has_cmov = 1; 14 14 static jmp_buf cmov_test_return; 15 15 16 - #define TASK_PID(task) *((int *) &(((char *) (task))[HOST_TASK_PID])) 17 - 18 16 static void cmov_sigill_test_handler(int sig) 19 17 { 20 18 host_has_cmov = 0; ··· 49 51 * This is testing for a cmov (0x0f 0x4x) instruction causing a 50 52 * SIGILL in init. 51 53 */ 52 - if ((sig != SIGILL) || (TASK_PID(get_current()) != 1)) 54 + if ((sig != SIGILL) || (get_current_pid() != 1)) 53 55 return; 54 56 55 57 if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2)) {