From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:35528 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755549AbdCTRdu (ORCPT ); Mon, 20 Mar 2017 13:33:50 -0400 Subject: Patch "futex: Add missing error handling to FUTEX_REQUEUE_PI" has been added to the 4.10-stable tree To: peterz@infradead.org, dvhart@linux.intel.com, gregkh@linuxfoundation.org, tglx@linutronix.de Cc: , From: Date: Mon, 20 Mar 2017 18:33:23 +0100 Message-ID: <1490031203129120@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled futex: Add missing error handling to FUTEX_REQUEUE_PI to the 4.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: futex-add-missing-error-handling-to-futex_requeue_pi.patch and it can be found in the queue-4.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 9bbb25afeb182502ca4f2c4f3f88af0681b34cae Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Sat, 4 Mar 2017 10:27:19 +0100 Subject: futex: Add missing error handling to FUTEX_REQUEUE_PI From: Peter Zijlstra commit 9bbb25afeb182502ca4f2c4f3f88af0681b34cae upstream. Thomas spotted that fixup_pi_state_owner() can return errors and we fail to unlock the rt_mutex in that case. Reported-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Darren Hart Cc: juri.lelli@arm.com Cc: bigeasy@linutronix.de Cc: xlpang@redhat.com Cc: rostedt@goodmis.org Cc: mathieu.desnoyers@efficios.com Cc: jdesfossez@efficios.com Cc: dvhart@infradead.org Cc: bristot@redhat.com Link: http://lkml.kernel.org/r/20170304093558.867401760@infradead.org Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman --- kernel/futex.c | 2 ++ 1 file changed, 2 insertions(+) --- a/kernel/futex.c +++ b/kernel/futex.c @@ -2896,6 +2896,8 @@ static int futex_wait_requeue_pi(u32 __u if (q.pi_state && (q.pi_state->owner != current)) { spin_lock(q.lock_ptr); ret = fixup_pi_state_owner(uaddr2, &q, current); + if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) + rt_mutex_unlock(&q.pi_state->pi_mutex); /* * Drop the reference to the pi state which * the requeue_pi() code acquired for us. Patches currently in stable-queue which might be from peterz@infradead.org are queue-4.10/futex-fix-potential-use-after-free-in-futex_requeue_pi.patch queue-4.10/futex-add-missing-error-handling-to-futex_requeue_pi.patch queue-4.10/x86-perf-fix-cr4.pce-propagation-to-use-active_mm-instead-of-mm.patch queue-4.10/x86-intel_rdt-put-group-node-in-rdtgroup_kn_unlock.patch queue-4.10/locking-rwsem-fix-down_write_killable-for-config_rwsem_generic_spinlock-y.patch queue-4.10/x86-tsc-fix-art-for-tsc_known_freq.patch