svn commit: r193965 - stable/7/usr.bin/truss

Xin LI delphij at FreeBSD.org
Thu Jun 11 00:42:55 UTC 2009


Author: delphij
Date: Thu Jun 11 00:42:53 2009
New Revision: 193965
URL: http://svn.freebsd.org/changeset/base/193965

Log:
  MFC r192943: Correct off-by-one issue in truss(1) which happens when system
  call number is nsyscalls.  (mips bits intentionally left off since it's not
  in 7-stable yet)

Modified:
  stable/7/usr.bin/truss/   (props changed)
  stable/7/usr.bin/truss/amd64-fbsd.c
  stable/7/usr.bin/truss/amd64-fbsd32.c
  stable/7/usr.bin/truss/amd64-linux32.c
  stable/7/usr.bin/truss/i386-fbsd.c
  stable/7/usr.bin/truss/i386-linux.c
  stable/7/usr.bin/truss/ia64-fbsd.c
  stable/7/usr.bin/truss/powerpc-fbsd.c
  stable/7/usr.bin/truss/sparc64-fbsd.c

Modified: stable/7/usr.bin/truss/amd64-fbsd.c
==============================================================================
--- stable/7/usr.bin/truss/amd64-fbsd.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/amd64-fbsd.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -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: stable/7/usr.bin/truss/amd64-fbsd32.c
==============================================================================
--- stable/7/usr.bin/truss/amd64-fbsd32.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/amd64-fbsd32.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -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: stable/7/usr.bin/truss/amd64-linux32.c
==============================================================================
--- stable/7/usr.bin/truss/amd64-linux32.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/amd64-linux32.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -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: stable/7/usr.bin/truss/i386-fbsd.c
==============================================================================
--- stable/7/usr.bin/truss/i386-fbsd.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/i386-fbsd.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -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: stable/7/usr.bin/truss/i386-linux.c
==============================================================================
--- stable/7/usr.bin/truss/i386-linux.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/i386-linux.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -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: stable/7/usr.bin/truss/ia64-fbsd.c
==============================================================================
--- stable/7/usr.bin/truss/ia64-fbsd.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/ia64-fbsd.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -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: stable/7/usr.bin/truss/powerpc-fbsd.c
==============================================================================
--- stable/7/usr.bin/truss/powerpc-fbsd.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/powerpc-fbsd.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -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: stable/7/usr.bin/truss/sparc64-fbsd.c
==============================================================================
--- stable/7/usr.bin/truss/sparc64-fbsd.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/sparc64-fbsd.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -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);
   }


More information about the svn-src-all mailing list