From owner-svn-src-head@FreeBSD.ORG Thu May 28 02:30:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 745361065670; Thu, 28 May 2009 02:30:40 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id DDB938FC0C; Thu, 28 May 2009 02:30:39 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 46A44EB539C; Thu, 28 May 2009 05:11:52 +0300 (EEST) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id DC03B450C6; Thu, 28 May 2009 05:11:52 +0300 (EEST) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MkgO5rDZRnrr; Thu, 28 May 2009 05:11:52 +0300 (EEST) Received: from kobe.laptop (adsl226-168.kln.forthnet.gr [79.103.39.168]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 916C54509B; Thu, 28 May 2009 05:11:51 +0300 (EEST) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n4S2BpBi016728; Thu, 28 May 2009 05:11:51 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n4S2BptT016727; Thu, 28 May 2009 05:11:51 +0300 (EEST) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Xin LI References: <200905280038.n4S0cON4017067@svn.freebsd.org> Date: Thu, 28 May 2009 05:11:51 +0300 In-Reply-To: <200905280038.n4S0cON4017067@svn.freebsd.org> (Xin LI's message of "Thu, 28 May 2009 00:38:24 +0000 (UTC)") Message-ID: <87prdu6kns.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r192943 - head/usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2009 02:30:40 -0000 On Thu, 28 May 2009 00:38:24 +0000 (UTC), Xin LI wrote: > Author: delphij > Date: Thu May 28 00:38:24 2009 > New Revision: 192943 > URL: http://svn.freebsd.org/changeset/base/192943 > > Log: > Correct off-by-one issue in truss(1) which happens when system call number > is nsyscalls. > > PR: bin/134916 > Submitted by: Steven Hartland > MFC after: 2 weeks Thank you! I've been running with precisely the same patch locally for some time, but didn't manage to get it tested well enough to commit it :-) The only local diff I have now from /head is a minor change that wraps lines that are at the same time already wrapped *and* too long. If that looks useful as a followup change please feel free to use it: %%% diff -r b88f7e077f9c usr.bin/truss/amd64-fbsd.c --- a/usr.bin/truss/amd64-fbsd.c Thu May 21 02:47:46 2009 +0000 +++ b/usr.bin/truss/amd64-fbsd.c Thu May 28 05:10:58 2009 +0300 @@ -141,8 +141,8 @@ } fsc.number = syscall_num; - fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : + syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff -r b88f7e077f9c usr.bin/truss/amd64-fbsd32.c --- a/usr.bin/truss/amd64-fbsd32.c Thu May 21 02:47:46 2009 +0000 +++ b/usr.bin/truss/amd64-fbsd32.c Thu May 28 05:10:58 2009 +0300 @@ -151,8 +151,7 @@ } fsc.number = syscall_num; - fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : freebsd32_syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); diff -r b88f7e077f9c usr.bin/truss/amd64-linux32.c --- a/usr.bin/truss/amd64-linux32.c Thu May 21 02:47:46 2009 +0000 +++ b/usr.bin/truss/amd64-linux32.c Thu May 28 05:10:58 2009 +0300 @@ -123,8 +123,8 @@ syscall_num = regs.r_rax; fsc.number = syscall_num; - fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : linux32_syscallnames[syscall_num]; + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : + linux32_syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff -r b88f7e077f9c usr.bin/truss/i386-fbsd.c --- a/usr.bin/truss/i386-fbsd.c Thu May 21 02:47:46 2009 +0000 +++ b/usr.bin/truss/i386-fbsd.c Thu May 28 05:10:58 2009 +0300 @@ -146,8 +146,8 @@ } fsc.number = syscall_num; - fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : + syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff -r b88f7e077f9c usr.bin/truss/i386-linux.c --- a/usr.bin/truss/i386-linux.c Thu May 21 02:47:46 2009 +0000 +++ b/usr.bin/truss/i386-linux.c Thu May 28 05:10:58 2009 +0300 @@ -123,8 +123,8 @@ syscall_num = regs.r_eax; fsc.number = syscall_num; - fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : linux_syscallnames[syscall_num]; + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : + linux_syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff -r b88f7e077f9c usr.bin/truss/ia64-fbsd.c --- a/usr.bin/truss/ia64-fbsd.c Thu May 21 02:47:46 2009 +0000 +++ b/usr.bin/truss/ia64-fbsd.c Thu May 28 05:10:58 2009 +0300 @@ -135,8 +135,8 @@ syscall_num = (int)*parm_offset++; fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num > nsyscalls) - ? NULL : syscallnames[syscall_num]; + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : + syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff -r b88f7e077f9c usr.bin/truss/powerpc-fbsd.c --- a/usr.bin/truss/powerpc-fbsd.c Thu May 21 02:47:46 2009 +0000 +++ b/usr.bin/truss/powerpc-fbsd.c Thu May 28 05:10:58 2009 +0300 @@ -148,8 +148,8 @@ } fsc.number = syscall_num; - fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : + syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff -r b88f7e077f9c usr.bin/truss/sparc64-fbsd.c --- a/usr.bin/truss/sparc64-fbsd.c Thu May 21 02:47:46 2009 +0000 +++ b/usr.bin/truss/sparc64-fbsd.c Thu May 28 05:10:58 2009 +0300 @@ -144,8 +144,8 @@ } fsc.number = syscall_num; - fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : + syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } %%%