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

Configure Feed

Select the types of activity you want to include in your feed.

kernel/sys.c: fix prototype of prctl_get_tid_address()

tid_addr is not a "pointer to (pointer to int in userspace)"; it is in
fact a "pointer to (pointer to int in userspace) in userspace". So
sparse rightfully complains about passing a kernel pointer to
put_user().

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Rasmus Villemoes and committed by
Linus Torvalds
986b9eac 23224e45

+3 -3
+3 -3
kernel/sys.c
··· 2238 2238 } 2239 2239 2240 2240 #ifdef CONFIG_CHECKPOINT_RESTORE 2241 - static int prctl_get_tid_address(struct task_struct *me, int __user **tid_addr) 2241 + static int prctl_get_tid_address(struct task_struct *me, int __user * __user *tid_addr) 2242 2242 { 2243 2243 return put_user(me->clear_child_tid, tid_addr); 2244 2244 } 2245 2245 #else 2246 - static int prctl_get_tid_address(struct task_struct *me, int __user **tid_addr) 2246 + static int prctl_get_tid_address(struct task_struct *me, int __user * __user *tid_addr) 2247 2247 { 2248 2248 return -EINVAL; 2249 2249 } ··· 2427 2427 error = prctl_set_mm(arg2, arg3, arg4, arg5); 2428 2428 break; 2429 2429 case PR_GET_TID_ADDRESS: 2430 - error = prctl_get_tid_address(me, (int __user **)arg2); 2430 + error = prctl_get_tid_address(me, (int __user * __user *)arg2); 2431 2431 break; 2432 2432 case PR_SET_CHILD_SUBREAPER: 2433 2433 me->signal->is_child_subreaper = !!arg2;