Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47493
b: refs/heads/master
c: 3ee75ac
h: refs/heads/master
i:
  47491: b3bfbda
v: v3
  • Loading branch information
Alexey Dobriyan authored and Linus Torvalds committed Feb 11, 2007
1 parent d171fa2 commit 04f8a01
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b6312f4dcc1efe7975731b6c47dd134282bd9ac
refs/heads/master: 3ee75ac3c0f4904633322b7d9b111566fbc4a7d3
44 changes: 28 additions & 16 deletions trunk/kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2553,17 +2553,23 @@ int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval) {
if (oldval && oldlenp) {
size_t olen;
if (oldlenp) {
if (get_user(olen, oldlenp))

if (get_user(olen, oldlenp))
return -EFAULT;
if (olen) {
int val;

if (olen < sizeof(int))
return -EINVAL;

val = *(int *)(table->data) / HZ;
if (put_user(val, (int __user *)oldval))
return -EFAULT;
if (put_user(sizeof(int), oldlenp))
return -EFAULT;
if (olen!=sizeof(int))
return -EINVAL;
}
if (put_user(*(int *)(table->data)/HZ, (int __user *)oldval) ||
(oldlenp && put_user(sizeof(int),oldlenp)))
return -EFAULT;
}
if (newval && newlen) {
int new;
Expand All @@ -2581,17 +2587,23 @@ int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval) {
if (oldval && oldlenp) {
size_t olen;
if (oldlenp) {
if (get_user(olen, oldlenp))

if (get_user(olen, oldlenp))
return -EFAULT;
if (olen) {
int val;

if (olen < sizeof(int))
return -EINVAL;

val = jiffies_to_msecs(*(int *)(table->data));
if (put_user(val, (int __user *)oldval))
return -EFAULT;
if (put_user(sizeof(int), oldlenp))
return -EFAULT;
if (olen!=sizeof(int))
return -EINVAL;
}
if (put_user(jiffies_to_msecs(*(int *)(table->data)), (int __user *)oldval) ||
(oldlenp && put_user(sizeof(int),oldlenp)))
return -EFAULT;
}
if (newval && newlen) {
int new;
Expand Down

0 comments on commit 04f8a01

Please sign in to comment.