NetBSD Problem Report #45781

From www@NetBSD.org  Thu Jan  5 02:17:22 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 3E9DF63D7B9
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  5 Jan 2012 02:17:22 +0000 (UTC)
Message-Id: <20120105021721.304B763BC35@www.NetBSD.org>
Date: Thu,  5 Jan 2012 02:17:21 +0000 (UTC)
From: jmcneill@invisible.ca
Reply-To: jmcneill@invisible.ca
To: gnats-bugs@NetBSD.org
Subject: syscall_establish can't add a new syscall
X-Send-Pr-Version: www-1.0

>Number:         45781
>Category:       kern
>Synopsis:       syscall_establish can't add a new syscall
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    pgoyette
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 05 02:20:00 +0000 2012
>Closed-Date:    Wed Sep 05 12:07:51 +0000 2018
>Last-Modified:  Wed Jan 09 18:35:00 +0000 2019
>Originator:     Jared D. McNeill
>Release:        5.99.59
>Organization:
>Environment:
NetBSD nbhead 5.99.59 NetBSD 5.99.59 (GENERIC) #12: Wed Dec 28 06:24:11 EST 2011  jmcneill@nbhead:/home/jmcneill/branches/HEAD/src/sys/arch/i386/compile/obj/GENERIC i386
>Description:
syscall_establish doesn't work for allocating a new sys call, it fails and prints "syscall <n> is busy". How are you supposed to register new syscalls?
>How-To-Repeat:
static const struct syscall_package my_syscalls[] = {
    { 511, 0, (sy_call_t *)sys_mysyscall },
    { 0, 0, NULL },
};

error = syscall_establish(NULL, syscallemu_syscalls);
if (error)
    printf("couldn't establish syscall\n");


>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->pgoyette
Responsible-Changed-By: pgoyette@NetBSD.org
Responsible-Changed-When: Fri, 10 Aug 2018 22:48:13 +0000
Responsible-Changed-Why:
iI'm handling it.


State-Changed-From-To: open->feedback
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Fri, 10 Aug 2018 22:48:13 +0000
State-Changed-Why:
Fix committed - please verify!


