Commit f6cc519b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fixes from Thomas Gleixner:
 "Two small fixes:

   - Cure a recently introduces error path hickup which tries to
     unregister a not registered lockdep key in te workqueue code

   - Prevent unaligned cmpxchg() crashes in the robust list handling
     code by sanity checking the user space supplied futex pointer"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  futex: Ensure that futex address is aligned in handle_futex_death()
  workqueue: Only unregister a registered lockdep key
parents e08fef88 5a07168d
...@@ -3436,6 +3436,10 @@ static int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int p ...@@ -3436,6 +3436,10 @@ static int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int p
{ {
u32 uval, uninitialized_var(nval), mval; u32 uval, uninitialized_var(nval), mval;
/* Futex address must be 32bit aligned */
if ((((unsigned long)uaddr) % sizeof(*uaddr)) != 0)
return -1;
retry: retry:
if (get_user(uval, uaddr)) if (get_user(uval, uaddr))
return -1; return -1;
......
...@@ -4266,7 +4266,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, ...@@ -4266,7 +4266,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
INIT_LIST_HEAD(&wq->list); INIT_LIST_HEAD(&wq->list);
if (alloc_and_link_pwqs(wq) < 0) if (alloc_and_link_pwqs(wq) < 0)
goto err_free_wq; goto err_unreg_lockdep;
if (wq_online && init_rescuer(wq) < 0) if (wq_online && init_rescuer(wq) < 0)
goto err_destroy; goto err_destroy;
...@@ -4292,9 +4292,10 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, ...@@ -4292,9 +4292,10 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
return wq; return wq;
err_free_wq: err_unreg_lockdep:
wq_unregister_lockdep(wq); wq_unregister_lockdep(wq);
wq_free_lockdep(wq); wq_free_lockdep(wq);
err_free_wq:
free_workqueue_attrs(wq->unbound_attrs); free_workqueue_attrs(wq->unbound_attrs);
kfree(wq); kfree(wq);
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment