]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
exec: Add missing rcu_read_unlock
authorRoman Kapl <rka@sysgo.com>
Mon, 9 Jan 2017 11:09:21 +0000 (12:09 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 16 Mar 2017 17:10:39 +0000 (12:10 -0500)
rcu_read_unlock was not called if the address_space_access_valid result is
negative.

This caused (at least) a problem when qemu on PPC/E500+TAP failed to terminate
properly and instead got stuck in a deadlock.

Signed-off-by: Roman Kapl <rka@sysgo.com>
Message-Id: <20170109110921.4931-1-rka@sysgo.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 5ad4a2b75f85dd854a781a6e03b90320cb3441d3)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
exec.c

diff --git a/exec.c b/exec.c
index 08c558eecf1502bfd6847ca59a3f48f32a395013..6fda4553fa8604fd7c4f9c919409f340f80c4929 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -2927,6 +2927,7 @@ bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_
         if (!memory_access_is_direct(mr, is_write)) {
             l = memory_access_size(mr, l, addr);
             if (!memory_region_access_valid(mr, xlat, l, is_write)) {
+                rcu_read_unlock();
                 return false;
             }
         }