State-Changed-From-To: feedback->closed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Wed, 05 Sep 2018 12:07:51 +0000
State-Changed-Why:
Bug is fixed.


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/45781: syscall_establish can't add a new syscall
Date: Wed, 9 Jan 2019 18:34:18 +0000

 Not sent to gnats (address needs to be gnats-bugs, didn't have the
 PR number in the subject)

    ------

 From: Paul Goyette <paul@whooppee.com>
 To: gnats@netbsd.org
 Subject: Re: CVS commit: src/sys (fwd)
 Date: Sat, 11 Aug 2018 06:49:38 +0800 (+08)


 > On Aug 10, 2018, at 2:45 PM, Paul Goyette <pgoyette@netbsd.org> wrote:
 > 
 > Module Name:	src
 > Committed By:	pgoyette
 > Date:		Fri Aug 10 21:45:00 UTC 2018
 > 
 > Modified Files:
 > 	src/sys/arch/i386/i386: linux_syscall.c
 > 	src/sys/compat/aoutm68k: aoutm68k_exec.c
 > 	src/sys/compat/freebsd: freebsd_exec.c
 > 	src/sys/compat/ibcs2: ibcs2_exec.c
 > 	src/sys/compat/linux/common: linux_exec.c
 > 	src/sys/compat/linux32/common: linux32_exec.c
 > 	src/sys/compat/netbsd32: netbsd32_netbsd.c
 > 	src/sys/compat/osf1: osf1_exec.c
 > 	src/sys/compat/sunos: sunos_exec.c
 > 	src/sys/compat/sunos32: sunos32_exec.c
 > 	src/sys/compat/svr4: svr4_exec.c
 > 	src/sys/compat/svr4_32: svr4_32_exec.c
 > 	src/sys/compat/ultrix: ultrix_misc.c
 > 	src/sys/kern: kern_exec.c kern_syscall.c makesyscalls.sh
 > 	src/sys/rump/include/rump-sys: kern.h
 > 	src/sys/rump/kern/lib/libsys_cygwin: sys_cygwin_component.c
 > 	src/sys/rump/kern/lib/libsys_linux: sys_linux_component.c
 > 	src/sys/rump/kern/lib/libsys_sunos: sys_sunos_component.c
 > 	src/sys/rump/librump/rumpkern: emul.c
 > 	src/sys/sys: proc.h systm.h
 > 
 > Log Message:
 > /home/paul/X_nomodbits.commit

 Corrected log message:
 Allow syscall_establish() to install new syscalls when the existing
 entry-point is either sys_nomodule or sys_nosys.  Update the
 makesyscalls.sh script to create a const array of bits to allow
 syscall_disestablish() to properly restore the original entry-point.
 Update all the initializers of struct emul to initialize the pointer
 to the bit array struct emul.

 XXX Regen of all files created by makesyscalls.sh will come soon,
 XXX followed by a kernel version bump (since struct emul is being
 XXX modified).

 This commit should address PR kern/45781 and also removes the need
 for the work-around for that PR in file

 	sys/arch/usermode/modules/syscallemu/syscallemu.c

 > To generate a diff of this commit:
 > cvs rdiff -u -r1.53 -r1.54 src/sys/arch/i386/i386/linux_syscall.c
 > cvs rdiff -u -r1.29 -r1.30 src/sys/compat/aoutm68k/aoutm68k_exec.c
 > cvs rdiff -u -r1.41 -r1.42 src/sys/compat/freebsd/freebsd_exec.c
 > cvs rdiff -u -r1.78 -r1.79 src/sys/compat/ibcs2/ibcs2_exec.c
 > cvs rdiff -u -r1.119 -r1.120 src/sys/compat/linux/common/linux_exec.c
 > cvs rdiff -u -r1.23 -r1.24 src/sys/compat/linux32/common/linux32_exec.c
 > cvs rdiff -u -r1.217 -r1.218 src/sys/compat/netbsd32/netbsd32_netbsd.c
 > cvs rdiff -u -r1.46 -r1.47 src/sys/compat/osf1/osf1_exec.c
 > cvs rdiff -u -r1.56 -r1.57 src/sys/compat/sunos/sunos_exec.c
 > cvs rdiff -u -r1.35 -r1.36 src/sys/compat/sunos32/sunos32_exec.c
 > cvs rdiff -u -r1.68 -r1.69 src/sys/compat/svr4/svr4_exec.c
 > cvs rdiff -u -r1.29 -r1.30 src/sys/compat/svr4_32/svr4_32_exec.c
 > cvs rdiff -u -r1.124 -r1.125 src/sys/compat/ultrix/ultrix_misc.c
 > cvs rdiff -u -r1.459 -r1.460 src/sys/kern/kern_exec.c
 > cvs rdiff -u -r1.16 -r1.17 src/sys/kern/kern_syscall.c
 > cvs rdiff -u -r1.169 -r1.170 src/sys/kern/makesyscalls.sh
 > cvs rdiff -u -r1.3 -r1.4 src/sys/rump/include/rump-sys/kern.h
 > cvs rdiff -u -r1.2 -r1.3 \
 >    src/sys/rump/kern/lib/libsys_cygwin/sys_cygwin_component.c
 > cvs rdiff -u -r1.3 -r1.4 \
 >    src/sys/rump/kern/lib/libsys_linux/sys_linux_component.c
 > cvs rdiff -u -r1.2 -r1.3 \
 >    src/sys/rump/kern/lib/libsys_sunos/sys_sunos_component.c
 > cvs rdiff -u -r1.185 -r1.186 src/sys/rump/librump/rumpkern/emul.c
 > cvs rdiff -u -r1.348 -r1.349 src/sys/sys/proc.h
 > cvs rdiff -u -r1.276 -r1.277 src/sys/sys/systm.h
 > 
 > Please note that diffs are not public domain; they are subject to the
 > copyright notices on the relevant files.
 > 

 -- thorpej

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.