setitimer(): Fix error handling of copy_from_user()
This fixes POSTK_TEMP_FIX_40 (POSTK_DEBUG_TEMP_FIX_40)
This commit is contained in:
@ -6863,12 +6863,9 @@ SYSCALL_DECLARE(setitimer)
|
||||
if(!new){
|
||||
return 0;
|
||||
}
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_40 /* setitimer copy_from_user() error return fix. */
|
||||
if(copy_from_user(&thread->itimer_virtual, new, sizeof(struct itimerval)))
|
||||
if (copy_from_user(&thread->itimer_virtual, new, sizeof(struct itimerval))) {
|
||||
return -EFAULT;
|
||||
#else /* POSTK_DEBUG_TEMP_FIX_40 */
|
||||
if(copy_from_user(&thread->itimer_virtual, new, sizeof(struct itimerval)))
|
||||
#endif /* POSTK_DEBUG_TEMP_FIX_40 */
|
||||
}
|
||||
thread->itimer_virtual_value.tv_sec = 0;
|
||||
thread->itimer_virtual_value.tv_nsec = 0;
|
||||
if(thread->itimer_virtual.it_value.tv_sec == 0 &&
|
||||
@ -6889,12 +6886,9 @@ SYSCALL_DECLARE(setitimer)
|
||||
if(!new){
|
||||
return 0;
|
||||
}
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_40 /* setitimer copy_from_user() error return fix. */
|
||||
if(copy_from_user(&thread->itimer_prof, new, sizeof(struct itimerval)))
|
||||
if (copy_from_user(&thread->itimer_prof, new, sizeof(struct itimerval))) {
|
||||
return -EFAULT;
|
||||
#else /* POSTK_DEBUG_TEMP_FIX_40 */
|
||||
if(copy_from_user(&thread->itimer_prof, new, sizeof(struct itimerval)))
|
||||
#endif /* POSTK_DEBUG_TEMP_FIX_40 */
|
||||
}
|
||||
thread->itimer_prof_value.tv_sec = 0;
|
||||
thread->itimer_prof_value.tv_nsec = 0;
|
||||
if(thread->itimer_prof.it_value.tv_sec == 0 &&
|
||||
|
||||
Reference in New Issue
Block a user