linux-user: shmctl() should ignore IPC_64
PATCH 1/1 linux-user: shmctl() should ignore IPC_64
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().
--- linux-user/syscall.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
linux-user/syscall.c +2 -2
@@ -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;
Signature · 1 line
1.5.6.5
Quoted 17 lines · 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_64is useless withIPC_RMID,SHM_LOCK,SHM_UNLOCK(as the only parameter is the id withoutshmid_ds) and already ignored withsemctl()andmsgctl().Signed-off-by Laurent Vivier <[email protected]>--- linux-user/syscall.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)linux-user/syscall.c +0
-0
linux-user/syscall.c static abi_long do_ipc(unsigned int call, int first, · line 2542
Quoted 5 lines
linux-user/syscall.c +1
-1@@ -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()
Quoted 12 lines
linux-user/syscall.c +1
-1case 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;Signature · 1 line
1.5.6.5
Quoted 27 lines · Riku Voipio
Quoted 17 lines · 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_64is useless withIPC_RMID,SHM_LOCK,SHM_UNLOCK(as the only parameter is the id withoutshmid_ds) and already ignored withsemctl()andmsgctl().Signed-off-by Laurent Vivier <[email protected]>--- linux-user/syscall.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)linux-user/syscall.c +0
-0linux-user/syscall.c static abi_long do_ipc(unsigned int call, int first, · line 2542
Quoted 5 lines
linux-user/syscall.c +1
-1@@ -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()
Quoted 1 line
Why it is not in qemu original git tree ?
Quoted 10 lines
linux-user/syscall.c static abi_long do_ipc(unsigned int call, int first, · line 2549
Quoted 10 lines
linux-user/syscall.c +1
-1case 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
Signature · 3 lines
--------------------- [email protected] ---------------------- "Tout ce qui est impossible reste à accomplir" Jules Verne "Things are only impossible until they're not" Jean-Luc Picard