Subject: kern/22297: 64-bit problems when counting syscall arguments for sy_narg
To: None <gnats-bugs@gnats.netbsd.org>
From: None <M.Drochner@fz-juelich.de>
List: netbsd-bugs
Date: 07/29/2003 23:17:23
>Number:         22297
>Category:       kern
>Synopsis:       64-bit problems when counting syscall arguments for sy_narg
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 29 21:18:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Drochner
>Release:        NetBSD 1.6U
>Organization:
	KFA Juelich
>Environment:
System: NetBSD zelz26 1.6U NetBSD 1.6U (ZELZ26) #536: Tue Jul 29 19:18:20 MEST 2003 drochner@zelz26:/home/drochner/netbsd/sys/arch/i386/compile/ZELZ26 i386
Architecture: i386
Machine: i386
>Description:
	The script sys/kern/makesyscalls.sh creates a table "init_sysent.c" which
contains the number of arguments to each syscall. It doesn't make a difference
between 32-bit and 64-bit arguments. This number is eg used later by ktrace
to determine the amount of data to log, and always interpreted as register_t
(see kern_ktrace.c:ktrsyscall()). If 64-bit arguments are used by the syscall,
arguments at the end get lost.
>How-To-Repeat:
	ktrace a program which uses lseek() with a non-zero "whence". It will
not show up in the trace.
(Obviously, this applies only to platforms where sizeof(off_t) != sizeof(register_t).)
>Fix:
	Just ideas: Either teach makesyscalls.sh about off_t, this would need
some extra knowledge about type sizes. Or replace it by a C program, which could
use sizeof()... but for cross compilation, this would not work. Also, init_sysent.c
wouldn't be mi anymore... So better do it completely different:-)

>Release-Note:
>Audit-Trail:
>Unformatted: