diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/futex.c | 6 | ||||
-rw-r--r-- | kernel/params.c | 2 | ||||
-rw-r--r-- | kernel/sysctl.c | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 5872e3507f35..5e71a6bf6f6b 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -270,7 +270,13 @@ static void wake_futex(struct futex_q *q) | |||
270 | /* | 270 | /* |
271 | * The waiting task can free the futex_q as soon as this is written, | 271 | * The waiting task can free the futex_q as soon as this is written, |
272 | * without taking any locks. This must come last. | 272 | * without taking any locks. This must come last. |
273 | * | ||
274 | * A memory barrier is required here to prevent the following store | ||
275 | * to lock_ptr from getting ahead of the wakeup. Clearing the lock | ||
276 | * at the end of wake_up_all() does not prevent this store from | ||
277 | * moving. | ||
273 | */ | 278 | */ |
279 | wmb(); | ||
274 | q->lock_ptr = NULL; | 280 | q->lock_ptr = NULL; |
275 | } | 281 | } |
276 | 282 | ||
diff --git a/kernel/params.c b/kernel/params.c index 47ba69547945..c76ad25e6a21 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -619,7 +619,7 @@ static void __init param_sysfs_builtin(void) | |||
619 | 619 | ||
620 | 620 | ||
621 | /* module-related sysfs stuff */ | 621 | /* module-related sysfs stuff */ |
622 | #ifdef CONFIG_MODULES | 622 | #ifdef CONFIG_SYSFS |
623 | 623 | ||
624 | #define to_module_attr(n) container_of(n, struct module_attribute, attr); | 624 | #define to_module_attr(n) container_of(n, struct module_attribute, attr); |
625 | #define to_module_kobject(n) container_of(n, struct module_kobject, kobj); | 625 | #define to_module_kobject(n) container_of(n, struct module_kobject, kobj); |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 9990e10192e8..e5102ea6e104 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -2201,14 +2201,12 @@ int sysctl_string(ctl_table *table, int __user *name, int nlen, | |||
2201 | if (get_user(len, oldlenp)) | 2201 | if (get_user(len, oldlenp)) |
2202 | return -EFAULT; | 2202 | return -EFAULT; |
2203 | if (len) { | 2203 | if (len) { |
2204 | l = strlen(table->data); | 2204 | l = strlen(table->data)+1; |
2205 | if (len > l) len = l; | 2205 | if (len > l) len = l; |
2206 | if (len >= table->maxlen) | 2206 | if (len >= table->maxlen) |
2207 | len = table->maxlen; | 2207 | len = table->maxlen; |
2208 | if(copy_to_user(oldval, table->data, len)) | 2208 | if(copy_to_user(oldval, table->data, len)) |
2209 | return -EFAULT; | 2209 | return -EFAULT; |
2210 | if(put_user(0, ((char __user *) oldval) + len)) | ||
2211 | return -EFAULT; | ||
2212 | if(put_user(len, oldlenp)) | 2210 | if(put_user(len, oldlenp)) |
2213 | return -EFAULT; | 2211 | return -EFAULT; |
2214 | } | 2212 | } |
@@ -2223,7 +2221,7 @@ int sysctl_string(ctl_table *table, int __user *name, int nlen, | |||
2223 | len--; | 2221 | len--; |
2224 | ((char *) table->data)[len] = 0; | 2222 | ((char *) table->data)[len] = 0; |
2225 | } | 2223 | } |
2226 | return 0; | 2224 | return 1; |
2227 | } | 2225 | } |
2228 | 2226 | ||
2229 | /* | 2227 | /* |