qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: shmctl() should ignore IPC_64
@ 2009-06-01 22:32 Laurent Vivier
  2009-06-10 21:41 ` Riku Voipio
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2009-06-01 22:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

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

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

* Re: [Qemu-devel] [PATCH] linux-user: shmctl() should ignore IPC_64
  2009-06-01 22:32 [Qemu-devel] [PATCH] linux-user: shmctl() should ignore IPC_64 Laurent Vivier
@ 2009-06-10 21:41 ` Riku Voipio
  2009-06-10 22:18   ` Laurent Vivier
  0 siblings, 1 reply; 3+ messages in thread
From: Riku Voipio @ 2009-06-10 21:41 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: qemu-devel

On Tue, Jun 02, 2009 at 12:32:37AM +0200, Laurent Vivier wrote:
> 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) {

This appears to be also taken care in this old patch
where shmctl was moved to do_shmctl()

https://git.maemo.org/projects/qemu/gitweb?p=qemu;a=commitdiff;h=d1f365ccd0615c57d2869d33fb5e0637b3623b64

>          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
> 
> 

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

* Re: [Qemu-devel] [PATCH] linux-user: shmctl() should ignore IPC_64
  2009-06-10 21:41 ` Riku Voipio
@ 2009-06-10 22:18   ` Laurent Vivier
  0 siblings, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2009-06-10 22:18 UTC (permalink / raw)
  To: Riku Voipio; +Cc: qemu-devel

Le jeudi 11 juin 2009 à 00:41 +0300, Riku Voipio a écrit :
> On Tue, Jun 02, 2009 at 12:32:37AM +0200, Laurent Vivier wrote:
> > 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) {
> 
> This appears to be also taken care in this old patch
> where shmctl was moved to do_shmctl()
> 
> https://git.maemo.org/projects/qemu/gitweb?p=qemu;a=commitdiff;h=d1f365ccd0615c57d2869d33fb5e0637b3623b64

Why it is not in qemu original git tree ?

> 
> >          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;
> > -- 

If no patch to solve this is applied soon, I will resend mine... :-P

Regards,
Laurent
-- 
--------------------- laurent@vivier.eu ----------------------
"Tout ce qui est impossible reste à accomplir"    Jules Verne
"Things are only impossible until they're not" Jean-Luc Picard

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

end of thread, other threads:[~2009-06-10 22:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-01 22:32 [Qemu-devel] [PATCH] linux-user: shmctl() should ignore IPC_64 Laurent Vivier
2009-06-10 21:41 ` Riku Voipio
2009-06-10 22:18   ` 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).