lkml.org 
[lkml]   [2006]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[2.6 patch] x86_64: don't printk for unimplemented 32bit syscalls
On Sun, May 21, 2006 at 03:47:04PM -0400, Dave Jones wrote:
> On Sun, May 21, 2006 at 09:38:18PM +0200, Adrian Bunk wrote:
> > On Sun, May 21, 2006 at 02:56:10PM -0400, Dave Jones wrote:
> > >
> > > Actually it is kinda throttled, but only on process name.
> > > This patch just removes that stuff completely.
> > > (Also removes a bunch of trailing whitespace)
> > >
> > > Signed-off-by: Dave Jones <davej@redhat.com>
> > >
> > > --- linux-2.6.16.noarch/arch/x86_64/ia32/sys_ia32.c~ 2006-05-21 14:50:57.000000000 -0400
> > > +++ linux-2.6.16.noarch/arch/x86_64/ia32/sys_ia32.c 2006-05-21 14:51:48.000000000 -0400
> > > @@ -522,17 +522,9 @@ sys32_waitpid(compat_pid_t pid, unsigned
> > > }
> > >
> > > int sys32_ni_syscall(int call)
> > > -{
> > > - struct task_struct *me = current;
> > > - static char lastcomm[sizeof(me->comm)];
> > > -
> > > - if (strncmp(lastcomm, me->comm, sizeof(lastcomm))) {
> > > - printk(KERN_INFO "IA32 syscall %d from %s not implemented\n",
> > > - call, me->comm);
> > > - strncpy(lastcomm, me->comm, sizeof(lastcomm));
> > > - }
> > > - return -ENOSYS;
> > > -}
> > > +{
> > > + return -ENOSYS;
> > > +}
> > >...
> >
> > Why can't we remove sys32_ni_syscall() and call sys_ni_syscall()
> > instead if all we want to do is to return -ENOSYS?
>
> We could, though it's a more invasive patch, which would probably sprinkle
> extra includes/externs over multiple files, for no practical gain
> over having this tiny function isolated to this file.

Where exactly is the problem with the patch below (only compile tested
due to lack of hardware)?

> Dave

cu
Adrian


<-- snip -->


Don't let users spam the logs by using unimplemented 32bit syscalls.

Simply use sys_ni_syscall().

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

arch/x86_64/ia32/ia32entry.S | 2 +-
arch/x86_64/ia32/sys_ia32.c | 13 -------------
2 files changed, 1 insertion(+), 14 deletions(-)

--- linux-git-x86_64/arch/x86_64/ia32/sys_ia32.c.old 2006-05-22 02:10:15.000000000 +0200
+++ linux-git-x86_64/arch/x86_64/ia32/sys_ia32.c 2006-05-22 02:10:24.000000000 +0200
@@ -508,19 +508,6 @@
return compat_sys_wait4(pid, stat_addr, options, NULL);
}

-int sys32_ni_syscall(int call)
-{
- struct task_struct *me = current;
- static char lastcomm[sizeof(me->comm)];
-
- if (strncmp(lastcomm, me->comm, sizeof(lastcomm))) {
- printk(KERN_INFO "IA32 syscall %d from %s not implemented\n",
- call, me->comm);
- strncpy(lastcomm, me->comm, sizeof(lastcomm));
- }
- return -ENOSYS;
-}
-
/* 32-bit timeval and related flotsam. */

asmlinkage long
--- linux-git-x86_64/arch/x86_64/ia32/ia32entry.S.old 2006-05-22 02:10:56.000000000 +0200
+++ linux-git-x86_64/arch/x86_64/ia32/ia32entry.S 2006-05-22 02:11:10.000000000 +0200
@@ -322,7 +322,7 @@

ni_syscall:
movq %rax,%rdi
- jmp sys32_ni_syscall
+ jmp sys_ni_syscall

quiet_ni_syscall:
movq $-ENOSYS,%rax
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-05-22 02:19    [W:0.625 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site