Skip to content

Commit f6cc519

Browse files
committed
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
2 parents e08fef8 + 5a07168 commit f6cc519

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

kernel/futex.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3436,6 +3436,10 @@ static int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int p
34363436
{
34373437
u32 uval, uninitialized_var(nval), mval;
34383438

3439+
/* Futex address must be 32bit aligned */
3440+
if ((((unsigned long)uaddr) % sizeof(*uaddr)) != 0)
3441+
return -1;
3442+
34393443
retry:
34403444
if (get_user(uval, uaddr))
34413445
return -1;

kernel/workqueue.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4266,7 +4266,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
42664266
INIT_LIST_HEAD(&wq->list);
42674267

42684268
if (alloc_and_link_pwqs(wq) < 0)
4269-
goto err_free_wq;
4269+
goto err_unreg_lockdep;
42704270

42714271
if (wq_online && init_rescuer(wq) < 0)
42724272
goto err_destroy;
@@ -4292,9 +4292,10 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
42924292

42934293
return wq;
42944294

4295-
err_free_wq:
4295+
err_unreg_lockdep:
42964296
wq_unregister_lockdep(wq);
42974297
wq_free_lockdep(wq);
4298+
err_free_wq:
42984299
free_workqueue_attrs(wq->unbound_attrs);
42994300
kfree(wq);
43004301
return NULL;

0 commit comments

Comments
 (0)