From owner-svn-src-all@FreeBSD.ORG Sun May 24 17:38:05 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2ED83C74; Sun, 24 May 2015 17:38:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BFE81CBF; Sun, 24 May 2015 17:38:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OHc4rl025112; Sun, 24 May 2015 17:38:04 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OHc3UK025106; Sun, 24 May 2015 17:38:03 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201505241738.t4OHc3UK025106@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 24 May 2015 17:38:03 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 17:38:05 -0000 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