summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2015-05-24 17:38:02 +0000
committerdchagin <dchagin@FreeBSD.org>2015-05-24 17:38:02 +0000
commit92d496261e1d2fb58bce6b9ebc9086936c90e8aa (patch)
tree923303a13962f7963f7243cd38bef3d0e198cfdf /sys/amd64
parentdf01339e318f5ec0aab5a903310ae5fc3862f645 (diff)
downloadFreeBSD-src-92d496261e1d2fb58bce6b9ebc9086936c90e8aa.zip
FreeBSD-src-92d496261e1d2fb58bce6b9ebc9086936c90e8aa.tar.gz
Call nosys in case when the incorrect syscall number is specified.
Reported by: trinity
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/linux/linux_sysvec.c8
-rw-r--r--sys/amd64/linux/syscalls.master2
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c3
-rw-r--r--sys/amd64/linux32/syscalls.master2
4 files changed, 10 insertions, 5 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
OpenPOWER on IntegriCloud