qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PATCH] linux-user: shmctl() should ignore IPC_64
Date: Tue,  2 Jun 2009 00:32:37 +0200	[thread overview]
Message-ID: <1243895557-18462-1-git-send-email-laurent@vivier.eu> (raw)

This has been detected trying to use "dbench" with m68k-linux-user/qemu-m68k where
"shmctl()" is called with "IPC_RMID | IPC_64".

IPC_64 is useless with IPC_RMID, SHM_LOCK, SHM_UNLOCK
(as the only parameter is the id without shmid_ds) and
already ignored with semctl() and msgctl().

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b1bba48..c3d1d73 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2539,11 +2539,11 @@ static abi_long do_ipc(unsigned int call, int first,
 
 	/* IPC_* and SHM_* command values are the same on all linux platforms */
     case IPCOP_shmctl:
-        switch(second) {
+        switch(second & 0xff) {
         case IPC_RMID:
         case SHM_LOCK:
         case SHM_UNLOCK:
-            ret = get_errno(shmctl(first, second, NULL));
+            ret = get_errno(shmctl(first, second & 0xff, NULL));
             break;
         default:
             goto unimplemented;
-- 
1.5.6.5

             reply	other threads:[~2009-06-01 22:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-01 22:32 Laurent Vivier [this message]
2009-06-10 21:41 ` [Qemu-devel] [PATCH] linux-user: shmctl() should ignore IPC_64 Riku Voipio
2009-06-10 22:18   ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1243895557-18462-1-git-send-email-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).