Date: Thu, 28 May 2009 00:38:24 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r192943 - head/usr.bin/truss Message-ID: <200905280038.n4S0cON4017067@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <steven hartland multiplay co uk> MFC after: 2 weeks Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/ia64-fbsd.c head/usr.bin/truss/mips-fbsd.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/sparc64-fbsd.c Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Thu May 28 00:18:11 2009 (r192942) +++ head/usr.bin/truss/amd64-fbsd.c Thu May 28 00:38:24 2009 (r192943) @@ -142,7 +142,7 @@ amd64_syscall_entry(struct trussinfo *tr fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Thu May 28 00:18:11 2009 (r192942) +++ head/usr.bin/truss/amd64-fbsd32.c Thu May 28 00:38:24 2009 (r192943) @@ -152,7 +152,7 @@ amd64_fbsd32_syscall_entry(struct trussi fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : freebsd32_syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Thu May 28 00:18:11 2009 (r192942) +++ head/usr.bin/truss/amd64-linux32.c Thu May 28 00:38:24 2009 (r192943) @@ -124,7 +124,7 @@ amd64_linux32_syscall_entry(struct truss fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : linux32_syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : linux32_syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } Modified: head/usr.bin/truss/i386-fbsd.c ============================================================================== --- head/usr.bin/truss/i386-fbsd.c Thu May 28 00:18:11 2009 (r192942) +++ head/usr.bin/truss/i386-fbsd.c Thu May 28 00:38:24 2009 (r192943) @@ -147,7 +147,7 @@ i386_syscall_entry(struct trussinfo *tru fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } Modified: head/usr.bin/truss/i386-linux.c ============================================================================== --- head/usr.bin/truss/i386-linux.c Thu May 28 00:18:11 2009 (r192942) +++ head/usr.bin/truss/i386-linux.c Thu May 28 00:38:24 2009 (r192943) @@ -124,7 +124,7 @@ i386_linux_syscall_entry(struct trussinf fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : linux_syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : linux_syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } Modified: head/usr.bin/truss/ia64-fbsd.c ============================================================================== --- head/usr.bin/truss/ia64-fbsd.c Thu May 28 00:18:11 2009 (r192942) +++ head/usr.bin/truss/ia64-fbsd.c Thu May 28 00:38:24 2009 (r192943) @@ -135,7 +135,7 @@ ia64_syscall_entry(struct trussinfo *tru syscall_num = (int)*parm_offset++; fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num > nsyscalls) + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); Modified: head/usr.bin/truss/mips-fbsd.c ============================================================================== --- head/usr.bin/truss/mips-fbsd.c Thu May 28 00:18:11 2009 (r192942) +++ head/usr.bin/truss/mips-fbsd.c Thu May 28 00:38:24 2009 (r192943) @@ -139,7 +139,7 @@ mips_syscall_entry(struct trussinfo *tru fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Thu May 28 00:18:11 2009 (r192942) +++ head/usr.bin/truss/powerpc-fbsd.c Thu May 28 00:38:24 2009 (r192943) @@ -149,7 +149,7 @@ powerpc_syscall_entry(struct trussinfo * fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } Modified: head/usr.bin/truss/sparc64-fbsd.c ============================================================================== --- head/usr.bin/truss/sparc64-fbsd.c Thu May 28 00:18:11 2009 (r192942) +++ head/usr.bin/truss/sparc64-fbsd.c Thu May 28 00:38:24 2009 (r192943) @@ -145,7 +145,7 @@ sparc64_syscall_entry(struct trussinfo * fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905280038.n4S0cON4017067>