From owner-cvs-src-old@FreeBSD.ORG Sat Jan 23 11:46:02 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FDEF106568F for ; Sat, 23 Jan 2010 11:46:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1BFBF8FC1D for ; Sat, 23 Jan 2010 11:46:02 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o0NBk1OV038662 for ; Sat, 23 Jan 2010 11:46:01 GMT (envelope-from kib@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o0NBk1e2038661 for cvs-src-old@freebsd.org; Sat, 23 Jan 2010 11:46:01 GMT (envelope-from kib@repoman.freebsd.org) Message-Id: <201001231146.o0NBk1e2038661@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to kib@repoman.freebsd.org using -f From: Konstantin Belousov Date: Sat, 23 Jan 2010 11:45:35 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/amd64/amd64 trap.c src/sys/amd64/ia32 ia32_syscall.c src/sys/i386/i386 trap.c src/sys/kern sys_process.c src/sys/sys proc.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 11:46:02 -0000 kib 2010-01-23 11:45:35 UTC FreeBSD src repository Modified files: sys/amd64/amd64 trap.c sys/amd64/ia32 ia32_syscall.c sys/i386/i386 trap.c sys/kern sys_process.c sys/sys proc.h Log: SVN rev 202882 on 2010-01-23 11:45:35Z by kib For PT_TO_SCE stop that stops the ptraced process upon syscall entry, syscall arguments are collected before ptracestop() is called. As a consequence, debugger cannot modify syscall or its arguments. For i386, amd64 and ia32 on amd64 MD syscall(), reread syscall number and arguments after ptracestop(), if debugger modified anything in the process environment. Since procfs stopeven requires number of syscall arguments in p_xstat, this cannot be solved by moving stop/trace point before argument fetching. Move the code to read arguments into separate function fetch_syscall_args() to avoid code duplication. Note that ktrace point for modified syscall is intentionally recorded twice, once with original arguments, and second time with the arguments set by debugger. PT_TO_SCX stop is executed after cpu_syscall_set_retval() already. Reported by: Ali Polatel Briefly discussed with: jhb MFC after: 3 weeks Revision Changes Path 1.339 +107 -69 src/sys/amd64/amd64/trap.c 1.21 +93 -56 src/sys/amd64/ia32/ia32_syscall.c 1.326 +100 -65 src/sys/i386/i386/trap.c 1.159 +5 -0 src/sys/kern/sys_process.c 1.544 +1 -0 src/sys/sys/proc.h