Skip to contentSkip to conversation

exec: Add missing rcu_read_unlock

PATCH In review Roman Kapl 2 participants 2 messages Jan 9, 2017

lore
Share & tools
lore

Roman Kapl

author
#0 lore raw

PATCH 1/1 exec: Add missing rcu_read_unlock

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.

---
 exec.c | 1 +
 1 file changed, 1 insertion(+)
exec.c +1 -0
index 8d4bb0e..6895db5 100644
@@ -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;
             }
         }
Signature · 1 line
2.10.1
#1 lore raw
Quoted 17 lines · Roman Kapl

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.

---
 exec.c | 1 +
 1 file changed, 1 insertion(+)
exec.c +0 -0
index 8d4bb0e..6895db5 100644

exec.c bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_ · line 2933

Quoted 7 lines
exec.c +1 -0
@@ -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;
             }
         }

Thanks, queued!

Cc qemu-stable <[email protected]>

Paolo