add copy_to_user result check
PATCH 1/1 add copy_to_user result check
hello,
GCC warns me this problem. This patch adds copy_to_user result check in sys_select() and sys_pselect7().
Signed-off-by Coywolf Qi Hunt <[email protected]>
---
fs/select.c +4 -2
@@ -401,7 +401,8 @@ asmlinkage long sys_select(int n, fd_set tv.tv_sec++; tv.tv_usec -=1000000 ; } -copy_to_user (tvp, &tv,sizeof (tv)); +if (copy_to_user (tvp, &tv,sizeof (tv))) +return -EFAULT ; }return ret;
@@ -459,7 +460,8 @@ asmlinkage long sys_pselect7(int n, fd_s ts.tv_sec++; ts.tv_nsec -=1000000000 ; } -copy_to_user (tsp, &ts,sizeof (ts)); +if (copy_to_user (tsp, &ts,sizeof (ts))) +return -EFAULT ; }if (sigmask)