All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for v2.4.1] exec: fix a glitch in checking dma r/w access
@ 2016-01-25 14:29 P J P
  2016-01-25 14:37 ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: P J P @ 2016-01-25 14:29 UTC (permalink / raw)
  To: QEMU Developers
  Cc: Peter Maydell, Paolo Bonzini, Prasad J Pandit, Donghai Zdh

From: Prasad J Pandit <pjp@fedoraproject.org>

While checking r/w access in 'memory_access_is_direct' routine
a glitch in the expression leads to segmentation fault while
performing dma read operation.

Reported-by: Donghai Zdh <donghai.zdh@alibaba-inc.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exec.c b/exec.c
index 0a4a0c5..98d97d3 100644
--- a/exec.c
+++ b/exec.c
@@ -375,7 +375,7 @@ address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *x
 static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write)
 {
     if (memory_region_is_ram(mr)) {
-        return !(is_write && mr->readonly);
+        return (is_write && !mr->readonly);
     }
     if (memory_region_is_romd(mr)) {
         return !is_write;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-27  9:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25 14:29 [Qemu-devel] [PATCH for v2.4.1] exec: fix a glitch in checking dma r/w access P J P
2016-01-25 14:37 ` Paolo Bonzini
2016-01-25 18:19   ` P J P
2016-01-25 22:15     ` Paolo Bonzini
2016-01-27  9:38       ` P J P

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.