qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fixes: failed to call mq_open/mq_unlink in qemu-arm
@ 2025-06-05 14:46 Zhang He
  2025-06-06  7:17 ` Laurent Vivier
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang He @ 2025-06-05 14:46 UTC (permalink / raw)
  To: laurent; +Cc: qemu-devel, Zhang He

i write some bare-metal c code need mq_open/mq_unlink syscall, but
the syscall failed in passed name param check, arg1 in this scenario
is the correct address from user-space, arg1 - 1 not.
i have tested in arm cortex-m55 cpu model, maybe should add conditional compile macro?

Signed-off-by: Zhang He <zhanghe9702@163.com>
---
 linux-user/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index fc37028597..be9610176a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -13058,7 +13058,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
                 }
                 pposix_mq_attr = &posix_mq_attr;
             }
-            p = lock_user_string(arg1 - 1);
+            p = lock_user_string(arg1);
             if (!p) {
                 return -TARGET_EFAULT;
             }
@@ -13068,7 +13068,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
         return ret;
 
     case TARGET_NR_mq_unlink:
-        p = lock_user_string(arg1 - 1);
+        p = lock_user_string(arg1);
         if (!p) {
             return -TARGET_EFAULT;
         }
-- 
2.43.0



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

end of thread, other threads:[~2025-06-06  7:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 14:46 [PATCH] Fixes: failed to call mq_open/mq_unlink in qemu-arm Zhang He
2025-06-06  7:17 ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).