Date: Thu, 1 Sep 2016 07:08:01 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305180 - stable/11/sys/kern Message-ID: <201609010708.u81781Rc036736@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Thu Sep 1 07:08:01 2016 New Revision: 305180 URL: https://svnweb.freebsd.org/changeset/base/305180 Log: MFC r304808: Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks. PR: 211947 Modified: stable/11/sys/kern/kern_umtx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_umtx.c ============================================================================== --- stable/11/sys/kern/kern_umtx.c Thu Sep 1 07:04:47 2016 (r305179) +++ stable/11/sys/kern/kern_umtx.c Thu Sep 1 07:08:01 2016 (r305180) @@ -2743,9 +2743,12 @@ sleep: suword32(&rwlock->rw_blocked_readers, blocked_readers-1); if (blocked_readers == 1) { rv = fueword32(&rwlock->rw_state, &state); - if (rv == -1) + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); error = EFAULT; - while (error == 0) { + break; + } + for (;;) { rv = casueword32(&rwlock->rw_state, state, &oldstate, state & ~URWLOCK_READ_WAITERS); if (rv == -1) { @@ -2756,6 +2759,8 @@ sleep: break; state = oldstate; error = umtxq_check_susp(td); + if (error != 0) + break; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609010708.u81781Rc036736>