diff options
author | dchagin <dchagin@FreeBSD.org> | 2015-05-24 17:38:02 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2015-05-24 17:38:02 +0000 |
commit | 92d496261e1d2fb58bce6b9ebc9086936c90e8aa (patch) | |
tree | 923303a13962f7963f7243cd38bef3d0e198cfdf | |
parent | df01339e318f5ec0aab5a903310ae5fc3862f645 (diff) | |
download | FreeBSD-src-92d496261e1d2fb58bce6b9ebc9086936c90e8aa.zip FreeBSD-src-92d496261e1d2fb58bce6b9ebc9086936c90e8aa.tar.gz |
Call nosys in case when the incorrect syscall number is specified.
Reported by: trinity
-rw-r--r-- | sys/amd64/linux/linux_sysvec.c | 8 | ||||
-rw-r--r-- | sys/amd64/linux/syscalls.master | 2 | ||||
-rw-r--r-- | sys/amd64/linux32/linux32_sysvec.c | 3 | ||||
-rw-r--r-- | sys/amd64/linux32/syscalls.master | 2 | ||||
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 3 | ||||
-rw-r--r-- | sys/i386/linux/syscalls.master | 2 |
6 files changed, 14 insertions, 6 deletions
diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 1d4c710..1c19018 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -254,10 +254,10 @@ linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa) sa->args[5] = frame->tf_r9; sa->code = frame->tf_rax; - if (sa->code >= p->p_sysent->sv_size) { - PROC_LOCK(p); - sigexit(td, SIGILL); - } else + if (sa->code >= p->p_sysent->sv_size) + /* nosys */ + sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL]; + else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; diff --git a/sys/amd64/linux/syscalls.master b/sys/amd64/linux/syscalls.master index ff6e1fb..9399cf7 100644 --- a/sys/amd64/linux/syscalls.master +++ b/sys/amd64/linux/syscalls.master @@ -506,3 +506,5 @@ 310 AUE_NULL STD { int linux_process_vm_writev(void); } 311 AUE_NULL STD { int linux_kcmp(void); } 312 AUE_NULL STD { int linux_finit_module(void); } +; please, keep this line at the end. +313 AUE_NULL UNIMPL nosys diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index bf570c7..508fd28 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -764,7 +764,8 @@ linux32_fetch_syscall_args(struct thread *td, struct syscall_args *sa) sa->code = frame->tf_rax; if (sa->code >= p->p_sysent->sv_size) - sa->callp = &p->p_sysent->sv_table[0]; + /* nosys */ + sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL]; else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index 1e418ae..0dd1fb4 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -575,3 +575,5 @@ 346 AUE_NULL STD { int linux_setns(void); } 347 AUE_NULL STD { int linux_process_vm_readv(void); } 348 AUE_NULL STD { int linux_process_vm_writev(void); } +; please, keep this line at the end. +349 AUE_NULL UNIMPL nosys diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index f27fad8..5ee9243 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -890,7 +890,8 @@ linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa) sa->args[5] = frame->tf_ebp; /* Unconfirmed */ if (sa->code >= p->p_sysent->sv_size) - sa->callp = &p->p_sysent->sv_table[0]; + /* nosys */ + sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL]; else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index 6a3b85b..72325f6 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -583,3 +583,5 @@ 346 AUE_NULL STD { int linux_setns(void); } 347 AUE_NULL STD { int linux_process_vm_readv(void); } 348 AUE_NULL STD { int linux_process_vm_writev(void); } +; please, keep this line at the end. +349 AUE_NULL UNIMPL nosys |