patch-2.1.11 linux/kernel/itimer.c
Next file: linux/kernel/module.c
Previous file: linux/kernel/info.c
Back to the patch index
Back to the overall index
- Lines: 39
- Date:
Sat Nov 16 13:11:17 1996
- Orig file:
v2.1.10/linux/kernel/itimer.c
- Orig date:
Tue Oct 29 19:58:48 1996
diff -u --recursive --new-file v2.1.10/linux/kernel/itimer.c linux/kernel/itimer.c
@@ -88,11 +88,7 @@
error = _getitimer(which, &get_buffer);
if (error)
return error;
- error = verify_area(VERIFY_WRITE, value, sizeof(struct itimerval));
- if (error)
- return error;
- copy_to_user(value, &get_buffer, sizeof(get_buffer));
- return 0;
+ return copy_to_user(value, &get_buffer, sizeof(get_buffer)) ? -EFAULT : 0;
}
void it_real_fn(unsigned long __data)
@@ -162,20 +158,17 @@
error = verify_area(VERIFY_READ, value, sizeof(*value));
if (error)
return error;
- copy_from_user(&set_buffer, value, sizeof(set_buffer));
+ error = copy_from_user(&set_buffer, value, sizeof(set_buffer));
+ if (error)
+ return -EFAULT;
} else
memset((char *) &set_buffer, 0, sizeof(set_buffer));
- if (ovalue) {
- error = verify_area(VERIFY_WRITE, ovalue, sizeof(struct itimerval));
- if (error)
- return error;
- }
-
error = _setitimer(which, &set_buffer, ovalue ? &get_buffer : 0);
if (error || !ovalue)
return error;
- copy_to_user(ovalue, &get_buffer, sizeof(get_buffer));
+ if (copy_to_user(ovalue, &get_buffer, sizeof(get_buffer)))
+ error = -EFAULT;
return error;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov