sh: fix semtimedop syscall
Subsystems (2)
PATCH 1/1 sh: fix semtimedop syscall
fix the problem that cannot work semtimedop system call.
---
I think that SPARC has the similar bug.
However I cannot confirm it, because I don't have SPARC system.
arch/sh/kernel/sys_sh.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/sh/kernel/sys_sh.c +1 -1
@@ -170,7 +170,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, version = call >>16 ;/* hack for backward compatibility */ call &=0xffff ; -if (call <=SEMCTL ) +if (call <=SEMTIMEDOP )switch (call) {case SEMOP : return sys_semtimedop(first,
Signature · 1 line
1.5.5
Quoted 16 lines · Yoshihiro Shimoda
fix the problem that cannot work semtimedop system call.
Signed-off-by Yoshihiro Shimoda <[email protected]>---
I think that SPARC has the similar bug.
However I cannot confirm it, because I don't have SPARC system.arch/sh/kernel/sys_sh.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/sh/kernel/sys_sh.c +0
-0
arch/sh/kernel/sys_sh.c asmlinkage int sys_ipc(uint call, int first, int second, · line 176
Quoted 8 lines
arch/sh/kernel/sys_sh.c +1
-1@@ -170,7 +170,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, version = call >>16 ;/* hack for backward compatibility */ call &=0xffff ; -if (call <=SEMCTL ) +if (call <=SEMTIMEDOP )switch (call) {case SEMOP : return sys_semtimedop(first,
Good catch! This has been broken for a long time, at least it predates git history. At first glance, sh, sparc, and sparc64 have a sys_semtimedop() reference that will never be invoked, while other platforms (h8300, m68k, and m68knommu) don't implement it at all and simply -ENOSYS (or -EINVAL) out.
Since these nommu platforms haven't supported semtimedop() since its introduction in 2.5.52, they may want to think about hooking it up at some point. Both glibc and uClibc support it today.
sparc64's compat_sys_ipc() does the right thing while the built-in sys_ipc() has the same bug you've noted. So, here are the sparc/sparc64 bits.
---
arch/sparc/kernel/sys_sparc.c | 2 +- arch/sparc64/kernel/sys_sparc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/sparc/kernel/sys_sparc.c +1 -1
@@ -119,7 +119,7 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void __user version = call >>16 ;/* hack for backward compatibility */ call &=0xffff ; -if (call <=SEMCTL ) +if (call <=SEMTIMEDOP )switch (call) {case SEMOP : err =sys_semtimedop (first, (struct sembuf __user *)ptr, second,NULL );
arch/sparc64/kernel/sys_sparc.c +1 -1
@@ -439,7 +439,7 @@ asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,long err;/* No need for backward compatibility. We can start fresh... */ -if (call <=SEMCTL ) { +if (call <=SEMTIMEDOP ) {switch (call) {case SEMOP : err = sys_semtimedop(first, ptr,
Paul Mundt
AppliedQuoted 3 lines · Yoshihiro Shimoda
fix the problem that cannot work semtimedop system call.
Signed-off-by Yoshihiro Shimoda <[email protected]>
Applied, thanks.