Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2015 17:38:03 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r283467 - in head/sys: amd64/linux amd64/linux32 i386/linux
Message-ID:  <201505241738.t4OHc3UK025106@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sun May 24 17:38:02 2015
New Revision: 283467
URL: https://svnweb.freebsd.org/changeset/base/283467

Log:
  Call nosys in case when the incorrect syscall number is specified.
  
  Reported by:	trinity

Modified:
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux/syscalls.master
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/amd64/linux32/syscalls.master
  head/sys/i386/linux/linux_sysvec.c
  head/sys/i386/linux/syscalls.master

Modified: head/sys/amd64/linux/linux_sysvec.c
==============================================================================
--- head/sys/amd64/linux/linux_sysvec.c	Sun May 24 17:35:42 2015	(r283466)
+++ head/sys/amd64/linux/linux_sysvec.c	Sun May 24 17:38:02 2015	(r283467)
@@ -254,10 +254,10 @@ linux_fetch_syscall_args(struct thread *
 	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;
 

Modified: head/sys/amd64/linux/syscalls.master
==============================================================================
--- head/sys/amd64/linux/syscalls.master	Sun May 24 17:35:42 2015	(r283466)
+++ head/sys/amd64/linux/syscalls.master	Sun May 24 17:38:02 2015	(r283467)
@@ -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

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c	Sun May 24 17:35:42 2015	(r283466)
+++ head/sys/amd64/linux32/linux32_sysvec.c	Sun May 24 17:38:02 2015	(r283467)
@@ -764,7 +764,8 @@ linux32_fetch_syscall_args(struct thread
 	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;

Modified: head/sys/amd64/linux32/syscalls.master
==============================================================================
--- head/sys/amd64/linux32/syscalls.master	Sun May 24 17:35:42 2015	(r283466)
+++ head/sys/amd64/linux32/syscalls.master	Sun May 24 17:38:02 2015	(r283467)
@@ -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

Modified: head/sys/i386/linux/linux_sysvec.c
==============================================================================
--- head/sys/i386/linux/linux_sysvec.c	Sun May 24 17:35:42 2015	(r283466)
+++ head/sys/i386/linux/linux_sysvec.c	Sun May 24 17:38:02 2015	(r283467)
@@ -890,7 +890,8 @@ linux_fetch_syscall_args(struct thread *
 	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;

Modified: head/sys/i386/linux/syscalls.master
==============================================================================
--- head/sys/i386/linux/syscalls.master	Sun May 24 17:35:42 2015	(r283466)
+++ head/sys/i386/linux/syscalls.master	Sun May 24 17:38:02 2015	(r283467)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505241738.t4OHc3UK025106>